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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -270,7 +270,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
270
270
  options: {
271
271
  arrows: false,
272
272
  speed: transition.duration ? parseInt(transition.duration) : 500,
273
- autoplay: isEditor ? false : triggers.autoPlay !== null,
273
+ autoplay: triggers.autoPlay !== null,
274
274
  ...triggers.autoPlay !== null && {
275
275
  interval: parseInt(triggers.autoPlay) * 1e3
276
276
  },
@@ -467,6 +467,9 @@ const ControlSliderComponent = {
467
467
  settings: {
468
468
  layoutBased: true,
469
469
  type: "object",
470
+ display: {
471
+ type: "settings-block"
472
+ },
470
473
  properties: {
471
474
  triggers: {
472
475
  title: "triggers",
@@ -499,9 +502,9 @@ const ControlSliderComponent = {
499
502
  }
500
503
  },
501
504
  direction: {
502
- title: "direction",
503
505
  icon: "horizontal-resize",
504
506
  tooltip: "Direction",
507
+ title: "direction",
505
508
  type: "string",
506
509
  display: {
507
510
  type: "ratio-group"
@@ -1188,6 +1191,9 @@ const ControlImageRevealSliderComponent = {
1188
1191
  settings: {
1189
1192
  layoutBased: true,
1190
1193
  type: "object",
1194
+ display: {
1195
+ type: "settings-block"
1196
+ },
1191
1197
  properties: {
1192
1198
  imageSize: {
1193
1199
  title: "IMG SIZE",
@@ -1435,27 +1441,34 @@ const ControlImageRevealSliderComponent = {
1435
1441
  }
1436
1442
  }
1437
1443
  };
1438
- const backdropStyle = "LightBox-module__backdropStyle___yWDe2";
1439
- const contentStyle = "LightBox-module__contentStyle___Bgnsq";
1440
- const imageStyle = "LightBox-module__imageStyle___tLIlB";
1441
- const imgWrapper = "LightBox-module__imgWrapper___LuFUp";
1442
- const contain = "LightBox-module__contain___8-yaS";
1443
- const cover = "LightBox-module__cover___hNvOG";
1444
- const caption = "LightBox-module__caption___b6L2I";
1445
- const arrow = "LightBox-module__arrow___iz38X";
1446
- const arrowVertical = "LightBox-module__arrowVertical___Zfz81";
1447
- const nextArrow = "LightBox-module__nextArrow___zkAQN";
1448
- const arrowInner = "LightBox-module__arrowInner___p48sW";
1449
- const arrowImg = "LightBox-module__arrowImg___pNV88";
1450
- const mirror = "LightBox-module__mirror___pjeXc";
1451
- const thumbsContainer = "LightBox-module__thumbsContainer___osSma";
1452
- const thumbItem = "LightBox-module__thumbItem___HvnF3";
1453
- const thumbImage = "LightBox-module__thumbImage___OJ19m";
1454
- const fadeIn = "LightBox-module__fadeIn___0m5GW";
1455
- const slideInLeft = "LightBox-module__slideInLeft___gPYwC";
1456
- const slideInRight = "LightBox-module__slideInRight___S-pPp";
1457
- const slideInTop = "LightBox-module__slideInTop___DFdAj";
1458
- const slideInBottom = "LightBox-module__slideInBottom___m27kZ";
1444
+ const backdropStyle = "Lightbox-module__backdropStyle___y7avj";
1445
+ const contentStyle = "Lightbox-module__contentStyle___FzFaW";
1446
+ const imageStyle = "Lightbox-module__imageStyle___Qb7f5";
1447
+ const imgWrapper = "Lightbox-module__imgWrapper___cdytV";
1448
+ const contain = "Lightbox-module__contain___5gATW";
1449
+ const cover = "Lightbox-module__cover___8HZy7";
1450
+ const caption = "Lightbox-module__caption___3e-22";
1451
+ const lightboxSplide = "Lightbox-module__lightboxSplide___yMC4v";
1452
+ const arrow = "Lightbox-module__arrow___s3Bn2";
1453
+ const arrowVertical = "Lightbox-module__arrowVertical___6ztxz";
1454
+ const nextArrow = "Lightbox-module__nextArrow___i23DU";
1455
+ const arrowInner = "Lightbox-module__arrowInner___Mm3xe";
1456
+ const arrowImg = "Lightbox-module__arrowImg___UxHPR";
1457
+ const mirror = "Lightbox-module__mirror___50NCE";
1458
+ const thumbsContainerVertical = "Lightbox-module__thumbsContainerVertical___lVaf-";
1459
+ const thumbsContainer = "Lightbox-module__thumbsContainer___DqOCP";
1460
+ const thumbsAlignStart = "Lightbox-module__thumbsAlignStart___uiFIV";
1461
+ const thumbsAlignCenter = "Lightbox-module__thumbsAlignCenter___sbUPA";
1462
+ const thumbsAlignEnd = "Lightbox-module__thumbsAlignEnd___OA9N4";
1463
+ const thumbItem = "Lightbox-module__thumbItem___zROyu";
1464
+ const thumbImage = "Lightbox-module__thumbImage___xGakV";
1465
+ const closeButton = "Lightbox-module__closeButton___r3Dur";
1466
+ const fadeIn = "Lightbox-module__fadeIn___sHwRK";
1467
+ const slideInLeft = "Lightbox-module__slideInLeft___P-XRo";
1468
+ const slideInRight = "Lightbox-module__slideInRight___ZQqFi";
1469
+ const slideInTop = "Lightbox-module__slideInTop___XRKCs";
1470
+ const slideInBottom = "Lightbox-module__slideInBottom___TYOBS";
1471
+ const scaleSlide = "Lightbox-module__scaleSlide___wS7d4";
1459
1472
  const styles = {
1460
1473
  backdropStyle,
1461
1474
  contentStyle,
@@ -1464,31 +1477,80 @@ const styles = {
1464
1477
  contain,
1465
1478
  cover,
1466
1479
  caption,
1480
+ lightboxSplide,
1467
1481
  arrow,
1468
1482
  arrowVertical,
1469
1483
  nextArrow,
1470
1484
  arrowInner,
1471
1485
  arrowImg,
1472
1486
  mirror,
1487
+ thumbsContainerVertical,
1473
1488
  thumbsContainer,
1489
+ thumbsAlignStart,
1490
+ thumbsAlignCenter,
1491
+ thumbsAlignEnd,
1474
1492
  thumbItem,
1475
1493
  thumbImage,
1494
+ closeButton,
1476
1495
  fadeIn,
1477
1496
  slideInLeft,
1478
1497
  slideInRight,
1479
1498
  slideInTop,
1480
- slideInBottom
1499
+ slideInBottom,
1500
+ scaleSlide
1501
+ };
1502
+ const getPositionStyles = (position, offset) => {
1503
+ const styles2 = {};
1504
+ const [vertical, horizontal] = position.split("-");
1505
+ if (vertical === "top") {
1506
+ styles2.top = "0";
1507
+ styles2.bottom = "auto";
1508
+ } else if (vertical === "middle") {
1509
+ styles2.top = "50%";
1510
+ styles2.bottom = "auto";
1511
+ } else if (vertical === "bottom") {
1512
+ styles2.top = "auto";
1513
+ styles2.bottom = "0";
1514
+ }
1515
+ if (horizontal === "left") {
1516
+ styles2.left = "0";
1517
+ styles2.right = "auto";
1518
+ } else if (horizontal === "center") {
1519
+ styles2.left = "50%";
1520
+ styles2.right = "auto";
1521
+ } else if (horizontal === "right") {
1522
+ styles2.left = "auto";
1523
+ styles2.right = "0";
1524
+ }
1525
+ if (vertical === "middle" && horizontal === "center") {
1526
+ styles2.transform = `translate(calc(-50% + ${offset.x}px), calc(-50% + ${offset.y}px))`;
1527
+ } else if (vertical === "middle") {
1528
+ styles2.transform = `translate(${offset.x}px, calc(-50% + ${offset.y}px))`;
1529
+ } else if (horizontal === "center") {
1530
+ styles2.transform = `translate(calc(-50% + ${offset.x}px), ${offset.y}px)`;
1531
+ } else {
1532
+ styles2.transform = `translate(${offset.x}px, ${offset.y}px)`;
1533
+ }
1534
+ return styles2;
1481
1535
  };
1482
- function LightboxGallery({ settings, content, styles: styles2, portalId }) {
1536
+ function LightboxGallery({ settings, content, styles: styles2, portalId, activeEvent }) {
1483
1537
  const [open, setOpen] = React.useState(false);
1484
- const { url: coverUrl } = settings.cover;
1485
- return /* @__PURE__ */ jsxs("div", { children: [
1538
+ const { url } = settings.thumbnailBlock.cover;
1539
+ useEffect(() => {
1540
+ if (activeEvent === "close") {
1541
+ setOpen(false);
1542
+ }
1543
+ if (activeEvent === "open") {
1544
+ setOpen(true);
1545
+ }
1546
+ }, [activeEvent]);
1547
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1486
1548
  /* @__PURE__ */ jsx(
1487
1549
  "img",
1488
1550
  {
1489
- src: coverUrl,
1551
+ src: url,
1490
1552
  alt: "Cover",
1491
- style: { width: "100%", height: "100%", cursor: "pointer" },
1553
+ style: { width: "100%", height: "100%", cursor: "pointer", objectFit: "cover" },
1492
1554
  onClick: () => setOpen(true)
1493
1555
  }
1494
1556
  ),
@@ -1496,9 +1558,10 @@ function LightboxGallery({ settings, content, styles: styles2, portalId }) {
1496
1558
  ] });
1497
1559
  }
1498
1560
  const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = true, closeOnEsc = true, portalId }) => {
1499
- var _a;
1500
1561
  const [currentIndex, setCurrentIndex] = React.useState(0);
1501
1562
  const lightboxRef = useRef(null);
1563
+ const resizeObserverRef = useRef(null);
1564
+ const { appear, triggers, slider, thumbnail, controls, area, caption: caption2, layout } = settings.lightboxBlock;
1502
1565
  const handleBackdropClick = (e) => {
1503
1566
  if (!closeOnBackdropClick) return;
1504
1567
  if (e.target === e.currentTarget) {
@@ -1512,12 +1575,12 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1512
1575
  }
1513
1576
  };
1514
1577
  const onImageClick = (e) => {
1515
- var _a2, _b;
1516
- if (settings.triggers.type === "click" && settings.triggers.switch === "image") {
1578
+ var _a, _b;
1579
+ if (triggers.type === "click" && triggers.switch === "image") {
1517
1580
  e.stopPropagation();
1518
- (_a2 = lightboxRef.current) == null ? void 0 : _a2.go("+1");
1581
+ (_a = lightboxRef.current) == null ? void 0 : _a.go("+1");
1519
1582
  }
1520
- if (settings.triggers.type === "click" && settings.triggers.switch === "50/50") {
1583
+ if (triggers.type === "click" && triggers.switch === "50/50") {
1521
1584
  e.stopPropagation();
1522
1585
  const img2 = e.currentTarget;
1523
1586
  const rect = img2.getBoundingClientRect();
@@ -1526,7 +1589,7 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1526
1589
  const imgWidth = rect.width;
1527
1590
  const imgHeight = rect.height;
1528
1591
  let dir;
1529
- if (settings.slider.direction === "horiz") {
1592
+ if (slider.direction === "horiz") {
1530
1593
  dir = clickX < imgWidth / 2 ? "-1" : "+1";
1531
1594
  } else {
1532
1595
  dir = clickY < imgHeight / 2 ? "-1" : "+1";
@@ -1557,16 +1620,66 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1557
1620
  useEffect(() => {
1558
1621
  if (isOpen) setCurrentIndex(0);
1559
1622
  }, [isOpen]);
1623
+ useEffect(() => {
1624
+ if (!isOpen) return;
1625
+ if (resizeObserverRef.current) {
1626
+ resizeObserverRef.current.disconnect();
1627
+ resizeObserverRef.current = null;
1628
+ }
1629
+ const timeoutId = setTimeout(() => {
1630
+ const activeSlide = document.querySelector(".splide__slide.is-active");
1631
+ if (!activeSlide) return;
1632
+ const img2 = activeSlide.querySelector("img");
1633
+ const container = activeSlide.querySelector(`.${styles.imgWrapper}`);
1634
+ if (!img2 || !container) return;
1635
+ const updateImageSize = () => {
1636
+ if (!img2.naturalWidth || !img2.naturalHeight) return;
1637
+ const imageAspectRatio = img2.naturalWidth / img2.naturalHeight;
1638
+ const containerWidth = container.clientWidth;
1639
+ const containerHeight = container.clientHeight;
1640
+ const containerAspectRatio = containerWidth / containerHeight;
1641
+ if (imageAspectRatio > containerAspectRatio) {
1642
+ img2.style.width = "100%";
1643
+ } else {
1644
+ img2.style.height = "100%";
1645
+ }
1646
+ };
1647
+ if (img2.complete) {
1648
+ updateImageSize();
1649
+ } else {
1650
+ img2.onload = updateImageSize;
1651
+ }
1652
+ resizeObserverRef.current = new ResizeObserver(() => {
1653
+ updateImageSize();
1654
+ });
1655
+ resizeObserverRef.current.observe(container);
1656
+ resizeObserverRef.current.observe(img2);
1657
+ }, 0);
1658
+ return () => {
1659
+ clearTimeout(timeoutId);
1660
+ if (resizeObserverRef.current) {
1661
+ resizeObserverRef.current.disconnect();
1662
+ resizeObserverRef.current = null;
1663
+ }
1664
+ };
1665
+ }, [isOpen, currentIndex, content]);
1560
1666
  const handleArrowClick = (dir) => {
1561
- var _a2;
1562
- (_a2 = lightboxRef.current) == null ? void 0 : _a2.go(dir);
1667
+ var _a;
1668
+ (_a = lightboxRef.current) == null ? void 0 : _a.go(dir);
1563
1669
  };
1564
- const appearDurationMs = ((_a = settings.appear) == null ? void 0 : _a.duration) ? parseInt(settings.appear.duration) : 300;
1670
+ const appearDurationMs = appear.duration ? parseInt(appear.duration) : 300;
1565
1671
  const appearClass = (() => {
1566
- var _a2, _b;
1567
- if (((_a2 = settings.appear) == null ? void 0 : _a2.type) === "fade in") return styles.fadeIn;
1568
- if (((_b = settings.appear) == null ? void 0 : _b.type) === "slide in") {
1569
- switch (settings.appear.direction) {
1672
+ if (appear.type === "fade in") return styles.fadeIn;
1673
+ if (appear.type === "slide in") {
1674
+ return "";
1675
+ }
1676
+ if (appear.type === "mix") return styles.fadeIn;
1677
+ return styles.fadeIn;
1678
+ })();
1679
+ const backdropAppearClass = (() => {
1680
+ if (appear.type === "fade in") return styles.fadeIn;
1681
+ if (appear.type === "slide in" || appear.type === "mix") {
1682
+ switch (appear.direction) {
1570
1683
  case "left":
1571
1684
  return styles.slideInLeft;
1572
1685
  case "right":
@@ -1586,18 +1699,20 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1586
1699
  /* @__PURE__ */ jsx(
1587
1700
  "div",
1588
1701
  {
1589
- className: cn(styles.backdropStyle, styles.fadeIn),
1590
- style: { backgroundColor: settings.area.color, backdropFilter: `blur(${settings.area.blur}px)`, animationDuration: `${appearDurationMs}ms`, animationTimingFunction: "ease", animationFillMode: "both" },
1702
+ className: cn(styles.backdropStyle, backdropAppearClass),
1703
+ style: { backgroundColor: area.color, backdropFilter: `blur(${area.blur}px)`, animationDuration: `${appearDurationMs}ms`, animationTimingFunction: "ease", animationFillMode: "both" },
1591
1704
  onClick: handleBackdropClick,
1592
1705
  children: /* @__PURE__ */ jsxs(
1593
1706
  "div",
1594
1707
  {
1595
1708
  className: cn(styles.contentStyle, appearClass),
1596
1709
  style: {
1597
- padding: `${settings.layout.padding.top}px ${settings.layout.padding.right}px ${settings.layout.padding.bottom}px ${settings.layout.padding.left}px`,
1710
+ padding: `${layout.padding.top}px ${layout.padding.right}px ${layout.padding.bottom}px ${layout.padding.left}px`,
1598
1711
  animationDuration: `${appearDurationMs}ms`,
1599
1712
  animationTimingFunction: "ease",
1600
- animationFillMode: "both"
1713
+ animationFillMode: "both",
1714
+ ...appear.type === "mix" && { animationDelay: "0.5s" },
1715
+ "--splide-speed": triggers.duration || "500ms"
1601
1716
  },
1602
1717
  children: [
1603
1718
  /* @__PURE__ */ jsx(
@@ -1607,55 +1722,76 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1607
1722
  setCurrentIndex(splide.index);
1608
1723
  },
1609
1724
  ref: lightboxRef,
1725
+ className: styles.lightboxSplide,
1610
1726
  options: {
1611
1727
  arrows: false,
1612
- speed: settings.triggers.duration ? parseInt(settings.triggers.duration) : 500,
1613
- direction: settings.slider.direction === "horiz" || settings.slider.type === "fade" ? "ltr" : "ttb",
1728
+ speed: triggers.duration ? parseInt(triggers.duration) : 500,
1729
+ direction: slider.direction === "horiz" || slider.type === "fade" || slider.type === "scale" ? "ltr" : "ttb",
1614
1730
  pagination: false,
1615
- drag: settings.triggers.type === "drag",
1731
+ drag: triggers.type === "drag",
1616
1732
  perPage: 1,
1617
1733
  width: "100%",
1618
1734
  height: "100%",
1619
- type: settings.slider.type === "fade" ? "fade" : "loop",
1735
+ type: slider.type === "fade" || slider.type === "scale" ? "fade" : "loop",
1620
1736
  padding: 0,
1621
- rewind: false
1737
+ rewind: (slider.type === "scale" || slider.type === "fade") && appear.repeat !== "close"
1622
1738
  },
1623
- children: content.map((item, index) => /* @__PURE__ */ jsx(SplideSlide, { children: /* @__PURE__ */ jsx("div", { className: styles.imgWrapper, onClick: handleImageWrapperClick, children: /* @__PURE__ */ jsx(
1624
- "img",
1625
- {
1626
- className: cn(styles.imageStyle, {
1627
- [styles.contain]: item.image.objectFit === "contain",
1628
- [styles.cover]: item.image.objectFit === "cover"
1629
- }),
1630
- src: item.image.url,
1631
- alt: item.image.name ?? "",
1632
- onClick: onImageClick
1633
- }
1634
- ) }) }, index))
1739
+ style: { "--splide-speed": triggers.duration || "500ms" },
1740
+ children: content.map((item, index) => {
1741
+ const positionStyles = getPositionStyles(layout.position, layout.offset);
1742
+ const imageStyle2 = slider.type === "scale" ? (() => {
1743
+ const { transform, ...restStyles } = positionStyles;
1744
+ return {
1745
+ ...restStyles,
1746
+ "--position-transform": transform || "none"
1747
+ };
1748
+ })() : positionStyles;
1749
+ return /* @__PURE__ */ jsx(SplideSlide, { children: /* @__PURE__ */ jsx(
1750
+ "div",
1751
+ {
1752
+ className: styles.imgWrapper,
1753
+ onClick: handleImageWrapperClick,
1754
+ children: /* @__PURE__ */ jsx(
1755
+ "img",
1756
+ {
1757
+ className: cn(styles.imageStyle, {
1758
+ [styles.contain]: item.image.objectFit === "contain",
1759
+ [styles.cover]: item.image.objectFit === "cover",
1760
+ [styles.scaleSlide]: slider.type === "scale"
1761
+ }),
1762
+ src: item.image.url,
1763
+ alt: item.image.name ?? "",
1764
+ onClick: onImageClick,
1765
+ style: imageStyle2
1766
+ }
1767
+ )
1768
+ }
1769
+ ) }, index);
1770
+ })
1635
1771
  }
1636
1772
  ),
1637
- settings.controls.isActive && /* @__PURE__ */ jsxs(Fragment, { children: [
1773
+ controls.isActive && /* @__PURE__ */ jsxs(Fragment, { children: [
1638
1774
  /* @__PURE__ */ jsx(
1639
1775
  "div",
1640
1776
  {
1641
- className: cn(styles.arrow, { [styles.arrowVertical]: settings.slider.direction === "vert" }),
1642
- style: { color: settings.controls.color, ["--arrow-hover-color"]: settings.controls.hover },
1777
+ className: cn(styles.arrow, { [styles.arrowVertical]: slider.direction === "vert" }),
1778
+ style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
1643
1779
  children: /* @__PURE__ */ jsx(
1644
1780
  "button",
1645
1781
  {
1646
1782
  className: styles.arrowInner,
1647
1783
  style: {
1648
- transform: `translate(${scalingValue(settings.controls.offset.x)}, ${scalingValue(settings.controls.offset.y * (settings.slider.direction === "horiz" ? 1 : -1))}) scale(${settings.controls.scale / 100}) rotate(${settings.slider.direction === "horiz" ? "0deg" : "90deg"})`
1784
+ transform: `translate(${scalingValue(controls.offset.x)}, ${scalingValue(controls.offset.y * (slider.direction === "horiz" ? 1 : -1))}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
1649
1785
  },
1650
1786
  onClick: (e) => {
1651
1787
  handleArrowClick("-1");
1652
1788
  },
1653
- children: settings.controls.arrowsImgUrl && /* @__PURE__ */ jsx(
1789
+ children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
1654
1790
  SvgImage,
1655
1791
  {
1656
- url: settings.controls.arrowsImgUrl,
1657
- fill: settings.controls.color,
1658
- hoverFill: settings.controls.hover,
1792
+ url: controls.arrowsImgUrl,
1793
+ fill: controls.color,
1794
+ hoverFill: controls.hover,
1659
1795
  className: cn(styles.arrowImg, styles.mirror)
1660
1796
  }
1661
1797
  )
@@ -1666,25 +1802,25 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1666
1802
  /* @__PURE__ */ jsx(
1667
1803
  "div",
1668
1804
  {
1669
- className: cn(styles.arrow, styles.nextArrow, { [styles.arrowVertical]: settings.slider.direction === "vert" }),
1670
- style: { color: settings.controls.color, ["--arrow-hover-color"]: settings.controls.hover },
1805
+ className: cn(styles.arrow, styles.nextArrow, { [styles.arrowVertical]: slider.direction === "vert" }),
1806
+ style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
1671
1807
  children: /* @__PURE__ */ jsx(
1672
1808
  "button",
1673
1809
  {
1674
1810
  className: styles.arrowInner,
1675
1811
  style: {
1676
- transform: `translate(${scalingValue(settings.controls.offset.x * (settings.slider.direction === "horiz" ? -1 : 1))}, ${scalingValue(settings.controls.offset.y)}) scale(${settings.controls.scale / 100}) rotate(${settings.slider.direction === "horiz" ? "0deg" : "90deg"})`
1812
+ transform: `translate(${scalingValue(controls.offset.x * (slider.direction === "horiz" ? -1 : 1))}, ${scalingValue(controls.offset.y)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
1677
1813
  },
1678
1814
  onClick: (e) => {
1679
1815
  handleArrowClick("+1");
1680
1816
  },
1681
1817
  "aria-label": "Next",
1682
- children: settings.controls.arrowsImgUrl && /* @__PURE__ */ jsx(
1818
+ children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
1683
1819
  SvgImage,
1684
1820
  {
1685
- url: settings.controls.arrowsImgUrl,
1686
- fill: settings.controls.color,
1687
- hoverFill: settings.controls.hover,
1821
+ url: controls.arrowsImgUrl,
1822
+ fill: controls.color,
1823
+ hoverFill: controls.hover,
1688
1824
  className: styles.arrowImg
1689
1825
  }
1690
1826
  )
@@ -1693,15 +1829,51 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1693
1829
  }
1694
1830
  )
1695
1831
  ] }),
1696
- settings.area.closeIconUrl && /* @__PURE__ */ jsx("button", { className: styles.closeButton, style: { top: settings.area.closeIconOffset.y, left: settings.area.closeIconOffset.x }, onClick: onClose, children: /* @__PURE__ */ jsx(SvgImage, { url: settings.area.closeIconUrl, fill: settings.area.color }) }),
1697
- settings.caption.isActive && /* @__PURE__ */ jsx("div", { className: styles.caption, style: { top: settings.caption.offset.y, left: settings.caption.offset.x }, children: /* @__PURE__ */ jsx(RichTextRenderer, { content: content[currentIndex].imageCaption }) }),
1698
- settings.thumbnail.isActive && /* @__PURE__ */ jsx(
1832
+ area.closeIconUrl && (() => {
1833
+ const positionStyles = getPositionStyles(area.closeIconAlign, area.closeIconOffset);
1834
+ const scaleTransform = `scale(${area.closeIconScale})`;
1835
+ const combinedTransform = positionStyles.transform ? `${positionStyles.transform} ${scaleTransform}` : scaleTransform;
1836
+ return /* @__PURE__ */ jsx(
1837
+ "button",
1838
+ {
1839
+ className: styles.closeButton,
1840
+ style: {
1841
+ ...positionStyles,
1842
+ transform: combinedTransform
1843
+ },
1844
+ onClick: onClose,
1845
+ children: /* @__PURE__ */ jsx(SvgImage, { url: area.closeIconUrl })
1846
+ }
1847
+ );
1848
+ })(),
1849
+ caption2.isActive && /* @__PURE__ */ jsx(
1850
+ "div",
1851
+ {
1852
+ className: styles.caption,
1853
+ style: {
1854
+ ...getPositionStyles(caption2.alignment, caption2.offset),
1855
+ ["--link-hover-color"]: caption2.hover
1856
+ },
1857
+ children: /* @__PURE__ */ jsx(RichTextRenderer, { content: content[currentIndex].imageCaption })
1858
+ }
1859
+ ),
1860
+ thumbnail.isActive && /* @__PURE__ */ jsx(
1699
1861
  "div",
1700
1862
  {
1701
- className: cn(styles.thumbsContainer),
1863
+ className: cn(
1864
+ styles.thumbsContainer,
1865
+ {
1866
+ [styles.thumbsContainerVertical]: slider.direction === "vert",
1867
+ [styles.thumbsAlignStart]: thumbnail.align === "start",
1868
+ [styles.thumbsAlignCenter]: thumbnail.align === "center",
1869
+ [styles.thumbsAlignEnd]: thumbnail.align === "end"
1870
+ }
1871
+ ),
1702
1872
  style: {
1703
- gap: `${settings.thumbnail.grid.gap}px`,
1704
- height: `${settings.thumbnail.grid.height}px`
1873
+ gap: `${thumbnail.grid.gap}px`,
1874
+ ...slider.direction === "horiz" ? { height: `${thumbnail.grid.height}px` } : {},
1875
+ ...slider.direction === "vert" ? { width: `${thumbnail.grid.width}px` } : {},
1876
+ ...getPositionStyles(thumbnail.position, thumbnail.offset)
1705
1877
  },
1706
1878
  children: content.map((item, index) => {
1707
1879
  const isActive = index === currentIndex;
@@ -1710,16 +1882,17 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1710
1882
  {
1711
1883
  className: styles.thumbItem,
1712
1884
  style: {
1713
- transform: `scale(${isActive ? settings.thumbnail.activeState.scale : 1})`,
1714
- height: "100%",
1715
- opacity: isActive ? settings.thumbnail.activeState.opacity : settings.thumbnail.opacity,
1716
- ["--thumb-hover"]: settings.thumbnail.activeState.opacity
1885
+ transform: `scale(${isActive ? thumbnail.activeState.scale : 1})`,
1886
+ ...slider.direction === "horiz" ? { height: "100%" } : {},
1887
+ ...slider.direction === "vert" ? { width: "100%" } : {},
1888
+ opacity: isActive ? thumbnail.activeState.opacity : thumbnail.opacity,
1889
+ ["--thumb-hover"]: thumbnail.activeState.opacity
1717
1890
  },
1718
1891
  onClick: (e) => {
1719
- var _a2;
1892
+ var _a;
1720
1893
  e.stopPropagation();
1721
1894
  setCurrentIndex(index);
1722
- (_a2 = lightboxRef.current) == null ? void 0 : _a2.go(index);
1895
+ (_a = lightboxRef.current) == null ? void 0 : _a.go(index);
1723
1896
  },
1724
1897
  children: /* @__PURE__ */ jsx(
1725
1898
  "img",
@@ -1727,7 +1900,11 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1727
1900
  src: item.image.url,
1728
1901
  alt: item.image.name ?? "",
1729
1902
  className: styles.thumbImage,
1730
- style: { objectFit: settings.thumbnail.fit === "cover" ? "cover" : "contain" }
1903
+ style: {
1904
+ objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
1905
+ ...slider.direction === "horiz" ? { height: "100%" } : {},
1906
+ ...slider.direction === "vert" ? { width: "100%" } : {}
1907
+ }
1731
1908
  }
1732
1909
  )
1733
1910
  },
@@ -1763,219 +1940,214 @@ const LightboxComponent = {
1763
1940
  layoutBased: true,
1764
1941
  type: "object",
1765
1942
  properties: {
1766
- cover: {
1767
- title: "COVER",
1768
- icon: "cover",
1769
- tooltip: "Cover Image",
1943
+ thumbnailBlock: {
1944
+ display: {
1945
+ type: "settings-block",
1946
+ triggerEvent: "close"
1947
+ },
1770
1948
  type: "object",
1771
1949
  properties: {
1772
- url: {
1773
- type: "string",
1774
- display: {
1775
- type: "settings-image-input"
1950
+ cover: {
1951
+ title: "COVER",
1952
+ icon: "cover",
1953
+ tooltip: "Cover Image",
1954
+ type: "object",
1955
+ properties: {
1956
+ url: {
1957
+ type: "string",
1958
+ display: {
1959
+ type: "settings-image-input"
1960
+ }
1961
+ }
1776
1962
  }
1777
1963
  }
1778
1964
  }
1779
1965
  },
1780
- appear: {
1781
- title: "APPEAR",
1782
- icon: "transition",
1783
- tooltip: "Appearance",
1784
- type: "object",
1785
- properties: {
1786
- type: {
1787
- type: "string",
1788
- display: {
1789
- type: "ratio-group"
1790
- },
1791
- enum: ["slide in", "fade in", "mix"]
1792
- },
1793
- duration: {
1794
- type: "string",
1795
- label: "T",
1796
- display: {
1797
- type: "step-selector"
1798
- },
1799
- enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
1800
- },
1801
- direction: {
1802
- type: "string",
1803
- title: "FROM",
1804
- display: {
1805
- visible: false,
1806
- type: "direction-control"
1807
- },
1808
- enum: ["top", "bottom", "left", "right"]
1809
- },
1810
- repeat: {
1811
- type: "string",
1812
- title: "Repeat",
1813
- display: {
1814
- type: "ratio-group"
1815
- },
1816
- enum: ["close", "loop"]
1817
- }
1818
- }
1819
- },
1820
- triggers: {
1821
- title: "TRIGGERS",
1822
- icon: "target",
1823
- tooltip: "Triggers",
1824
- type: "object",
1825
- properties: {
1826
- type: {
1827
- type: "string",
1828
- display: {
1829
- type: "ratio-group"
1830
- },
1831
- enum: ["click", "drag", "scroll"]
1832
- },
1833
- switch: {
1834
- type: "string",
1835
- display: {
1836
- type: "ratio-group"
1837
- },
1838
- enum: ["image", "50/50"]
1839
- },
1840
- duration: {
1841
- type: "string",
1842
- label: "T",
1843
- display: {
1844
- type: "step-selector"
1845
- },
1846
- enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
1847
- }
1848
- }
1849
- },
1850
- slider: {
1851
- title: "SLIDER",
1852
- icon: "horizontal-resize",
1853
- tooltip: "Slider",
1854
- type: "object",
1855
- properties: {
1856
- type: {
1857
- type: "string",
1858
- display: {
1859
- type: "ratio-group"
1860
- },
1861
- enum: ["slide", "fade", "scale"]
1862
- },
1863
- direction: {
1864
- type: "string",
1865
- display: {
1866
- visible: false,
1867
- type: "ratio-group"
1868
- },
1869
- enum: ["horiz", "vert"]
1870
- }
1871
- }
1872
- },
1873
- thumbnail: {
1874
- title: "THUMB",
1875
- icon: "thumbnail",
1876
- tooltip: "Thumbnail",
1966
+ lightboxBlock: {
1967
+ display: {
1968
+ type: "settings-block",
1969
+ triggerEvent: "open"
1970
+ },
1877
1971
  type: "object",
1878
1972
  properties: {
1879
- isActive: {
1880
- type: "boolean",
1881
- display: {
1882
- type: "setting-toggle"
1973
+ appear: {
1974
+ title: "APPEAR",
1975
+ icon: "transition",
1976
+ tooltip: "Appearance",
1977
+ type: "object",
1978
+ properties: {
1979
+ type: {
1980
+ type: "string",
1981
+ display: {
1982
+ type: "ratio-group"
1983
+ },
1984
+ enum: ["slide in", "fade in", "mix"]
1985
+ },
1986
+ duration: {
1987
+ type: "string",
1988
+ label: "T",
1989
+ display: {
1990
+ type: "step-selector"
1991
+ },
1992
+ enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
1993
+ },
1994
+ direction: {
1995
+ type: "string",
1996
+ title: "FROM",
1997
+ display: {
1998
+ type: "direction-control"
1999
+ },
2000
+ enum: ["top", "left", "right", "bottom"]
2001
+ },
2002
+ repeat: {
2003
+ type: "string",
2004
+ title: "Repeat",
2005
+ display: {
2006
+ type: "ratio-group"
2007
+ },
2008
+ enum: ["close", "loop"]
2009
+ }
1883
2010
  }
1884
2011
  },
1885
- position: {
1886
- display: {
1887
- type: "align-grid"
1888
- },
1889
- type: "string",
1890
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
1891
- },
1892
- fit: {
1893
- type: "string",
1894
- display: {
1895
- type: "ratio-group"
1896
- },
1897
- enum: ["cover", "fit"]
1898
- },
1899
- align: {
1900
- type: "string",
1901
- title: "Align",
1902
- display: {
1903
- type: "align-vertical"
1904
- },
1905
- enum: ["top", "center", "bottom"]
1906
- },
1907
2012
  triggers: {
1908
- type: "string",
1909
- title: "Triggers",
1910
- display: {
1911
- type: "ratio-group",
1912
- direction: "horizontal"
1913
- },
1914
- enum: ["clk", "hov"]
1915
- },
1916
- grid: {
2013
+ title: "TRIGGERS",
2014
+ icon: "target",
2015
+ tooltip: "Triggers",
1917
2016
  type: "object",
1918
- title: "Grid",
1919
- display: {
1920
- type: "group"
1921
- },
1922
2017
  properties: {
1923
- height: {
1924
- type: "number",
1925
- label: "H",
2018
+ type: {
2019
+ type: "string",
1926
2020
  display: {
1927
- type: "numeric-input"
1928
- }
2021
+ type: "ratio-group"
2022
+ },
2023
+ enum: ["click", "drag"]
1929
2024
  },
1930
- gap: {
1931
- type: "number",
1932
- label: "Gap",
2025
+ switch: {
2026
+ type: "string",
1933
2027
  display: {
1934
- type: "numeric-input"
1935
- }
2028
+ type: "ratio-group"
2029
+ },
2030
+ enum: ["image", "50/50"]
2031
+ },
2032
+ duration: {
2033
+ type: "string",
2034
+ label: "T",
2035
+ display: {
2036
+ type: "step-selector"
2037
+ },
2038
+ enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
1936
2039
  }
1937
2040
  }
1938
2041
  },
1939
- offset: {
2042
+ slider: {
2043
+ title: "SLIDER",
2044
+ icon: "horizontal-resize",
2045
+ tooltip: "Slider",
1940
2046
  type: "object",
1941
- display: {
1942
- type: "offset-controls"
1943
- },
1944
2047
  properties: {
1945
- x: {
1946
- type: "number"
2048
+ type: {
2049
+ type: "string",
2050
+ display: {
2051
+ type: "ratio-group"
2052
+ },
2053
+ enum: ["slide", "fade", "scale"]
1947
2054
  },
1948
- y: {
1949
- type: "number"
2055
+ direction: {
2056
+ type: "string",
2057
+ display: {
2058
+ type: "ratio-group"
2059
+ },
2060
+ enum: ["horiz", "vert"]
1950
2061
  }
1951
2062
  }
1952
2063
  },
1953
- opacity: {
1954
- type: "number",
1955
- title: "Opacity",
1956
- label: "icon:opacity",
1957
- min: 0,
1958
- max: 100,
1959
- step: 1,
1960
- display: {
1961
- type: "numeric-input"
1962
- }
1963
- },
1964
- activeState: {
2064
+ thumbnail: {
2065
+ title: "THUMB",
2066
+ icon: "thumbnail",
2067
+ tooltip: "Thumbnail",
1965
2068
  type: "object",
1966
- title: "ACTIVE",
1967
- display: {
1968
- type: "group"
1969
- },
1970
2069
  properties: {
1971
- scale: {
1972
- type: "number",
1973
- title: "Scale",
1974
- min: 1,
1975
- max: 2,
1976
- step: 0.1,
2070
+ isActive: {
2071
+ type: "boolean",
1977
2072
  display: {
1978
- type: "range-control"
2073
+ type: "setting-toggle"
2074
+ }
2075
+ },
2076
+ position: {
2077
+ display: {
2078
+ type: "align-grid"
2079
+ },
2080
+ type: "string",
2081
+ enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2082
+ },
2083
+ fit: {
2084
+ type: "string",
2085
+ display: {
2086
+ type: "ratio-group"
2087
+ },
2088
+ enum: ["cover", "fit"]
2089
+ },
2090
+ align: {
2091
+ type: "string",
2092
+ title: "Align",
2093
+ display: {
2094
+ type: "align-group",
2095
+ direction: "horizontal"
2096
+ },
2097
+ enum: ["start", "center", "end"]
2098
+ },
2099
+ triggers: {
2100
+ type: "string",
2101
+ title: "Triggers",
2102
+ display: {
2103
+ type: "ratio-group",
2104
+ direction: "horizontal"
2105
+ },
2106
+ enum: ["clk", "hov"]
2107
+ },
2108
+ grid: {
2109
+ type: "object",
2110
+ title: "Grid",
2111
+ display: {
2112
+ type: "group"
2113
+ },
2114
+ properties: {
2115
+ height: {
2116
+ type: "number",
2117
+ label: "H",
2118
+ display: {
2119
+ type: "numeric-input"
2120
+ }
2121
+ },
2122
+ width: {
2123
+ type: "number",
2124
+ label: "W",
2125
+ display: {
2126
+ type: "numeric-input",
2127
+ visible: false
2128
+ }
2129
+ },
2130
+ gap: {
2131
+ type: "number",
2132
+ label: "Gap",
2133
+ display: {
2134
+ type: "numeric-input"
2135
+ }
2136
+ }
2137
+ }
2138
+ },
2139
+ offset: {
2140
+ type: "object",
2141
+ display: {
2142
+ type: "offset-controls"
2143
+ },
2144
+ properties: {
2145
+ x: {
2146
+ type: "number"
2147
+ },
2148
+ y: {
2149
+ type: "number"
2150
+ }
1979
2151
  }
1980
2152
  },
1981
2153
  opacity: {
@@ -1988,280 +2160,444 @@ const LightboxComponent = {
1988
2160
  display: {
1989
2161
  type: "numeric-input"
1990
2162
  }
1991
- }
1992
- }
1993
- }
1994
- }
1995
- },
1996
- layout: {
1997
- title: "LAYOUT",
1998
- icon: "layout",
1999
- tooltip: "Layout",
2000
- type: "object",
2001
- properties: {
2002
- position: {
2003
- display: {
2004
- type: "align-grid"
2005
- },
2006
- type: "string",
2007
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2163
+ },
2164
+ activeState: {
2165
+ type: "object",
2166
+ title: "ACTIVE",
2167
+ display: {
2168
+ type: "group"
2169
+ },
2170
+ properties: {
2171
+ scale: {
2172
+ type: "number",
2173
+ title: "Scale",
2174
+ min: 0.5,
2175
+ max: 5,
2176
+ step: 0.1,
2177
+ display: {
2178
+ type: "range-control"
2179
+ }
2180
+ },
2181
+ opacity: {
2182
+ type: "number",
2183
+ title: "Opacity",
2184
+ label: "icon:opacity",
2185
+ min: 0,
2186
+ max: 100,
2187
+ step: 1,
2188
+ display: {
2189
+ type: "numeric-input"
2190
+ }
2191
+ }
2192
+ }
2193
+ }
2194
+ }
2008
2195
  },
2009
- offset: {
2196
+ layout: {
2197
+ title: "LAYOUT",
2198
+ icon: "layout",
2199
+ tooltip: "Layout",
2010
2200
  type: "object",
2011
- display: {
2012
- type: "offset-controls"
2013
- },
2014
2201
  properties: {
2015
- x: {
2016
- type: "number"
2202
+ position: {
2203
+ display: {
2204
+ type: "align-grid"
2205
+ },
2206
+ type: "string",
2207
+ enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2017
2208
  },
2018
- y: {
2019
- type: "number"
2209
+ offset: {
2210
+ type: "object",
2211
+ display: {
2212
+ type: "offset-controls"
2213
+ },
2214
+ properties: {
2215
+ x: {
2216
+ type: "number"
2217
+ },
2218
+ y: {
2219
+ type: "number"
2220
+ }
2221
+ }
2222
+ },
2223
+ padding: {
2224
+ type: "object",
2225
+ title: "Padding",
2226
+ display: {
2227
+ type: "padding-controls"
2228
+ },
2229
+ properties: {
2230
+ top: {
2231
+ type: "number"
2232
+ },
2233
+ left: {
2234
+ type: "number"
2235
+ },
2236
+ right: {
2237
+ type: "number"
2238
+ },
2239
+ bottom: {
2240
+ type: "number"
2241
+ }
2242
+ }
2020
2243
  }
2021
2244
  }
2022
2245
  },
2023
- padding: {
2246
+ controls: {
2247
+ title: "CONTROLS",
2248
+ icon: "controls",
2249
+ tooltip: "Controls",
2024
2250
  type: "object",
2025
- title: "Padding",
2026
- display: {
2027
- type: "padding-controls"
2028
- },
2029
2251
  properties: {
2030
- top: {
2031
- type: "number"
2252
+ isActive: {
2253
+ type: "boolean",
2254
+ display: {
2255
+ type: "setting-toggle"
2256
+ }
2032
2257
  },
2033
- right: {
2034
- type: "number"
2258
+ arrowsImgUrl: {
2259
+ type: ["string", "null"],
2260
+ display: {
2261
+ type: "settings-image-input"
2262
+ }
2035
2263
  },
2036
- bottom: {
2037
- type: "number"
2264
+ offset: {
2265
+ type: "object",
2266
+ display: {
2267
+ type: "offset-controls"
2268
+ },
2269
+ properties: {
2270
+ x: {
2271
+ type: "number"
2272
+ },
2273
+ y: {
2274
+ type: "number"
2275
+ }
2276
+ }
2038
2277
  },
2039
- left: {
2040
- type: "number"
2278
+ scale: {
2279
+ type: "number",
2280
+ title: "Scale",
2281
+ min: 0.5,
2282
+ max: 5,
2283
+ step: 0.1,
2284
+ display: {
2285
+ type: "range-control"
2286
+ }
2287
+ },
2288
+ color: {
2289
+ title: "Color",
2290
+ type: "string",
2291
+ display: {
2292
+ type: "settings-color-picker",
2293
+ format: "single"
2294
+ }
2295
+ },
2296
+ hover: {
2297
+ title: "Hover",
2298
+ type: "string",
2299
+ display: {
2300
+ type: "settings-color-picker",
2301
+ format: "single"
2302
+ }
2041
2303
  }
2042
2304
  }
2043
- }
2044
- }
2045
- },
2046
- controls: {
2047
- title: "CONTROLS",
2048
- icon: "controls",
2049
- tooltip: "Controls",
2050
- type: "object",
2051
- properties: {
2052
- isActive: {
2053
- type: "boolean",
2054
- display: {
2055
- type: "setting-toggle"
2056
- }
2057
2305
  },
2058
- arrowsImgUrl: {
2059
- type: ["string", "null"],
2060
- display: {
2061
- type: "settings-image-input"
2062
- }
2063
- },
2064
- offset: {
2306
+ area: {
2307
+ title: "AREA",
2308
+ icon: "area",
2309
+ tooltip: "Area",
2065
2310
  type: "object",
2066
- display: {
2067
- type: "offset-controls"
2068
- },
2069
2311
  properties: {
2070
- x: {
2071
- type: "number"
2312
+ color: {
2313
+ type: "string",
2314
+ display: {
2315
+ type: "settings-color-picker",
2316
+ format: "single"
2317
+ }
2072
2318
  },
2073
- y: {
2074
- type: "number"
2319
+ blur: {
2320
+ type: "number",
2321
+ label: "icon:blur",
2322
+ display: {
2323
+ type: "numeric-input"
2324
+ }
2325
+ },
2326
+ closeIconUrl: {
2327
+ type: ["string", "null"],
2328
+ title: "CLOSE ICON",
2329
+ display: {
2330
+ type: "settings-image-input"
2331
+ }
2332
+ },
2333
+ closeIconAlign: {
2334
+ display: {
2335
+ type: "align-grid",
2336
+ direction: "horizontal"
2337
+ },
2338
+ type: "string",
2339
+ enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2340
+ },
2341
+ closeIconScale: {
2342
+ type: "number",
2343
+ title: "Scale",
2344
+ min: 0.5,
2345
+ max: 5,
2346
+ step: 0.1,
2347
+ display: {
2348
+ type: "range-control"
2349
+ }
2350
+ },
2351
+ closeIconOffset: {
2352
+ type: "object",
2353
+ display: {
2354
+ type: "offset-controls"
2355
+ },
2356
+ properties: {
2357
+ x: {
2358
+ type: "number"
2359
+ },
2360
+ y: {
2361
+ type: "number"
2362
+ }
2363
+ }
2075
2364
  }
2076
2365
  }
2077
2366
  },
2078
- scale: {
2079
- type: "number",
2080
- title: "Scale",
2081
- min: 0,
2082
- max: 1,
2083
- display: {
2084
- type: "range-control"
2085
- }
2086
- },
2087
- color: {
2088
- title: "Color",
2089
- type: "string",
2090
- display: {
2091
- type: "settings-color-picker",
2092
- format: "single"
2093
- }
2094
- },
2095
- hover: {
2096
- title: "Hover",
2097
- type: "string",
2098
- display: {
2099
- type: "settings-color-picker",
2100
- format: "single"
2101
- }
2102
- }
2103
- }
2104
- },
2105
- area: {
2106
- title: "AREA",
2107
- icon: "area",
2108
- tooltip: "Area",
2109
- type: "object",
2110
- properties: {
2111
- color: {
2112
- type: "string",
2113
- display: {
2114
- type: "settings-color-picker",
2115
- format: "single"
2116
- }
2117
- },
2118
- blur: {
2119
- type: "number",
2120
- label: "icon:blur",
2121
- display: {
2122
- type: "numeric-input"
2123
- }
2124
- },
2125
- closeIconUrl: {
2126
- type: ["string", "null"],
2127
- title: "CLOSE ICON",
2128
- display: {
2129
- type: "settings-image-input"
2130
- }
2131
- },
2132
- closeIconAlign: {
2133
- display: {
2134
- type: "align-grid",
2135
- direction: "horizontal"
2136
- },
2137
- type: "string",
2138
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2139
- },
2140
- closeIconOffset: {
2367
+ caption: {
2368
+ title: "DESC",
2369
+ icon: "text-icon",
2370
+ tooltip: "Description",
2141
2371
  type: "object",
2142
- display: {
2143
- type: "offset-controls"
2144
- },
2145
2372
  properties: {
2146
- x: {
2147
- type: "number"
2373
+ isActive: {
2374
+ type: "boolean",
2375
+ display: {
2376
+ type: "setting-toggle"
2377
+ }
2148
2378
  },
2149
- y: {
2150
- type: "number"
2379
+ alignment: {
2380
+ type: "string",
2381
+ display: {
2382
+ type: "align-grid"
2383
+ },
2384
+ enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2385
+ },
2386
+ offset: {
2387
+ type: "object",
2388
+ display: {
2389
+ type: "offset-controls"
2390
+ },
2391
+ properties: {
2392
+ x: {
2393
+ type: "number"
2394
+ },
2395
+ y: {
2396
+ type: "number"
2397
+ }
2398
+ }
2399
+ },
2400
+ hover: {
2401
+ title: "Hover",
2402
+ type: "string",
2403
+ display: {
2404
+ type: "settings-color-picker",
2405
+ format: "single"
2406
+ }
2151
2407
  }
2152
2408
  }
2153
2409
  }
2154
2410
  }
2411
+ }
2412
+ },
2413
+ default: {
2414
+ thumbnailBlock: {
2415
+ cover: {
2416
+ url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMHNP08T27H1649S67NZV.png"
2417
+ }
2155
2418
  },
2156
- caption: {
2157
- title: "DESC",
2158
- icon: "text-icon",
2159
- tooltip: "Description",
2160
- type: "object",
2161
- properties: {
2162
- alignment: {
2163
- type: "string",
2164
- display: {
2165
- type: "align-grid"
2166
- },
2167
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2168
- },
2169
- offset: {
2170
- type: "object",
2171
- display: {
2172
- type: "offset-controls"
2173
- },
2174
- properties: {
2175
- x: {
2176
- type: "number"
2177
- },
2178
- y: {
2179
- type: "number"
2180
- }
2181
- }
2419
+ lightboxBlock: {
2420
+ appear: {
2421
+ type: "slide in",
2422
+ duration: "1000ms",
2423
+ direction: "right",
2424
+ repeat: "close"
2425
+ },
2426
+ triggers: {
2427
+ type: "click",
2428
+ switch: "image",
2429
+ duration: "2000ms"
2430
+ },
2431
+ slider: {
2432
+ type: "fade",
2433
+ direction: "horiz"
2434
+ },
2435
+ thumbnail: {
2436
+ isActive: true,
2437
+ position: "bottom-center",
2438
+ fit: "cover",
2439
+ align: "center",
2440
+ triggers: "clk",
2441
+ grid: {
2442
+ height: 60,
2443
+ width: 60,
2444
+ gap: 8
2182
2445
  },
2183
- hover: {
2184
- title: "Hover",
2185
- type: "string",
2186
- display: {
2187
- type: "settings-color-picker",
2188
- format: "single"
2189
- }
2446
+ offset: { x: 0, y: 0 },
2447
+ opacity: 100,
2448
+ activeState: {
2449
+ scale: 1,
2450
+ opacity: 100
2190
2451
  }
2452
+ },
2453
+ layout: {
2454
+ position: "middle-center",
2455
+ offset: { x: 0, y: 0 },
2456
+ padding: { top: 0, right: 0, bottom: 0, left: 0 }
2457
+ },
2458
+ controls: {
2459
+ isActive: true,
2460
+ arrowsImgUrl: null,
2461
+ offset: { x: 0, y: 0 },
2462
+ scale: 1,
2463
+ color: "#000000",
2464
+ hover: "#cccccc"
2465
+ },
2466
+ area: {
2467
+ color: "rgba(0,0,0,0.9)",
2468
+ blur: 0,
2469
+ closeIconUrl: null,
2470
+ closeIconAlign: "top-right",
2471
+ closeIconOffset: { x: 0, y: 0 },
2472
+ closeIconScale: 1
2473
+ },
2474
+ caption: {
2475
+ isActive: true,
2476
+ alignment: "middle-center",
2477
+ offset: { x: 0, y: 0 },
2478
+ hover: "#cccccc"
2191
2479
  }
2192
2480
  }
2193
2481
  },
2194
- default: {
2195
- cover: {
2196
- url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMHNP08T27H1649S67NZV.png"
2482
+ displayRules: [
2483
+ {
2484
+ if: {
2485
+ name: "lightboxBlock.appear.type",
2486
+ value: "slide in"
2487
+ },
2488
+ then: {
2489
+ name: "properties.lightboxBlock.properties.appear.properties.direction.display.visible",
2490
+ value: true
2491
+ }
2197
2492
  },
2198
- appear: {
2199
- type: "slide in",
2200
- duration: "1000ms",
2201
- direction: "right",
2202
- repeat: "close"
2493
+ {
2494
+ if: {
2495
+ name: "lightboxBlock.slider.direction",
2496
+ value: "vert"
2497
+ },
2498
+ then: {
2499
+ name: "properties.lightboxBlock.properties.thumbnail.properties.position.display.direction",
2500
+ value: "vertical"
2501
+ }
2203
2502
  },
2204
- triggers: {
2205
- type: "click",
2206
- switch: "image",
2207
- duration: "2000ms"
2503
+ {
2504
+ if: {
2505
+ name: "lightboxBlock.slider.direction",
2506
+ value: "vert"
2507
+ },
2508
+ then: {
2509
+ name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.width.display.visible",
2510
+ value: true
2511
+ }
2208
2512
  },
2209
- slider: {
2210
- type: "fade",
2211
- direction: "horiz"
2513
+ {
2514
+ if: {
2515
+ name: "lightboxBlock.slider.direction",
2516
+ value: "horiz"
2517
+ },
2518
+ then: {
2519
+ name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.height.display.visible",
2520
+ value: true
2521
+ }
2212
2522
  },
2213
- thumbnail: {
2214
- isActive: true,
2215
- position: "bottom-center",
2216
- fit: "cover",
2217
- align: "center",
2218
- triggers: "click",
2219
- grid: {
2220
- height: 60,
2221
- gap: 8
2523
+ {
2524
+ if: {
2525
+ name: "lightboxBlock.slider.direction",
2526
+ value: "vert"
2222
2527
  },
2223
- offset: { x: 0, y: 0 },
2224
- opacity: 100,
2225
- activeState: {
2226
- scale: 1,
2227
- opacity: 100
2528
+ then: {
2529
+ name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.height.display.visible",
2530
+ value: false
2228
2531
  }
2229
2532
  },
2230
- layout: {
2231
- position: "middle-center",
2232
- offset: { x: 0, y: 0 },
2233
- padding: { top: 0, right: 0, bottom: 0, left: 0 }
2533
+ {
2534
+ if: {
2535
+ name: "lightboxBlock.slider.direction",
2536
+ value: "horiz"
2537
+ },
2538
+ then: {
2539
+ name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.width.display.visible",
2540
+ value: false
2541
+ }
2234
2542
  },
2235
- controls: {
2236
- isActive: true,
2237
- arrowsImgUrl: null,
2238
- offset: { x: 0, y: 0 },
2239
- scale: 1,
2240
- color: "#000000",
2241
- hover: "#cccccc"
2543
+ {
2544
+ if: {
2545
+ name: "lightboxBlock.appear.type",
2546
+ value: "mix"
2547
+ },
2548
+ then: {
2549
+ name: "properties.lightboxBlock.properties.appear.properties.direction.display.visible",
2550
+ value: true
2551
+ }
2242
2552
  },
2243
- area: {
2244
- color: "rgba(0,0,0,0.9)",
2245
- blur: 0,
2246
- closeIconUrl: null,
2247
- closeIconAlign: "top-right",
2248
- closeIconOffset: { x: 0, y: 0 }
2553
+ {
2554
+ if: {
2555
+ name: "lightboxBlock.appear.type",
2556
+ value: "fade in"
2557
+ },
2558
+ then: {
2559
+ name: "properties.lightboxBlock.properties.appear.properties.direction.display.visible",
2560
+ value: false
2561
+ }
2249
2562
  },
2250
- caption: {
2251
- alignment: "middle-center",
2252
- offset: { x: 0, y: 0 },
2253
- hover: "#cccccc"
2254
- }
2255
- },
2256
- displayRules: [
2257
2563
  {
2258
2564
  if: {
2259
- name: "appear.type",
2260
- value: "slide in"
2565
+ name: "lightboxBlock.triggers.type",
2566
+ value: "click"
2261
2567
  },
2262
2568
  then: {
2263
- value: true,
2264
- name: "properties.appear.properties.direction.display.visible"
2569
+ name: "properties.lightboxBlock.properties.triggers.properties.duration.display.visible",
2570
+ value: true
2571
+ }
2572
+ },
2573
+ {
2574
+ if: {
2575
+ name: "lightboxBlock.triggers.type",
2576
+ value: "click"
2577
+ },
2578
+ then: {
2579
+ name: "properties.lightboxBlock.properties.triggers.properties.switch.display.visible",
2580
+ value: true
2581
+ }
2582
+ },
2583
+ {
2584
+ if: {
2585
+ name: "lightboxBlock.triggers.type",
2586
+ value: "drag"
2587
+ },
2588
+ then: {
2589
+ name: "properties.lightboxBlock.properties.triggers.properties.duration.display.visible",
2590
+ value: false
2591
+ }
2592
+ },
2593
+ {
2594
+ if: {
2595
+ name: "lightboxBlock.triggers.type",
2596
+ value: "drag"
2597
+ },
2598
+ then: {
2599
+ name: "properties.lightboxBlock.properties.triggers.properties.switch.display.visible",
2600
+ value: false
2265
2601
  }
2266
2602
  }
2267
2603
  ]
@@ -2313,7 +2649,7 @@ const LightboxComponent = {
2313
2649
  default: [
2314
2650
  {
2315
2651
  image: {
2316
- objectFit: "cover",
2652
+ objectFit: "contain",
2317
2653
  url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMHNP08T27H1649S67NZV.png",
2318
2654
  name: "Slider-1.png"
2319
2655
  },
@@ -2326,7 +2662,7 @@ const LightboxComponent = {
2326
2662
  },
2327
2663
  {
2328
2664
  image: {
2329
- objectFit: "cover",
2665
+ objectFit: "contain",
2330
2666
  url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMTZA3RYMXKF0M095D6JD.png",
2331
2667
  name: "Slider-2.png"
2332
2668
  },
@@ -2339,7 +2675,7 @@ const LightboxComponent = {
2339
2675
  },
2340
2676
  {
2341
2677
  image: {
2342
- objectFit: "cover",
2678
+ objectFit: "contain",
2343
2679
  url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMVSCMPVJBG2WF5KJZYHZ.png",
2344
2680
  name: "Slider-3.png"
2345
2681
  },