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

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