@cntrl-site/sdk 1.24.0 → 1.24.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/LICENSE +21 -21
- package/README.md +2 -2
- package/dist/Components/ControlSlider/ControlSlider.d.ts +1 -2
- package/dist/Components/ImageRevealSlider/ControlImageRevealSliderComponent.d.ts +210 -0
- package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +38 -0
- package/dist/index.js +825 -108
- package/dist/index.mjs +826 -109
- package/dist/sdk.css +1 -1
- package/dist/types/component/Component.d.ts +0 -1
- package/package.json +83 -79
- package/resources/template.scss.ejs +50 -50
package/dist/index.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import { URL } from "url";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import UAParser from "ua-parser-js";
|
|
5
5
|
import * as MP4Box from "mp4box";
|
|
6
|
-
import {
|
|
7
|
-
import { useState, useEffect, useRef } from "react";
|
|
6
|
+
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
7
|
+
import { useState, useEffect, useRef, useMemo } from "react";
|
|
8
8
|
import { Splide, SplideSlide } from "@splidejs/react-splide";
|
|
9
9
|
import cn from "classnames";
|
|
10
10
|
var SectionHeightMode = /* @__PURE__ */ ((SectionHeightMode2) => {
|
|
@@ -1303,7 +1303,7 @@ const bottomRightAlignment = "ControlSlider-module__bottomRightAlignment___kEwrz
|
|
|
1303
1303
|
const clickOverlay = "ControlSlider-module__clickOverlay___DZA28";
|
|
1304
1304
|
const contain = "ControlSlider-module__contain___pLyq7";
|
|
1305
1305
|
const cover = "ControlSlider-module__cover___KdDat";
|
|
1306
|
-
const styles$
|
|
1306
|
+
const styles$3 = {
|
|
1307
1307
|
wrapper,
|
|
1308
1308
|
sliderItem,
|
|
1309
1309
|
sliderImage,
|
|
@@ -1347,23 +1347,39 @@ const styles$2 = {
|
|
|
1347
1347
|
contain,
|
|
1348
1348
|
cover
|
|
1349
1349
|
};
|
|
1350
|
-
const link = "RichTextRenderer-module__link___BWeZ2";
|
|
1351
|
-
const styles$
|
|
1352
|
-
link
|
|
1350
|
+
const link$1 = "RichTextRenderer-module__link___BWeZ2";
|
|
1351
|
+
const styles$2 = {
|
|
1352
|
+
link: link$1
|
|
1353
1353
|
};
|
|
1354
1354
|
const RichTextRenderer = ({ content }) => {
|
|
1355
1355
|
const getChildren = (children) => {
|
|
1356
1356
|
return children.map((child, i) => {
|
|
1357
1357
|
if (child.type === "link") {
|
|
1358
|
-
return /* @__PURE__ */
|
|
1358
|
+
return /* @__PURE__ */ jsxDEV("a", { className: styles$2.link, href: child.value, target: child.target, children: getChildren(child.children) }, i, false, {
|
|
1359
|
+
fileName: "H:/mom/sdk/src/Components/helpers/RichTextRenderer/RichTextRenderer.tsx",
|
|
1360
|
+
lineNumber: 13,
|
|
1361
|
+
columnNumber: 16
|
|
1362
|
+
}, void 0);
|
|
1359
1363
|
}
|
|
1360
|
-
return /* @__PURE__ */
|
|
1364
|
+
return /* @__PURE__ */ jsxDEV("span", { style: getLeafCss(child), children: child.text }, i, false, {
|
|
1365
|
+
fileName: "H:/mom/sdk/src/Components/helpers/RichTextRenderer/RichTextRenderer.tsx",
|
|
1366
|
+
lineNumber: 15,
|
|
1367
|
+
columnNumber: 14
|
|
1368
|
+
}, void 0);
|
|
1361
1369
|
});
|
|
1362
1370
|
};
|
|
1363
|
-
return /* @__PURE__ */
|
|
1371
|
+
return /* @__PURE__ */ jsxDEV(Fragment, { children: content.map((block, i) => {
|
|
1364
1372
|
const children = block.children;
|
|
1365
|
-
return /* @__PURE__ */
|
|
1366
|
-
|
|
1373
|
+
return /* @__PURE__ */ jsxDEV("div", { children: getChildren(children) }, i, false, {
|
|
1374
|
+
fileName: "H:/mom/sdk/src/Components/helpers/RichTextRenderer/RichTextRenderer.tsx",
|
|
1375
|
+
lineNumber: 23,
|
|
1376
|
+
columnNumber: 11
|
|
1377
|
+
}, void 0);
|
|
1378
|
+
}) }, void 0, false, {
|
|
1379
|
+
fileName: "H:/mom/sdk/src/Components/helpers/RichTextRenderer/RichTextRenderer.tsx",
|
|
1380
|
+
lineNumber: 19,
|
|
1381
|
+
columnNumber: 5
|
|
1382
|
+
}, void 0);
|
|
1367
1383
|
};
|
|
1368
1384
|
function getLeafCss(leaf) {
|
|
1369
1385
|
return {
|
|
@@ -1383,7 +1399,7 @@ function scalingValue(value, isEditor = false) {
|
|
|
1383
1399
|
}
|
|
1384
1400
|
const svg = "SvgImage-module__svg___q3xE-";
|
|
1385
1401
|
const img = "SvgImage-module__img___VsTm-";
|
|
1386
|
-
const styles = {
|
|
1402
|
+
const styles$1 = {
|
|
1387
1403
|
svg,
|
|
1388
1404
|
img
|
|
1389
1405
|
};
|
|
@@ -1396,31 +1412,43 @@ const SvgImage = ({ url, fill = "#000000", hoverFill = "#CCCCCC", className = ""
|
|
|
1396
1412
|
}
|
|
1397
1413
|
}, []);
|
|
1398
1414
|
if (!url.endsWith(".svg") || !supportsMask) {
|
|
1399
|
-
return /* @__PURE__ */
|
|
1415
|
+
return /* @__PURE__ */ jsxDEV("img", { src: url, alt: "", className: cn(styles$1.img, className) }, void 0, false, {
|
|
1416
|
+
fileName: "H:/mom/sdk/src/Components/helpers/SvgImage/SvgImage.tsx",
|
|
1417
|
+
lineNumber: 23,
|
|
1418
|
+
columnNumber: 12
|
|
1419
|
+
}, void 0);
|
|
1400
1420
|
}
|
|
1401
|
-
return /* @__PURE__ */
|
|
1421
|
+
return /* @__PURE__ */ jsxDEV(
|
|
1402
1422
|
"span",
|
|
1403
1423
|
{
|
|
1404
1424
|
"data-supports-mask": supportsMask,
|
|
1405
|
-
className: cn(styles.svg, className),
|
|
1425
|
+
className: cn(styles$1.svg, className),
|
|
1406
1426
|
style: {
|
|
1407
1427
|
"--svg": `url(${url})`,
|
|
1408
1428
|
"--fill": fill,
|
|
1409
1429
|
"--hover-fill": hoverFill
|
|
1410
1430
|
}
|
|
1411
|
-
}
|
|
1431
|
+
},
|
|
1432
|
+
void 0,
|
|
1433
|
+
false,
|
|
1434
|
+
{
|
|
1435
|
+
fileName: "H:/mom/sdk/src/Components/helpers/SvgImage/SvgImage.tsx",
|
|
1436
|
+
lineNumber: 27,
|
|
1437
|
+
columnNumber: 5
|
|
1438
|
+
},
|
|
1439
|
+
void 0
|
|
1412
1440
|
);
|
|
1413
1441
|
};
|
|
1414
1442
|
const alignmentClassName = {
|
|
1415
|
-
"top-left": styles$
|
|
1416
|
-
"top-center": styles$
|
|
1417
|
-
"top-right": styles$
|
|
1418
|
-
"middle-left": styles$
|
|
1419
|
-
"middle-center": styles$
|
|
1420
|
-
"middle-right": styles$
|
|
1421
|
-
"bottom-left": styles$
|
|
1422
|
-
"bottom-center": styles$
|
|
1423
|
-
"bottom-right": styles$
|
|
1443
|
+
"top-left": styles$3.topLeftAlignment,
|
|
1444
|
+
"top-center": styles$3.topCenterAlignment,
|
|
1445
|
+
"top-right": styles$3.topRightAlignment,
|
|
1446
|
+
"middle-left": styles$3.middleLeftAlignment,
|
|
1447
|
+
"middle-center": styles$3.middleCenterAlignment,
|
|
1448
|
+
"middle-right": styles$3.middleRightAlignment,
|
|
1449
|
+
"bottom-left": styles$3.bottomLeftAlignment,
|
|
1450
|
+
"bottom-center": styles$3.bottomCenterAlignment,
|
|
1451
|
+
"bottom-right": styles$3.bottomRightAlignment
|
|
1424
1452
|
};
|
|
1425
1453
|
function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
1426
1454
|
const [sliderRef, setSliderRef] = useState(null);
|
|
@@ -1455,30 +1483,30 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
1455
1483
|
setKey((prev) => prev + 1);
|
|
1456
1484
|
prevSliderTypeRef.current = transition.type;
|
|
1457
1485
|
}, [transition.type]);
|
|
1458
|
-
return /* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ jsxDEV("div", { className: cn(styles$3.wrapper, { [styles$3.editor]: isEditor }), ref: setWrapperRef, children: /* @__PURE__ */ jsxDEV(
|
|
1459
1487
|
"div",
|
|
1460
1488
|
{
|
|
1461
|
-
className: styles$
|
|
1489
|
+
className: styles$3.sliderInner,
|
|
1462
1490
|
style: {
|
|
1463
1491
|
width: sliderDimensions ? sliderDimensions.width : "100%",
|
|
1464
1492
|
height: sliderDimensions ? sliderDimensions.height : "100%",
|
|
1465
1493
|
backgroundColor: transition.backgroundColor && transition.type === "fade in" ? transition.backgroundColor : "transparent"
|
|
1466
1494
|
},
|
|
1467
1495
|
children: [
|
|
1468
|
-
settings.caption.isActive && /* @__PURE__ */
|
|
1496
|
+
settings.caption.isActive && /* @__PURE__ */ jsxDEV(
|
|
1469
1497
|
"div",
|
|
1470
1498
|
{
|
|
1471
|
-
className: cn(styles$
|
|
1472
|
-
children: /* @__PURE__ */
|
|
1499
|
+
className: cn(styles$3.captionBlock),
|
|
1500
|
+
children: /* @__PURE__ */ jsxDEV(
|
|
1473
1501
|
"div",
|
|
1474
1502
|
{
|
|
1475
|
-
className: styles$
|
|
1476
|
-
children: content.map((item, index) => /* @__PURE__ */
|
|
1503
|
+
className: styles$3.captionTextWrapper,
|
|
1504
|
+
children: content.map((item, index) => /* @__PURE__ */ jsxDEV(
|
|
1477
1505
|
"div",
|
|
1478
1506
|
{
|
|
1479
|
-
className: cn(styles$
|
|
1480
|
-
[styles$
|
|
1481
|
-
[styles$
|
|
1507
|
+
className: cn(styles$3.captionText, alignmentClassName[caption.alignment], {
|
|
1508
|
+
[styles$3.withPointerEvents]: index === currentSlideIndex && isEditor,
|
|
1509
|
+
[styles$3.active]: index === currentSlideIndex
|
|
1482
1510
|
}),
|
|
1483
1511
|
style: {
|
|
1484
1512
|
fontFamily: fontSettings.fontFamily,
|
|
@@ -1496,28 +1524,63 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
1496
1524
|
color,
|
|
1497
1525
|
transitionDuration: transition.duration ? `${Math.round(parseInt(transition.duration) / 2)}ms` : "500ms"
|
|
1498
1526
|
},
|
|
1499
|
-
children: /* @__PURE__ */
|
|
1527
|
+
children: /* @__PURE__ */ jsxDEV(
|
|
1500
1528
|
"div",
|
|
1501
1529
|
{
|
|
1502
1530
|
"data-styles": "caption",
|
|
1503
|
-
className: styles$
|
|
1531
|
+
className: styles$3.captionTextInner,
|
|
1504
1532
|
style: {
|
|
1505
1533
|
"--link-hover-color": caption.hover,
|
|
1506
1534
|
position: "relative",
|
|
1507
1535
|
top: scalingValue(caption.offset.y, isEditor),
|
|
1508
1536
|
left: scalingValue(caption.offset.x, isEditor)
|
|
1509
1537
|
},
|
|
1510
|
-
children: /* @__PURE__ */
|
|
1511
|
-
|
|
1538
|
+
children: /* @__PURE__ */ jsxDEV(RichTextRenderer, { content: item.imageCaption }, void 0, false, {
|
|
1539
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1540
|
+
lineNumber: 115,
|
|
1541
|
+
columnNumber: 19
|
|
1542
|
+
}, this)
|
|
1543
|
+
},
|
|
1544
|
+
void 0,
|
|
1545
|
+
false,
|
|
1546
|
+
{
|
|
1547
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1548
|
+
lineNumber: 105,
|
|
1549
|
+
columnNumber: 17
|
|
1550
|
+
},
|
|
1551
|
+
this
|
|
1512
1552
|
)
|
|
1513
1553
|
},
|
|
1514
|
-
index
|
|
1554
|
+
index,
|
|
1555
|
+
false,
|
|
1556
|
+
{
|
|
1557
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1558
|
+
lineNumber: 82,
|
|
1559
|
+
columnNumber: 15
|
|
1560
|
+
},
|
|
1561
|
+
this
|
|
1515
1562
|
))
|
|
1516
|
-
}
|
|
1563
|
+
},
|
|
1564
|
+
void 0,
|
|
1565
|
+
false,
|
|
1566
|
+
{
|
|
1567
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1568
|
+
lineNumber: 78,
|
|
1569
|
+
columnNumber: 11
|
|
1570
|
+
},
|
|
1571
|
+
this
|
|
1517
1572
|
)
|
|
1518
|
-
}
|
|
1573
|
+
},
|
|
1574
|
+
void 0,
|
|
1575
|
+
false,
|
|
1576
|
+
{
|
|
1577
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1578
|
+
lineNumber: 75,
|
|
1579
|
+
columnNumber: 9
|
|
1580
|
+
},
|
|
1581
|
+
this
|
|
1519
1582
|
),
|
|
1520
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ jsxDEV(
|
|
1521
1584
|
Splide,
|
|
1522
1585
|
{
|
|
1523
1586
|
onMove: (e) => {
|
|
@@ -1540,138 +1603,241 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
1540
1603
|
type: transition.type === "fade in" ? "fade" : "loop",
|
|
1541
1604
|
rewind: true
|
|
1542
1605
|
},
|
|
1543
|
-
children: content.map((item, index) => /* @__PURE__ */
|
|
1606
|
+
children: content.map((item, index) => /* @__PURE__ */ jsxDEV(SplideSlide, { children: /* @__PURE__ */ jsxDEV(
|
|
1544
1607
|
"div",
|
|
1545
1608
|
{
|
|
1546
|
-
className: styles$
|
|
1547
|
-
children: /* @__PURE__ */
|
|
1609
|
+
className: styles$3.sliderItem,
|
|
1610
|
+
children: /* @__PURE__ */ jsxDEV(
|
|
1548
1611
|
"div",
|
|
1549
1612
|
{
|
|
1550
|
-
className: styles$
|
|
1551
|
-
children: /* @__PURE__ */
|
|
1613
|
+
className: styles$3.imgWrapper,
|
|
1614
|
+
children: /* @__PURE__ */ jsxDEV(
|
|
1552
1615
|
"img",
|
|
1553
1616
|
{
|
|
1554
|
-
className: cn(styles$
|
|
1555
|
-
[styles$
|
|
1556
|
-
[styles$
|
|
1617
|
+
className: cn(styles$3.sliderImage, {
|
|
1618
|
+
[styles$3.contain]: item.image.objectFit === "contain",
|
|
1619
|
+
[styles$3.cover]: item.image.objectFit === "cover"
|
|
1557
1620
|
}),
|
|
1558
1621
|
src: item.image.url,
|
|
1559
1622
|
alt: item.image.name ?? ""
|
|
1560
|
-
}
|
|
1623
|
+
},
|
|
1624
|
+
void 0,
|
|
1625
|
+
false,
|
|
1626
|
+
{
|
|
1627
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1628
|
+
lineNumber: 153,
|
|
1629
|
+
columnNumber: 17
|
|
1630
|
+
},
|
|
1631
|
+
this
|
|
1561
1632
|
)
|
|
1562
|
-
}
|
|
1633
|
+
},
|
|
1634
|
+
void 0,
|
|
1635
|
+
false,
|
|
1636
|
+
{
|
|
1637
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1638
|
+
lineNumber: 150,
|
|
1639
|
+
columnNumber: 15
|
|
1640
|
+
},
|
|
1641
|
+
this
|
|
1563
1642
|
)
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1643
|
+
},
|
|
1644
|
+
void 0,
|
|
1645
|
+
false,
|
|
1646
|
+
{
|
|
1647
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1648
|
+
lineNumber: 147,
|
|
1649
|
+
columnNumber: 13
|
|
1650
|
+
},
|
|
1651
|
+
this
|
|
1652
|
+
) }, index, false, {
|
|
1653
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1654
|
+
lineNumber: 146,
|
|
1655
|
+
columnNumber: 11
|
|
1656
|
+
}, this))
|
|
1657
|
+
},
|
|
1658
|
+
key,
|
|
1659
|
+
false,
|
|
1660
|
+
{
|
|
1661
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1662
|
+
lineNumber: 122,
|
|
1663
|
+
columnNumber: 7
|
|
1566
1664
|
},
|
|
1567
|
-
|
|
1665
|
+
this
|
|
1568
1666
|
),
|
|
1569
|
-
controls.isActive && /* @__PURE__ */
|
|
1570
|
-
/* @__PURE__ */
|
|
1667
|
+
controls.isActive && /* @__PURE__ */ jsxDEV(Fragment, { children: [
|
|
1668
|
+
/* @__PURE__ */ jsxDEV(
|
|
1571
1669
|
"div",
|
|
1572
1670
|
{
|
|
1573
|
-
className: cn(styles$
|
|
1574
|
-
[styles$
|
|
1671
|
+
className: cn(styles$3.arrow, {
|
|
1672
|
+
[styles$3.arrowVertical]: direction === "vert"
|
|
1575
1673
|
}),
|
|
1576
1674
|
style: {
|
|
1577
1675
|
color: controls.color,
|
|
1578
1676
|
["--arrow-hover-color"]: controls.hover
|
|
1579
1677
|
},
|
|
1580
|
-
children: /* @__PURE__ */
|
|
1678
|
+
children: /* @__PURE__ */ jsxDEV(
|
|
1581
1679
|
"button",
|
|
1582
1680
|
{
|
|
1583
1681
|
onClick: () => {
|
|
1584
1682
|
handleArrowClick("-1");
|
|
1585
1683
|
},
|
|
1586
|
-
className: styles$
|
|
1684
|
+
className: styles$3.arrowInner,
|
|
1587
1685
|
style: {
|
|
1588
1686
|
transform: `translate(${scalingValue(controlsOffsetX, isEditor)}, ${scalingValue(controlsOffsetY * (direction === "horiz" ? 1 : -1), isEditor)}) scale(${settings.controls.scale / 100}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
|
|
1589
1687
|
},
|
|
1590
1688
|
children: [
|
|
1591
|
-
controls.arrowsImgUrl && /* @__PURE__ */
|
|
1689
|
+
controls.arrowsImgUrl && /* @__PURE__ */ jsxDEV(
|
|
1592
1690
|
SvgImage,
|
|
1593
1691
|
{
|
|
1594
1692
|
url: controls.arrowsImgUrl,
|
|
1595
1693
|
fill: controls.color,
|
|
1596
1694
|
hoverFill: controls.hover,
|
|
1597
|
-
className: cn(styles$
|
|
1598
|
-
}
|
|
1695
|
+
className: cn(styles$3.arrowImg, styles$3.mirror)
|
|
1696
|
+
},
|
|
1697
|
+
void 0,
|
|
1698
|
+
false,
|
|
1699
|
+
{
|
|
1700
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1701
|
+
lineNumber: 186,
|
|
1702
|
+
columnNumber: 17
|
|
1703
|
+
},
|
|
1704
|
+
this
|
|
1599
1705
|
),
|
|
1600
|
-
!controls.arrowsImgUrl && /* @__PURE__ */
|
|
1706
|
+
!controls.arrowsImgUrl && /* @__PURE__ */ jsxDEV(ArrowIcon, { color: controls.color, className: cn(styles$3.arrowIcon, styles$3.arrowImg, styles$3.mirror) }, void 0, false, {
|
|
1707
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1708
|
+
lineNumber: 194,
|
|
1709
|
+
columnNumber: 17
|
|
1710
|
+
}, this)
|
|
1601
1711
|
]
|
|
1602
|
-
}
|
|
1712
|
+
},
|
|
1713
|
+
void 0,
|
|
1714
|
+
true,
|
|
1715
|
+
{
|
|
1716
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1717
|
+
lineNumber: 176,
|
|
1718
|
+
columnNumber: 13
|
|
1719
|
+
},
|
|
1720
|
+
this
|
|
1603
1721
|
)
|
|
1604
|
-
}
|
|
1722
|
+
},
|
|
1723
|
+
void 0,
|
|
1724
|
+
false,
|
|
1725
|
+
{
|
|
1726
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1727
|
+
lineNumber: 167,
|
|
1728
|
+
columnNumber: 11
|
|
1729
|
+
},
|
|
1730
|
+
this
|
|
1605
1731
|
),
|
|
1606
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsxDEV(
|
|
1607
1733
|
"div",
|
|
1608
1734
|
{
|
|
1609
|
-
className: cn(styles$
|
|
1610
|
-
[styles$
|
|
1735
|
+
className: cn(styles$3.arrow, styles$3.nextArrow, {
|
|
1736
|
+
[styles$3.arrowVertical]: direction === "vert"
|
|
1611
1737
|
}),
|
|
1612
1738
|
style: {
|
|
1613
1739
|
color: controls.color,
|
|
1614
1740
|
["--arrow-hover-color"]: controls.hover
|
|
1615
1741
|
},
|
|
1616
|
-
children: /* @__PURE__ */
|
|
1742
|
+
children: /* @__PURE__ */ jsxDEV(
|
|
1617
1743
|
"button",
|
|
1618
1744
|
{
|
|
1619
|
-
className: styles$
|
|
1745
|
+
className: styles$3.arrowInner,
|
|
1620
1746
|
onClick: () => handleArrowClick("+1"),
|
|
1621
1747
|
style: {
|
|
1622
1748
|
transform: `translate(${scalingValue(controlsOffsetX * (direction === "horiz" ? -1 : 1), isEditor)}, ${scalingValue(controlsOffsetY, isEditor)}) scale(${settings.controls.scale / 100}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
|
|
1623
1749
|
},
|
|
1624
1750
|
children: [
|
|
1625
|
-
controls.arrowsImgUrl && /* @__PURE__ */
|
|
1751
|
+
controls.arrowsImgUrl && /* @__PURE__ */ jsxDEV(
|
|
1626
1752
|
SvgImage,
|
|
1627
1753
|
{
|
|
1628
1754
|
url: controls.arrowsImgUrl,
|
|
1629
1755
|
fill: controls.color,
|
|
1630
1756
|
hoverFill: controls.hover,
|
|
1631
|
-
className: styles$
|
|
1632
|
-
}
|
|
1757
|
+
className: styles$3.arrowImg
|
|
1758
|
+
},
|
|
1759
|
+
void 0,
|
|
1760
|
+
false,
|
|
1761
|
+
{
|
|
1762
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1763
|
+
lineNumber: 215,
|
|
1764
|
+
columnNumber: 17
|
|
1765
|
+
},
|
|
1766
|
+
this
|
|
1633
1767
|
),
|
|
1634
|
-
!controls.arrowsImgUrl && /* @__PURE__ */
|
|
1768
|
+
!controls.arrowsImgUrl && /* @__PURE__ */ jsxDEV(ArrowIcon, { color: controls.color, className: cn(styles$3.arrowIcon, styles$3.arrowImg) }, void 0, false, {
|
|
1769
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1770
|
+
lineNumber: 223,
|
|
1771
|
+
columnNumber: 17
|
|
1772
|
+
}, this)
|
|
1635
1773
|
]
|
|
1636
|
-
}
|
|
1774
|
+
},
|
|
1775
|
+
void 0,
|
|
1776
|
+
true,
|
|
1777
|
+
{
|
|
1778
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1779
|
+
lineNumber: 207,
|
|
1780
|
+
columnNumber: 13
|
|
1781
|
+
},
|
|
1782
|
+
this
|
|
1637
1783
|
)
|
|
1638
|
-
}
|
|
1784
|
+
},
|
|
1785
|
+
void 0,
|
|
1786
|
+
false,
|
|
1787
|
+
{
|
|
1788
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1789
|
+
lineNumber: 198,
|
|
1790
|
+
columnNumber: 11
|
|
1791
|
+
},
|
|
1792
|
+
this
|
|
1639
1793
|
)
|
|
1640
|
-
] }
|
|
1641
|
-
|
|
1794
|
+
] }, void 0, true, {
|
|
1795
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1796
|
+
lineNumber: 166,
|
|
1797
|
+
columnNumber: 9
|
|
1798
|
+
}, this),
|
|
1799
|
+
triggers.triggersList.click && /* @__PURE__ */ jsxDEV(
|
|
1642
1800
|
"div",
|
|
1643
1801
|
{
|
|
1644
|
-
className: styles$
|
|
1802
|
+
className: styles$3.clickOverlay,
|
|
1645
1803
|
onClick: () => {
|
|
1646
1804
|
if (sliderRef) {
|
|
1647
1805
|
sliderRef.go("+1");
|
|
1648
1806
|
}
|
|
1649
1807
|
}
|
|
1650
|
-
}
|
|
1808
|
+
},
|
|
1809
|
+
void 0,
|
|
1810
|
+
false,
|
|
1811
|
+
{
|
|
1812
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1813
|
+
lineNumber: 230,
|
|
1814
|
+
columnNumber: 9
|
|
1815
|
+
},
|
|
1816
|
+
this
|
|
1651
1817
|
),
|
|
1652
|
-
pagination2.isActive && /* @__PURE__ */
|
|
1818
|
+
pagination2.isActive && /* @__PURE__ */ jsxDEV(
|
|
1653
1819
|
"div",
|
|
1654
1820
|
{
|
|
1655
|
-
className: cn(styles$
|
|
1656
|
-
[styles$
|
|
1657
|
-
[styles$
|
|
1658
|
-
[styles$
|
|
1659
|
-
[styles$
|
|
1660
|
-
[styles$
|
|
1661
|
-
[styles$
|
|
1662
|
-
[styles$
|
|
1663
|
-
[styles$
|
|
1664
|
-
[styles$
|
|
1821
|
+
className: cn(styles$3.pagination, {
|
|
1822
|
+
[styles$3.paginationInsideBottom]: pagination2.position === "inside-1" && direction === "horiz",
|
|
1823
|
+
[styles$3.paginationInsideTop]: pagination2.position === "inside-2" && direction === "horiz",
|
|
1824
|
+
[styles$3.paginationOutsideBottom]: pagination2.position === "outside-1" && direction === "horiz",
|
|
1825
|
+
[styles$3.paginationOutsideTop]: pagination2.position === "outside-2" && direction === "horiz",
|
|
1826
|
+
[styles$3.paginationInsideLeft]: pagination2.position === "inside-1" && direction === "vert",
|
|
1827
|
+
[styles$3.paginationInsideRight]: pagination2.position === "inside-2" && direction === "vert",
|
|
1828
|
+
[styles$3.paginationOutsideLeft]: pagination2.position === "outside-1" && direction === "vert",
|
|
1829
|
+
[styles$3.paginationOutsideRight]: pagination2.position === "outside-2" && direction === "vert",
|
|
1830
|
+
[styles$3.paginationVertical]: direction === "vert"
|
|
1665
1831
|
}),
|
|
1666
|
-
children: /* @__PURE__ */
|
|
1832
|
+
children: /* @__PURE__ */ jsxDEV(
|
|
1667
1833
|
"div",
|
|
1668
1834
|
{
|
|
1669
|
-
className: styles$
|
|
1835
|
+
className: styles$3.paginationInner,
|
|
1670
1836
|
style: {
|
|
1671
1837
|
backgroundColor: pagination2.colors[2],
|
|
1672
1838
|
transform: `scale(${pagination2.scale / 100}) translate(${scalingValue(pagination2.offset.x, isEditor)}, ${scalingValue(pagination2.offset.y, isEditor)}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
|
|
1673
1839
|
},
|
|
1674
|
-
children: content.map((_, index) => /* @__PURE__ */
|
|
1840
|
+
children: content.map((_, index) => /* @__PURE__ */ jsxDEV(
|
|
1675
1841
|
"button",
|
|
1676
1842
|
{
|
|
1677
1843
|
onClick: () => {
|
|
@@ -1679,32 +1845,87 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
1679
1845
|
sliderRef.go(index);
|
|
1680
1846
|
}
|
|
1681
1847
|
},
|
|
1682
|
-
className: cn(styles$
|
|
1683
|
-
children: /* @__PURE__ */
|
|
1848
|
+
className: cn(styles$3.paginationItem),
|
|
1849
|
+
children: /* @__PURE__ */ jsxDEV(
|
|
1684
1850
|
"div",
|
|
1685
1851
|
{
|
|
1686
|
-
className: cn(styles$
|
|
1687
|
-
[styles$
|
|
1852
|
+
className: cn(styles$3.dot, {
|
|
1853
|
+
[styles$3.activeDot]: index === currentSlideIndex
|
|
1688
1854
|
}),
|
|
1689
1855
|
style: {
|
|
1690
1856
|
backgroundColor: index === currentSlideIndex ? pagination2.colors[0] : pagination2.colors[1],
|
|
1691
1857
|
["--pagination-hover-color"]: pagination2.hover
|
|
1692
1858
|
}
|
|
1693
|
-
}
|
|
1859
|
+
},
|
|
1860
|
+
void 0,
|
|
1861
|
+
false,
|
|
1862
|
+
{
|
|
1863
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1864
|
+
lineNumber: 270,
|
|
1865
|
+
columnNumber: 17
|
|
1866
|
+
},
|
|
1867
|
+
this
|
|
1694
1868
|
)
|
|
1695
1869
|
},
|
|
1696
|
-
index
|
|
1870
|
+
index,
|
|
1871
|
+
false,
|
|
1872
|
+
{
|
|
1873
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1874
|
+
lineNumber: 261,
|
|
1875
|
+
columnNumber: 15
|
|
1876
|
+
},
|
|
1877
|
+
this
|
|
1697
1878
|
))
|
|
1698
|
-
}
|
|
1879
|
+
},
|
|
1880
|
+
void 0,
|
|
1881
|
+
false,
|
|
1882
|
+
{
|
|
1883
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1884
|
+
lineNumber: 253,
|
|
1885
|
+
columnNumber: 11
|
|
1886
|
+
},
|
|
1887
|
+
this
|
|
1699
1888
|
)
|
|
1700
|
-
}
|
|
1889
|
+
},
|
|
1890
|
+
void 0,
|
|
1891
|
+
false,
|
|
1892
|
+
{
|
|
1893
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1894
|
+
lineNumber: 240,
|
|
1895
|
+
columnNumber: 9
|
|
1896
|
+
},
|
|
1897
|
+
this
|
|
1701
1898
|
)
|
|
1702
1899
|
]
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1900
|
+
},
|
|
1901
|
+
void 0,
|
|
1902
|
+
true,
|
|
1903
|
+
{
|
|
1904
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1905
|
+
lineNumber: 66,
|
|
1906
|
+
columnNumber: 7
|
|
1907
|
+
},
|
|
1908
|
+
this
|
|
1909
|
+
) }, void 0, false, {
|
|
1910
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1911
|
+
lineNumber: 65,
|
|
1912
|
+
columnNumber: 5
|
|
1913
|
+
}, this);
|
|
1705
1914
|
}
|
|
1706
1915
|
function ArrowIcon({ color, className }) {
|
|
1707
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ jsxDEV("svg", { viewBox: "0 0 10 18", className, children: /* @__PURE__ */ jsxDEV("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ jsxDEV("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: color, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }, void 0, false, {
|
|
1917
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1918
|
+
lineNumber: 293,
|
|
1919
|
+
columnNumber: 11
|
|
1920
|
+
}, this) }, void 0, false, {
|
|
1921
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1922
|
+
lineNumber: 292,
|
|
1923
|
+
columnNumber: 7
|
|
1924
|
+
}, this) }, void 0, false, {
|
|
1925
|
+
fileName: "H:/mom/sdk/src/Components/ControlSlider/ControlSlider.tsx",
|
|
1926
|
+
lineNumber: 291,
|
|
1927
|
+
columnNumber: 5
|
|
1928
|
+
}, this);
|
|
1708
1929
|
}
|
|
1709
1930
|
const ControlSliderComponent = {
|
|
1710
1931
|
element: ControlSlider,
|
|
@@ -2255,8 +2476,504 @@ const ControlSliderComponent = {
|
|
|
2255
2476
|
required: ["settings", "content", "styles"]
|
|
2256
2477
|
}
|
|
2257
2478
|
};
|
|
2479
|
+
const imageRevealSlider = "ImageRevealSlider-module__imageRevealSlider___UE5Ob";
|
|
2480
|
+
const image = "ImageRevealSlider-module__image___Qjt-e";
|
|
2481
|
+
const link = "ImageRevealSlider-module__link___N-iLG";
|
|
2482
|
+
const styles = {
|
|
2483
|
+
imageRevealSlider,
|
|
2484
|
+
image,
|
|
2485
|
+
link
|
|
2486
|
+
};
|
|
2487
|
+
function isMouseOverImage(mouseX, mouseY, placedImages) {
|
|
2488
|
+
for (const img2 of placedImages) {
|
|
2489
|
+
const imgEl = new Image();
|
|
2490
|
+
imgEl.src = img2.url;
|
|
2491
|
+
const imgWidth = img2.width ? Number.parseFloat(img2.width) : imgEl.naturalWidth;
|
|
2492
|
+
const imgHeight = imgEl.naturalHeight / imgEl.naturalWidth * imgWidth;
|
|
2493
|
+
const halfW = imgWidth / 2;
|
|
2494
|
+
const halfH = imgHeight / 2;
|
|
2495
|
+
if (mouseX >= img2.x - halfW && mouseX <= img2.x + halfW && mouseY >= img2.y - halfH && mouseY <= img2.y + halfH) {
|
|
2496
|
+
return true;
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
return false;
|
|
2500
|
+
}
|
|
2501
|
+
function getImageSize(url) {
|
|
2502
|
+
return new Promise((resolve) => {
|
|
2503
|
+
const img2 = new Image();
|
|
2504
|
+
img2.src = url;
|
|
2505
|
+
img2.onload = () => {
|
|
2506
|
+
resolve({ width: img2.naturalWidth, height: img2.naturalHeight });
|
|
2507
|
+
};
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
async function calculateImageWidthHeight(imgUrl, sizeType, customWidth, randomRange) {
|
|
2511
|
+
let width;
|
|
2512
|
+
let height;
|
|
2513
|
+
if (sizeType === "custom") {
|
|
2514
|
+
width = customWidth;
|
|
2515
|
+
const size = await getImageSize(imgUrl);
|
|
2516
|
+
height = size.height / size.width * width;
|
|
2517
|
+
} else if (sizeType === "random") {
|
|
2518
|
+
width = Math.random() * (randomRange.max - randomRange.min) + randomRange.min;
|
|
2519
|
+
const size = await getImageSize(imgUrl);
|
|
2520
|
+
height = size.height / size.width * width;
|
|
2521
|
+
} else {
|
|
2522
|
+
const size = await getImageSize(imgUrl);
|
|
2523
|
+
width = size.width;
|
|
2524
|
+
height = size.height;
|
|
2525
|
+
}
|
|
2526
|
+
return { width, height, finalWidth: `${width}px` };
|
|
2527
|
+
}
|
|
2528
|
+
function ImageRevealSlider({ settings, content, isEditor }) {
|
|
2529
|
+
const divRef = useRef(null);
|
|
2530
|
+
const [placedImages, setPlacedImages] = useState([]);
|
|
2531
|
+
const [counter, setCounter] = useState(0);
|
|
2532
|
+
const imageIdCounter = useRef(0);
|
|
2533
|
+
const defaultImageCount = 1;
|
|
2534
|
+
const { sizeType, imageWidth: customWidth, randomRangeImageWidth: randomRange } = settings.imageSize;
|
|
2535
|
+
const { revealPosition, visible, target } = settings.position;
|
|
2536
|
+
const { cursorType, defaultCursor, hoverCursor } = settings.cursor;
|
|
2537
|
+
const createNewImage = async (imgData, containerWidth, containerHeight, position = {}) => {
|
|
2538
|
+
const { width, height, finalWidth } = await calculateImageWidthHeight(
|
|
2539
|
+
imgData.image.url,
|
|
2540
|
+
sizeType,
|
|
2541
|
+
customWidth,
|
|
2542
|
+
randomRange
|
|
2543
|
+
);
|
|
2544
|
+
let x = position.x ?? Math.random() * containerWidth;
|
|
2545
|
+
let y = position.y ?? Math.random() * containerHeight;
|
|
2546
|
+
const adjustedX = Math.min(Math.max(x, width / 2), containerWidth - width / 2);
|
|
2547
|
+
const adjustedY = Math.min(Math.max(y, height / 2), containerHeight - height / 2);
|
|
2548
|
+
return {
|
|
2549
|
+
id: imageIdCounter.current++,
|
|
2550
|
+
url: imgData.image.url,
|
|
2551
|
+
link: imgData.link,
|
|
2552
|
+
name: imgData.image.name,
|
|
2553
|
+
x: adjustedX,
|
|
2554
|
+
y: adjustedY,
|
|
2555
|
+
width: finalWidth
|
|
2556
|
+
};
|
|
2557
|
+
};
|
|
2558
|
+
const defaultContentUrls = useMemo(() => {
|
|
2559
|
+
const defaultContentLength = Math.min(content.length, defaultImageCount);
|
|
2560
|
+
return content.filter((_, i) => i < defaultContentLength).map((c) => c.image.url).join("-");
|
|
2561
|
+
}, [content]);
|
|
2562
|
+
useEffect(() => {
|
|
2563
|
+
if (!divRef.current || content.length === 0) return;
|
|
2564
|
+
const rect = divRef.current.getBoundingClientRect();
|
|
2565
|
+
const containerWidth = rect.width;
|
|
2566
|
+
const containerHeight = rect.height;
|
|
2567
|
+
const defaultPlaced = [];
|
|
2568
|
+
const placeImages = async () => {
|
|
2569
|
+
for (let i = 0; i < defaultImageCount && i < content.length; i++) {
|
|
2570
|
+
const imgData = content[i];
|
|
2571
|
+
const newImg = await createNewImage(imgData, containerWidth, containerHeight);
|
|
2572
|
+
defaultPlaced.push(newImg);
|
|
2573
|
+
}
|
|
2574
|
+
setPlacedImages(defaultPlaced);
|
|
2575
|
+
setCounter(defaultImageCount % content.length);
|
|
2576
|
+
};
|
|
2577
|
+
placeImages();
|
|
2578
|
+
}, [defaultContentUrls, sizeType, customWidth, randomRange]);
|
|
2579
|
+
useEffect(() => {
|
|
2580
|
+
if (visible === "lastOne") {
|
|
2581
|
+
setPlacedImages((prev) => prev.length > 0 ? [prev[prev.length - 1]] : []);
|
|
2582
|
+
}
|
|
2583
|
+
}, [visible]);
|
|
2584
|
+
const handleClick = async (e) => {
|
|
2585
|
+
if (!divRef.current) return;
|
|
2586
|
+
const rect = divRef.current.getBoundingClientRect();
|
|
2587
|
+
const clickX = e.clientX - rect.left;
|
|
2588
|
+
const clickY = e.clientY - rect.top;
|
|
2589
|
+
if (target === "image" && !isMouseOverImage(clickX, clickY, placedImages)) return;
|
|
2590
|
+
let x = 0, y = 0;
|
|
2591
|
+
if (revealPosition === "onClick") {
|
|
2592
|
+
x = clickX;
|
|
2593
|
+
y = clickY;
|
|
2594
|
+
} else if (revealPosition === "same") {
|
|
2595
|
+
x = rect.width / 2;
|
|
2596
|
+
y = rect.height / 2;
|
|
2597
|
+
} else {
|
|
2598
|
+
x = Math.random() * rect.width;
|
|
2599
|
+
y = Math.random() * rect.height;
|
|
2600
|
+
}
|
|
2601
|
+
const imgData = content[counter];
|
|
2602
|
+
const newImage = await createNewImage(imgData, rect.width, rect.height, { x, y });
|
|
2603
|
+
setPlacedImages((prev) => visible === "all" ? [...prev, newImage] : [newImage]);
|
|
2604
|
+
setCounter((prev) => prev >= content.length - 1 ? 0 : prev + 1);
|
|
2605
|
+
};
|
|
2606
|
+
const handleMouseMove = (e) => {
|
|
2607
|
+
if (!divRef.current) return;
|
|
2608
|
+
if (cursorType === "system") {
|
|
2609
|
+
divRef.current.style.cursor = "";
|
|
2610
|
+
return;
|
|
2611
|
+
}
|
|
2612
|
+
const rect = divRef.current.getBoundingClientRect();
|
|
2613
|
+
const mouseX = e.clientX - rect.left;
|
|
2614
|
+
const mouseY = e.clientY - rect.top;
|
|
2615
|
+
const isHover = target === "area" || isMouseOverImage(mouseX, mouseY, placedImages);
|
|
2616
|
+
divRef.current.style.cursor = isHover ? `url(${hoverCursor}), auto` : `url(${defaultCursor}), auto`;
|
|
2617
|
+
};
|
|
2618
|
+
return /* @__PURE__ */ jsxDEV(
|
|
2619
|
+
"div",
|
|
2620
|
+
{
|
|
2621
|
+
ref: divRef,
|
|
2622
|
+
onClick: handleClick,
|
|
2623
|
+
onMouseEnter: handleMouseMove,
|
|
2624
|
+
onMouseMove: handleMouseMove,
|
|
2625
|
+
className: styles.imageRevealSlider,
|
|
2626
|
+
children: placedImages.map((img2) => /* @__PURE__ */ jsxDEV(
|
|
2627
|
+
"div",
|
|
2628
|
+
{
|
|
2629
|
+
className: styles.wrapper,
|
|
2630
|
+
style: {
|
|
2631
|
+
top: `${img2.y}px`,
|
|
2632
|
+
left: `${img2.x}px`,
|
|
2633
|
+
position: "absolute",
|
|
2634
|
+
transform: "translate(-50%, -50%)",
|
|
2635
|
+
width: img2.width ?? "auto",
|
|
2636
|
+
height: "auto"
|
|
2637
|
+
},
|
|
2638
|
+
children: target === "area" && img2.link ? /* @__PURE__ */ jsxDEV("a", { href: img2.link, target: "_blank", className: styles.link, children: /* @__PURE__ */ jsxDEV(
|
|
2639
|
+
"img",
|
|
2640
|
+
{
|
|
2641
|
+
src: img2.url,
|
|
2642
|
+
alt: img2.name,
|
|
2643
|
+
className: styles.image
|
|
2644
|
+
},
|
|
2645
|
+
img2.id,
|
|
2646
|
+
false,
|
|
2647
|
+
{
|
|
2648
|
+
fileName: "H:/mom/sdk/src/Components/ImageRevealSlider/ImageRevealSlider.tsx",
|
|
2649
|
+
lineNumber: 257,
|
|
2650
|
+
columnNumber: 15
|
|
2651
|
+
},
|
|
2652
|
+
this
|
|
2653
|
+
) }, void 0, false, {
|
|
2654
|
+
fileName: "H:/mom/sdk/src/Components/ImageRevealSlider/ImageRevealSlider.tsx",
|
|
2655
|
+
lineNumber: 256,
|
|
2656
|
+
columnNumber: 13
|
|
2657
|
+
}, this) : /* @__PURE__ */ jsxDEV(
|
|
2658
|
+
"img",
|
|
2659
|
+
{
|
|
2660
|
+
src: img2.url,
|
|
2661
|
+
alt: img2.name,
|
|
2662
|
+
className: styles.image
|
|
2663
|
+
},
|
|
2664
|
+
img2.id,
|
|
2665
|
+
false,
|
|
2666
|
+
{
|
|
2667
|
+
fileName: "H:/mom/sdk/src/Components/ImageRevealSlider/ImageRevealSlider.tsx",
|
|
2668
|
+
lineNumber: 265,
|
|
2669
|
+
columnNumber: 13
|
|
2670
|
+
},
|
|
2671
|
+
this
|
|
2672
|
+
)
|
|
2673
|
+
},
|
|
2674
|
+
void 0,
|
|
2675
|
+
false,
|
|
2676
|
+
{
|
|
2677
|
+
fileName: "H:/mom/sdk/src/Components/ImageRevealSlider/ImageRevealSlider.tsx",
|
|
2678
|
+
lineNumber: 245,
|
|
2679
|
+
columnNumber: 9
|
|
2680
|
+
},
|
|
2681
|
+
this
|
|
2682
|
+
))
|
|
2683
|
+
},
|
|
2684
|
+
void 0,
|
|
2685
|
+
false,
|
|
2686
|
+
{
|
|
2687
|
+
fileName: "H:/mom/sdk/src/Components/ImageRevealSlider/ImageRevealSlider.tsx",
|
|
2688
|
+
lineNumber: 237,
|
|
2689
|
+
columnNumber: 5
|
|
2690
|
+
},
|
|
2691
|
+
this
|
|
2692
|
+
);
|
|
2693
|
+
}
|
|
2694
|
+
const ControlImageRevealSliderComponent = {
|
|
2695
|
+
element: ImageRevealSlider,
|
|
2696
|
+
id: "control-image-reveal",
|
|
2697
|
+
name: "Image reveal",
|
|
2698
|
+
preview: {
|
|
2699
|
+
type: "video",
|
|
2700
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K723EY5AH8SKQFK4R31D8FPV.mp4"
|
|
2701
|
+
},
|
|
2702
|
+
defaultSize: {
|
|
2703
|
+
width: 700,
|
|
2704
|
+
height: 400
|
|
2705
|
+
},
|
|
2706
|
+
schema: {
|
|
2707
|
+
type: "object",
|
|
2708
|
+
properties: {
|
|
2709
|
+
settings: {
|
|
2710
|
+
layoutBased: true,
|
|
2711
|
+
type: "object",
|
|
2712
|
+
properties: {
|
|
2713
|
+
imageSize: {
|
|
2714
|
+
name: "IMG SIZE",
|
|
2715
|
+
icon: "size",
|
|
2716
|
+
tooltip: "IMG SIZE",
|
|
2717
|
+
type: "object",
|
|
2718
|
+
properties: {
|
|
2719
|
+
sizeType: {
|
|
2720
|
+
name: "sizeType",
|
|
2721
|
+
type: "string",
|
|
2722
|
+
display: {
|
|
2723
|
+
type: "ratio-group"
|
|
2724
|
+
},
|
|
2725
|
+
enum: ["as Is", "custom", "random"]
|
|
2726
|
+
},
|
|
2727
|
+
imageWidth: {
|
|
2728
|
+
type: "number",
|
|
2729
|
+
label: "W",
|
|
2730
|
+
display: {
|
|
2731
|
+
type: "numeric-input",
|
|
2732
|
+
visible: false
|
|
2733
|
+
}
|
|
2734
|
+
},
|
|
2735
|
+
randomRangeImageWidth: {
|
|
2736
|
+
type: "object",
|
|
2737
|
+
display: {
|
|
2738
|
+
type: "random-range-controls",
|
|
2739
|
+
visible: false
|
|
2740
|
+
},
|
|
2741
|
+
properties: {
|
|
2742
|
+
min: {
|
|
2743
|
+
type: "number"
|
|
2744
|
+
},
|
|
2745
|
+
max: {
|
|
2746
|
+
type: "number"
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
},
|
|
2752
|
+
cursor: {
|
|
2753
|
+
name: "cursor",
|
|
2754
|
+
icon: "cursor",
|
|
2755
|
+
tooltip: "cursor",
|
|
2756
|
+
type: "object",
|
|
2757
|
+
properties: {
|
|
2758
|
+
cursorType: {
|
|
2759
|
+
name: "cursorType",
|
|
2760
|
+
type: "string",
|
|
2761
|
+
display: {
|
|
2762
|
+
type: "ratio-group"
|
|
2763
|
+
},
|
|
2764
|
+
enum: ["system", "custom"]
|
|
2765
|
+
},
|
|
2766
|
+
defaultCursor: {
|
|
2767
|
+
type: ["string", "null"],
|
|
2768
|
+
display: {
|
|
2769
|
+
type: "settings-image-input",
|
|
2770
|
+
title: "Default",
|
|
2771
|
+
visible: false
|
|
2772
|
+
}
|
|
2773
|
+
},
|
|
2774
|
+
hoverCursor: {
|
|
2775
|
+
type: ["string", "null"],
|
|
2776
|
+
display: {
|
|
2777
|
+
type: "settings-image-input",
|
|
2778
|
+
title: "Hover",
|
|
2779
|
+
visible: false
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2783
|
+
},
|
|
2784
|
+
position: {
|
|
2785
|
+
name: "position",
|
|
2786
|
+
icon: "transition",
|
|
2787
|
+
tooltip: "Position",
|
|
2788
|
+
type: "object",
|
|
2789
|
+
properties: {
|
|
2790
|
+
revealPosition: {
|
|
2791
|
+
type: "string",
|
|
2792
|
+
display: {
|
|
2793
|
+
type: "ratio-group"
|
|
2794
|
+
},
|
|
2795
|
+
enum: ["random", "same", "onClick"]
|
|
2796
|
+
},
|
|
2797
|
+
visible: {
|
|
2798
|
+
type: "string",
|
|
2799
|
+
display: {
|
|
2800
|
+
type: "ratio-group"
|
|
2801
|
+
},
|
|
2802
|
+
enum: ["all", "lastOne"]
|
|
2803
|
+
},
|
|
2804
|
+
target: {
|
|
2805
|
+
type: "string",
|
|
2806
|
+
display: {
|
|
2807
|
+
type: "ratio-group"
|
|
2808
|
+
},
|
|
2809
|
+
enum: ["area", "image"]
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
},
|
|
2814
|
+
default: {
|
|
2815
|
+
imageSize: {
|
|
2816
|
+
sizeType: "custom",
|
|
2817
|
+
imageWidth: 500,
|
|
2818
|
+
randomRangeImageWidth: {
|
|
2819
|
+
min: 100,
|
|
2820
|
+
max: 1e3
|
|
2821
|
+
}
|
|
2822
|
+
},
|
|
2823
|
+
cursor: {
|
|
2824
|
+
cursorType: "system",
|
|
2825
|
+
defaultCursor: null,
|
|
2826
|
+
hoverCursor: null
|
|
2827
|
+
},
|
|
2828
|
+
position: {
|
|
2829
|
+
revealPosition: "random",
|
|
2830
|
+
visible: "all",
|
|
2831
|
+
target: "area"
|
|
2832
|
+
}
|
|
2833
|
+
},
|
|
2834
|
+
displayRules: [
|
|
2835
|
+
{
|
|
2836
|
+
if: {
|
|
2837
|
+
name: "imageSize.sizeType",
|
|
2838
|
+
value: "custom"
|
|
2839
|
+
},
|
|
2840
|
+
then: {
|
|
2841
|
+
name: "properties.imageSize.properties.imageWidth.display.visible",
|
|
2842
|
+
value: true
|
|
2843
|
+
}
|
|
2844
|
+
},
|
|
2845
|
+
{
|
|
2846
|
+
if: {
|
|
2847
|
+
name: "imageSize.sizeType",
|
|
2848
|
+
value: "random"
|
|
2849
|
+
},
|
|
2850
|
+
then: {
|
|
2851
|
+
name: "properties.imageSize.properties.randomRangeImageWidth.display.visible",
|
|
2852
|
+
value: true
|
|
2853
|
+
}
|
|
2854
|
+
},
|
|
2855
|
+
{
|
|
2856
|
+
if: [
|
|
2857
|
+
{ name: "position.target", value: "image" },
|
|
2858
|
+
{ name: "cursor.cursorType", value: "custom" }
|
|
2859
|
+
],
|
|
2860
|
+
then: {
|
|
2861
|
+
name: "properties.cursor.properties.defaultCursor.display.visible",
|
|
2862
|
+
value: true
|
|
2863
|
+
}
|
|
2864
|
+
},
|
|
2865
|
+
{
|
|
2866
|
+
if: {
|
|
2867
|
+
name: "cursor.cursorType",
|
|
2868
|
+
value: "custom"
|
|
2869
|
+
},
|
|
2870
|
+
then: {
|
|
2871
|
+
name: "properties.cursor.properties.hoverCursor.display.visible",
|
|
2872
|
+
value: true
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
]
|
|
2876
|
+
},
|
|
2877
|
+
content: {
|
|
2878
|
+
layoutBased: false,
|
|
2879
|
+
type: "array",
|
|
2880
|
+
items: {
|
|
2881
|
+
type: "object",
|
|
2882
|
+
properties: {
|
|
2883
|
+
image: {
|
|
2884
|
+
type: "object",
|
|
2885
|
+
display: {
|
|
2886
|
+
type: "media-input"
|
|
2887
|
+
},
|
|
2888
|
+
properties: {
|
|
2889
|
+
url: {
|
|
2890
|
+
type: "string"
|
|
2891
|
+
},
|
|
2892
|
+
name: {
|
|
2893
|
+
type: "string"
|
|
2894
|
+
},
|
|
2895
|
+
objectFit: {
|
|
2896
|
+
type: "string",
|
|
2897
|
+
enum: ["cover", "contain"]
|
|
2898
|
+
}
|
|
2899
|
+
},
|
|
2900
|
+
required: ["url", "name"]
|
|
2901
|
+
},
|
|
2902
|
+
link: {
|
|
2903
|
+
type: "string",
|
|
2904
|
+
display: {
|
|
2905
|
+
type: "text-input",
|
|
2906
|
+
placeholder: "Enter link..."
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
},
|
|
2910
|
+
required: ["image"]
|
|
2911
|
+
},
|
|
2912
|
+
default: [
|
|
2913
|
+
{
|
|
2914
|
+
image: {
|
|
2915
|
+
objectFit: "cover",
|
|
2916
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K740QZCY7R9HD9KTMB6XGPJ4.jpeg",
|
|
2917
|
+
name: "Slider-1.jpeg"
|
|
2918
|
+
},
|
|
2919
|
+
link: ""
|
|
2920
|
+
},
|
|
2921
|
+
{
|
|
2922
|
+
image: {
|
|
2923
|
+
objectFit: "cover",
|
|
2924
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K740S36970GH347RCZ8GW6QF.jpeg",
|
|
2925
|
+
name: "Slider-2.jpeg"
|
|
2926
|
+
},
|
|
2927
|
+
link: ""
|
|
2928
|
+
},
|
|
2929
|
+
{
|
|
2930
|
+
image: {
|
|
2931
|
+
objectFit: "cover",
|
|
2932
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K740RZ7VG1PWA7CRMR6TW0QS.jpeg",
|
|
2933
|
+
name: "Slider-3.jpeg"
|
|
2934
|
+
},
|
|
2935
|
+
link: ""
|
|
2936
|
+
},
|
|
2937
|
+
{
|
|
2938
|
+
image: {
|
|
2939
|
+
objectFit: "cover",
|
|
2940
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K740RV2XQMBWM2RZABY6AP9N.jpeg",
|
|
2941
|
+
name: "Slider-4.jpeg"
|
|
2942
|
+
},
|
|
2943
|
+
link: ""
|
|
2944
|
+
},
|
|
2945
|
+
{
|
|
2946
|
+
image: {
|
|
2947
|
+
objectFit: "cover",
|
|
2948
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K740RQ4E62FG7Y92J4AP8T0A.jpeg",
|
|
2949
|
+
name: "Slider-5.jpeg"
|
|
2950
|
+
},
|
|
2951
|
+
link: ""
|
|
2952
|
+
},
|
|
2953
|
+
{
|
|
2954
|
+
image: {
|
|
2955
|
+
objectFit: "cover",
|
|
2956
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K740RE073FS2HZX8AVP3MCR7.jpeg",
|
|
2957
|
+
name: "Slider-6.jpeg"
|
|
2958
|
+
},
|
|
2959
|
+
link: ""
|
|
2960
|
+
},
|
|
2961
|
+
{
|
|
2962
|
+
image: {
|
|
2963
|
+
objectFit: "cover",
|
|
2964
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K740R841W216BPQR07XZN8G4.jpeg",
|
|
2965
|
+
name: "Slider-7.jpeg"
|
|
2966
|
+
},
|
|
2967
|
+
link: ""
|
|
2968
|
+
}
|
|
2969
|
+
]
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
};
|
|
2258
2974
|
const components = [
|
|
2259
|
-
ControlSliderComponent
|
|
2975
|
+
ControlSliderComponent,
|
|
2976
|
+
ControlImageRevealSliderComponent
|
|
2260
2977
|
];
|
|
2261
2978
|
export {
|
|
2262
2979
|
AnchorSide,
|