@cntrl-site/components 0.1.0-alpha.9 → 0.1.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/Components/ControlSlider/ControlSliderComponent.d.ts +39 -1
- package/dist/Components/Lightbox/Lightbox.d.ts +32 -7
- package/dist/Components/Lightbox/getAnimationClasses.d.ts +9 -0
- package/dist/Components/utils/getColorAlpha.d.ts +1 -0
- package/dist/Components/utils/getImageRect.d.ts +6 -0
- package/dist/Components/utils/getPositionStyles.d.ts +1 -1
- package/dist/components.css +1 -1
- package/dist/index.js +1041 -608
- package/dist/index.mjs +1043 -610
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useState, useEffect, useRef, useMemo } from "react";
|
|
2
|
+
import React, { useState, useEffect, useRef, useMemo, useCallback } from "react";
|
|
3
3
|
import { Splide, SplideSlide } from "@splidejs/react-splide";
|
|
4
4
|
import cn from "classnames";
|
|
5
5
|
import { createPortal } from "react-dom";
|
|
@@ -45,7 +45,7 @@ const bottomRightAlignment = "ControlSlider-module__bottomRightAlignment___kEwrz
|
|
|
45
45
|
const clickOverlay = "ControlSlider-module__clickOverlay___DZA28";
|
|
46
46
|
const contain$1 = "ControlSlider-module__contain___pLyq7";
|
|
47
47
|
const cover$1 = "ControlSlider-module__cover___KdDat";
|
|
48
|
-
const styles$
|
|
48
|
+
const styles$3 = {
|
|
49
49
|
wrapper,
|
|
50
50
|
sliderItem,
|
|
51
51
|
sliderImage,
|
|
@@ -90,14 +90,14 @@ const styles$4 = {
|
|
|
90
90
|
cover: cover$1
|
|
91
91
|
};
|
|
92
92
|
const link$1 = "RichTextRenderer-module__link___BWeZ2";
|
|
93
|
-
const styles$
|
|
93
|
+
const styles$2 = {
|
|
94
94
|
link: link$1
|
|
95
95
|
};
|
|
96
96
|
const RichTextRenderer = ({ content }) => {
|
|
97
97
|
const getChildren = (children) => {
|
|
98
98
|
return children.map((child, i) => {
|
|
99
99
|
if (child.type === "link") {
|
|
100
|
-
return /* @__PURE__ */ jsx("a", { className: styles$
|
|
100
|
+
return /* @__PURE__ */ jsx("a", { className: styles$2.link, href: child.value, target: child.target, children: getChildren(child.children) }, i);
|
|
101
101
|
}
|
|
102
102
|
return /* @__PURE__ */ jsx("span", { style: getLeafCss(child), children: child.text }, i);
|
|
103
103
|
});
|
|
@@ -126,7 +126,7 @@ function scalingValue(value, isEditor = false) {
|
|
|
126
126
|
}
|
|
127
127
|
const svg = "SvgImage-module__svg___q3xE-";
|
|
128
128
|
const img = "SvgImage-module__img___VsTm-";
|
|
129
|
-
const styles$
|
|
129
|
+
const styles$1 = {
|
|
130
130
|
svg,
|
|
131
131
|
img
|
|
132
132
|
};
|
|
@@ -139,13 +139,13 @@ const SvgImage = ({ url, fill = "#000000", hoverFill = "#CCCCCC", className = ""
|
|
|
139
139
|
}
|
|
140
140
|
}, []);
|
|
141
141
|
if (!url.endsWith(".svg") || !supportsMask) {
|
|
142
|
-
return /* @__PURE__ */ jsx("img", { src: url, alt: "", className: cn(styles$
|
|
142
|
+
return /* @__PURE__ */ jsx("img", { src: url, alt: "", className: cn(styles$1.img, className) });
|
|
143
143
|
}
|
|
144
144
|
return /* @__PURE__ */ jsx(
|
|
145
145
|
"span",
|
|
146
146
|
{
|
|
147
147
|
"data-supports-mask": supportsMask,
|
|
148
|
-
className: cn(styles$
|
|
148
|
+
className: cn(styles$1.svg, className),
|
|
149
149
|
style: {
|
|
150
150
|
"--svg": `url(${url})`,
|
|
151
151
|
"--fill": fill,
|
|
@@ -155,15 +155,15 @@ const SvgImage = ({ url, fill = "#000000", hoverFill = "#CCCCCC", className = ""
|
|
|
155
155
|
);
|
|
156
156
|
};
|
|
157
157
|
const alignmentClassName = {
|
|
158
|
-
"top-left": styles$
|
|
159
|
-
"top-center": styles$
|
|
160
|
-
"top-right": styles$
|
|
161
|
-
"middle-left": styles$
|
|
162
|
-
"middle-center": styles$
|
|
163
|
-
"middle-right": styles$
|
|
164
|
-
"bottom-left": styles$
|
|
165
|
-
"bottom-center": styles$
|
|
166
|
-
"bottom-right": styles$
|
|
158
|
+
"top-left": styles$3.topLeftAlignment,
|
|
159
|
+
"top-center": styles$3.topCenterAlignment,
|
|
160
|
+
"top-right": styles$3.topRightAlignment,
|
|
161
|
+
"middle-left": styles$3.middleLeftAlignment,
|
|
162
|
+
"middle-center": styles$3.middleCenterAlignment,
|
|
163
|
+
"middle-right": styles$3.middleRightAlignment,
|
|
164
|
+
"bottom-left": styles$3.bottomLeftAlignment,
|
|
165
|
+
"bottom-center": styles$3.bottomCenterAlignment,
|
|
166
|
+
"bottom-right": styles$3.bottomRightAlignment
|
|
167
167
|
};
|
|
168
168
|
function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
169
169
|
const [sliderRef, setSliderRef] = useState(null);
|
|
@@ -198,10 +198,10 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
198
198
|
setKey((prev) => prev + 1);
|
|
199
199
|
prevSliderTypeRef.current = transition.type;
|
|
200
200
|
}, [transition.type]);
|
|
201
|
-
return /* @__PURE__ */ jsx("div", { className: cn(styles$
|
|
201
|
+
return /* @__PURE__ */ jsx("div", { className: cn(styles$3.wrapper, { [styles$3.editor]: isEditor }), ref: setWrapperRef, children: /* @__PURE__ */ jsxs(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
204
|
-
className: styles$
|
|
204
|
+
className: styles$3.sliderInner,
|
|
205
205
|
style: {
|
|
206
206
|
width: sliderDimensions ? sliderDimensions.width : "100%",
|
|
207
207
|
height: sliderDimensions ? sliderDimensions.height : "100%",
|
|
@@ -211,17 +211,17 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
211
211
|
settings.caption.isActive && /* @__PURE__ */ jsx(
|
|
212
212
|
"div",
|
|
213
213
|
{
|
|
214
|
-
className: cn(styles$
|
|
214
|
+
className: cn(styles$3.captionBlock),
|
|
215
215
|
children: /* @__PURE__ */ jsx(
|
|
216
216
|
"div",
|
|
217
217
|
{
|
|
218
|
-
className: styles$
|
|
218
|
+
className: styles$3.captionTextWrapper,
|
|
219
219
|
children: content.map((item, index) => /* @__PURE__ */ jsx(
|
|
220
220
|
"div",
|
|
221
221
|
{
|
|
222
|
-
className: cn(styles$
|
|
223
|
-
[styles$
|
|
224
|
-
[styles$
|
|
222
|
+
className: cn(styles$3.captionText, alignmentClassName[caption2.alignment], {
|
|
223
|
+
[styles$3.withPointerEvents]: index === currentSlideIndex && isEditor,
|
|
224
|
+
[styles$3.active]: index === currentSlideIndex
|
|
225
225
|
}),
|
|
226
226
|
style: {
|
|
227
227
|
fontFamily: fontSettings.fontFamily,
|
|
@@ -243,7 +243,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
243
243
|
"div",
|
|
244
244
|
{
|
|
245
245
|
"data-styles": "caption",
|
|
246
|
-
className: styles$
|
|
246
|
+
className: styles$3.captionTextInner,
|
|
247
247
|
style: {
|
|
248
248
|
"--link-hover-color": caption2.hover,
|
|
249
249
|
position: "relative",
|
|
@@ -286,17 +286,17 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
286
286
|
children: content.map((item, index) => /* @__PURE__ */ jsx(SplideSlide, { children: /* @__PURE__ */ jsx(
|
|
287
287
|
"div",
|
|
288
288
|
{
|
|
289
|
-
className: styles$
|
|
289
|
+
className: styles$3.sliderItem,
|
|
290
290
|
children: /* @__PURE__ */ jsx(
|
|
291
291
|
"div",
|
|
292
292
|
{
|
|
293
|
-
className: styles$
|
|
293
|
+
className: styles$3.imgWrapper,
|
|
294
294
|
children: /* @__PURE__ */ jsx(
|
|
295
295
|
"img",
|
|
296
296
|
{
|
|
297
|
-
className: cn(styles$
|
|
298
|
-
[styles$
|
|
299
|
-
[styles$
|
|
297
|
+
className: cn(styles$3.sliderImage, {
|
|
298
|
+
[styles$3.contain]: item.image.objectFit === "contain",
|
|
299
|
+
[styles$3.cover]: item.image.objectFit === "cover"
|
|
300
300
|
}),
|
|
301
301
|
src: item.image.url,
|
|
302
302
|
alt: item.image.name ?? ""
|
|
@@ -313,8 +313,8 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
313
313
|
/* @__PURE__ */ jsx(
|
|
314
314
|
"div",
|
|
315
315
|
{
|
|
316
|
-
className: cn(styles$
|
|
317
|
-
[styles$
|
|
316
|
+
className: cn(styles$3.arrow, {
|
|
317
|
+
[styles$3.arrowVertical]: direction === "vert"
|
|
318
318
|
}),
|
|
319
319
|
style: {
|
|
320
320
|
color: controls.color,
|
|
@@ -326,7 +326,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
326
326
|
onClick: () => {
|
|
327
327
|
handleArrowClick("-1");
|
|
328
328
|
},
|
|
329
|
-
className: styles$
|
|
329
|
+
className: styles$3.arrowInner,
|
|
330
330
|
style: {
|
|
331
331
|
transform: `translate(${scalingValue(controlsOffsetX, isEditor)}, ${scalingValue(controlsOffsetY * (direction === "horiz" ? 1 : -1), isEditor)}) scale(${settings.controls.scale / 100}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
|
|
332
332
|
},
|
|
@@ -337,10 +337,10 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
337
337
|
url: controls.arrowsImgUrl,
|
|
338
338
|
fill: controls.color,
|
|
339
339
|
hoverFill: controls.hover,
|
|
340
|
-
className: cn(styles$
|
|
340
|
+
className: cn(styles$3.arrowImg, styles$3.mirror)
|
|
341
341
|
}
|
|
342
342
|
),
|
|
343
|
-
!controls.arrowsImgUrl && /* @__PURE__ */ jsx(ArrowIcon, { color: controls.color, className: cn(styles$
|
|
343
|
+
!controls.arrowsImgUrl && /* @__PURE__ */ jsx(ArrowIcon, { color: controls.color, className: cn(styles$3.arrowIcon, styles$3.arrowImg, styles$3.mirror) })
|
|
344
344
|
]
|
|
345
345
|
}
|
|
346
346
|
)
|
|
@@ -349,8 +349,8 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
349
349
|
/* @__PURE__ */ jsx(
|
|
350
350
|
"div",
|
|
351
351
|
{
|
|
352
|
-
className: cn(styles$
|
|
353
|
-
[styles$
|
|
352
|
+
className: cn(styles$3.arrow, styles$3.nextArrow, {
|
|
353
|
+
[styles$3.arrowVertical]: direction === "vert"
|
|
354
354
|
}),
|
|
355
355
|
style: {
|
|
356
356
|
color: controls.color,
|
|
@@ -359,7 +359,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
359
359
|
children: /* @__PURE__ */ jsxs(
|
|
360
360
|
"button",
|
|
361
361
|
{
|
|
362
|
-
className: styles$
|
|
362
|
+
className: styles$3.arrowInner,
|
|
363
363
|
onClick: () => handleArrowClick("+1"),
|
|
364
364
|
style: {
|
|
365
365
|
transform: `translate(${scalingValue(controlsOffsetX * (direction === "horiz" ? -1 : 1), isEditor)}, ${scalingValue(controlsOffsetY, isEditor)}) scale(${settings.controls.scale / 100}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
|
|
@@ -371,10 +371,10 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
371
371
|
url: controls.arrowsImgUrl,
|
|
372
372
|
fill: controls.color,
|
|
373
373
|
hoverFill: controls.hover,
|
|
374
|
-
className: styles$
|
|
374
|
+
className: styles$3.arrowImg
|
|
375
375
|
}
|
|
376
376
|
),
|
|
377
|
-
!controls.arrowsImgUrl && /* @__PURE__ */ jsx(ArrowIcon, { color: controls.color, className: cn(styles$
|
|
377
|
+
!controls.arrowsImgUrl && /* @__PURE__ */ jsx(ArrowIcon, { color: controls.color, className: cn(styles$3.arrowIcon, styles$3.arrowImg) })
|
|
378
378
|
]
|
|
379
379
|
}
|
|
380
380
|
)
|
|
@@ -384,7 +384,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
384
384
|
triggers.triggersList.click && /* @__PURE__ */ jsx(
|
|
385
385
|
"div",
|
|
386
386
|
{
|
|
387
|
-
className: styles$
|
|
387
|
+
className: styles$3.clickOverlay,
|
|
388
388
|
onClick: () => {
|
|
389
389
|
if (sliderRef) {
|
|
390
390
|
sliderRef.go("+1");
|
|
@@ -395,21 +395,21 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
395
395
|
pagination2.isActive && /* @__PURE__ */ jsx(
|
|
396
396
|
"div",
|
|
397
397
|
{
|
|
398
|
-
className: cn(styles$
|
|
399
|
-
[styles$
|
|
400
|
-
[styles$
|
|
401
|
-
[styles$
|
|
402
|
-
[styles$
|
|
403
|
-
[styles$
|
|
404
|
-
[styles$
|
|
405
|
-
[styles$
|
|
406
|
-
[styles$
|
|
407
|
-
[styles$
|
|
398
|
+
className: cn(styles$3.pagination, {
|
|
399
|
+
[styles$3.paginationInsideBottom]: pagination2.position === "inside-1" && direction === "horiz",
|
|
400
|
+
[styles$3.paginationInsideTop]: pagination2.position === "inside-2" && direction === "horiz",
|
|
401
|
+
[styles$3.paginationOutsideBottom]: pagination2.position === "outside-1" && direction === "horiz",
|
|
402
|
+
[styles$3.paginationOutsideTop]: pagination2.position === "outside-2" && direction === "horiz",
|
|
403
|
+
[styles$3.paginationInsideLeft]: pagination2.position === "inside-1" && direction === "vert",
|
|
404
|
+
[styles$3.paginationInsideRight]: pagination2.position === "inside-2" && direction === "vert",
|
|
405
|
+
[styles$3.paginationOutsideLeft]: pagination2.position === "outside-1" && direction === "vert",
|
|
406
|
+
[styles$3.paginationOutsideRight]: pagination2.position === "outside-2" && direction === "vert",
|
|
407
|
+
[styles$3.paginationVertical]: direction === "vert"
|
|
408
408
|
}),
|
|
409
409
|
children: /* @__PURE__ */ jsx(
|
|
410
410
|
"div",
|
|
411
411
|
{
|
|
412
|
-
className: styles$
|
|
412
|
+
className: styles$3.paginationInner,
|
|
413
413
|
style: {
|
|
414
414
|
backgroundColor: pagination2.colors[2],
|
|
415
415
|
transform: `scale(${pagination2.scale / 100}) translate(${scalingValue(pagination2.offset.x, isEditor)}, ${scalingValue(pagination2.offset.y, isEditor)}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
|
|
@@ -422,12 +422,12 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
422
422
|
sliderRef.go(index);
|
|
423
423
|
}
|
|
424
424
|
},
|
|
425
|
-
className: cn(styles$
|
|
425
|
+
className: cn(styles$3.paginationItem),
|
|
426
426
|
children: /* @__PURE__ */ jsx(
|
|
427
427
|
"div",
|
|
428
428
|
{
|
|
429
|
-
className: cn(styles$
|
|
430
|
-
[styles$
|
|
429
|
+
className: cn(styles$3.dot, {
|
|
430
|
+
[styles$3.activeDot]: index === currentSlideIndex
|
|
431
431
|
}),
|
|
432
432
|
style: {
|
|
433
433
|
backgroundColor: index === currentSlideIndex ? pagination2.colors[0] : pagination2.colors[1],
|
|
@@ -504,7 +504,6 @@ const ControlSliderComponent = {
|
|
|
504
504
|
direction: {
|
|
505
505
|
icon: "horizontal-resize",
|
|
506
506
|
tooltip: "Direction",
|
|
507
|
-
title: "direction",
|
|
508
507
|
type: "string",
|
|
509
508
|
display: {
|
|
510
509
|
type: "ratio-group"
|
|
@@ -563,15 +562,28 @@ const ControlSliderComponent = {
|
|
|
563
562
|
},
|
|
564
563
|
offset: {
|
|
565
564
|
type: "object",
|
|
565
|
+
title: "Offset",
|
|
566
566
|
display: {
|
|
567
|
-
type: "
|
|
567
|
+
type: "group"
|
|
568
568
|
},
|
|
569
569
|
properties: {
|
|
570
570
|
x: {
|
|
571
|
-
type: "number"
|
|
571
|
+
type: "number",
|
|
572
|
+
label: "X",
|
|
573
|
+
scalingEnabled: true,
|
|
574
|
+
display: {
|
|
575
|
+
type: "numeric-input",
|
|
576
|
+
visible: true
|
|
577
|
+
}
|
|
572
578
|
},
|
|
573
579
|
y: {
|
|
574
|
-
type: "number"
|
|
580
|
+
type: "number",
|
|
581
|
+
label: "Y",
|
|
582
|
+
scalingEnabled: true,
|
|
583
|
+
display: {
|
|
584
|
+
type: "numeric-input",
|
|
585
|
+
visible: true
|
|
586
|
+
}
|
|
575
587
|
}
|
|
576
588
|
}
|
|
577
589
|
},
|
|
@@ -624,15 +636,28 @@ const ControlSliderComponent = {
|
|
|
624
636
|
},
|
|
625
637
|
offset: {
|
|
626
638
|
type: "object",
|
|
639
|
+
title: "Offset",
|
|
627
640
|
display: {
|
|
628
|
-
type: "
|
|
641
|
+
type: "group"
|
|
629
642
|
},
|
|
630
643
|
properties: {
|
|
631
644
|
x: {
|
|
632
|
-
type: "number"
|
|
645
|
+
type: "number",
|
|
646
|
+
label: "X",
|
|
647
|
+
scalingEnabled: true,
|
|
648
|
+
display: {
|
|
649
|
+
type: "numeric-input",
|
|
650
|
+
visible: true
|
|
651
|
+
}
|
|
633
652
|
},
|
|
634
653
|
y: {
|
|
635
|
-
type: "number"
|
|
654
|
+
type: "number",
|
|
655
|
+
label: "Y",
|
|
656
|
+
scalingEnabled: true,
|
|
657
|
+
display: {
|
|
658
|
+
type: "numeric-input",
|
|
659
|
+
visible: true
|
|
660
|
+
}
|
|
636
661
|
}
|
|
637
662
|
}
|
|
638
663
|
},
|
|
@@ -687,20 +712,33 @@ const ControlSliderComponent = {
|
|
|
687
712
|
},
|
|
688
713
|
offset: {
|
|
689
714
|
type: "object",
|
|
715
|
+
title: "Offset",
|
|
690
716
|
display: {
|
|
691
|
-
type: "
|
|
717
|
+
type: "group"
|
|
692
718
|
},
|
|
693
719
|
properties: {
|
|
694
720
|
x: {
|
|
695
|
-
type: "number"
|
|
721
|
+
type: "number",
|
|
722
|
+
label: "X",
|
|
723
|
+
scalingEnabled: true,
|
|
724
|
+
display: {
|
|
725
|
+
type: "numeric-input",
|
|
726
|
+
visible: true
|
|
727
|
+
}
|
|
696
728
|
},
|
|
697
729
|
y: {
|
|
698
|
-
type: "number"
|
|
730
|
+
type: "number",
|
|
731
|
+
label: "Y",
|
|
732
|
+
scalingEnabled: true,
|
|
733
|
+
display: {
|
|
734
|
+
type: "numeric-input",
|
|
735
|
+
visible: true
|
|
736
|
+
}
|
|
699
737
|
}
|
|
700
738
|
}
|
|
701
739
|
},
|
|
702
740
|
hover: {
|
|
703
|
-
title: "
|
|
741
|
+
title: "Link Hover",
|
|
704
742
|
type: "string",
|
|
705
743
|
display: {
|
|
706
744
|
type: "settings-color-picker",
|
|
@@ -1000,7 +1038,7 @@ const ControlSliderComponent = {
|
|
|
1000
1038
|
const imageRevealSlider = "ImageRevealSlider-module__imageRevealSlider___UE5Ob";
|
|
1001
1039
|
const image = "ImageRevealSlider-module__image___Qjt-e";
|
|
1002
1040
|
const link = "ImageRevealSlider-module__link___N-iLG";
|
|
1003
|
-
const styles
|
|
1041
|
+
const styles = {
|
|
1004
1042
|
imageRevealSlider,
|
|
1005
1043
|
image,
|
|
1006
1044
|
link
|
|
@@ -1135,12 +1173,12 @@ function ImageRevealSlider({ settings, content, isEditor }) {
|
|
|
1135
1173
|
{
|
|
1136
1174
|
ref: divRef,
|
|
1137
1175
|
onClick: handleClick,
|
|
1138
|
-
className: styles
|
|
1176
|
+
className: styles.imageRevealSlider,
|
|
1139
1177
|
style: { cursor: cursorType !== "system" && defaultCursor ? `url(${target === "area" ? hoverCursor : defaultCursor}), auto` : "default" },
|
|
1140
1178
|
children: placedImages.map((img2) => /* @__PURE__ */ jsx(
|
|
1141
1179
|
"div",
|
|
1142
1180
|
{
|
|
1143
|
-
className: styles
|
|
1181
|
+
className: styles.wrapper,
|
|
1144
1182
|
style: {
|
|
1145
1183
|
top: `${img2.y}px`,
|
|
1146
1184
|
left: `${img2.x}px`,
|
|
@@ -1150,12 +1188,12 @@ function ImageRevealSlider({ settings, content, isEditor }) {
|
|
|
1150
1188
|
height: "auto",
|
|
1151
1189
|
cursor: cursorType !== "system" && hoverCursor ? `url(${hoverCursor}), auto` : "default"
|
|
1152
1190
|
},
|
|
1153
|
-
children: target === "area" && img2.link ? /* @__PURE__ */ jsx("a", { href: img2.link, target: "_blank", className: styles
|
|
1191
|
+
children: target === "area" && img2.link ? /* @__PURE__ */ jsx("a", { href: img2.link, target: "_blank", className: styles.link, children: /* @__PURE__ */ jsx(
|
|
1154
1192
|
"img",
|
|
1155
1193
|
{
|
|
1156
1194
|
src: img2.url,
|
|
1157
1195
|
alt: img2.name,
|
|
1158
|
-
className: styles
|
|
1196
|
+
className: styles.image
|
|
1159
1197
|
},
|
|
1160
1198
|
img2.id
|
|
1161
1199
|
) }) : /* @__PURE__ */ jsx(
|
|
@@ -1163,7 +1201,7 @@ function ImageRevealSlider({ settings, content, isEditor }) {
|
|
|
1163
1201
|
{
|
|
1164
1202
|
src: img2.url,
|
|
1165
1203
|
alt: img2.name,
|
|
1166
|
-
className: styles
|
|
1204
|
+
className: styles.image
|
|
1167
1205
|
},
|
|
1168
1206
|
img2.id
|
|
1169
1207
|
)
|
|
@@ -1206,7 +1244,7 @@ const ControlImageRevealSliderComponent = {
|
|
|
1206
1244
|
display: {
|
|
1207
1245
|
type: "ratio-group"
|
|
1208
1246
|
},
|
|
1209
|
-
enum: ["as
|
|
1247
|
+
enum: ["as Is", "custom", "random"]
|
|
1210
1248
|
},
|
|
1211
1249
|
imageWidth: {
|
|
1212
1250
|
type: "number",
|
|
@@ -1441,39 +1479,44 @@ const ControlImageRevealSliderComponent = {
|
|
|
1441
1479
|
}
|
|
1442
1480
|
}
|
|
1443
1481
|
};
|
|
1444
|
-
const
|
|
1445
|
-
const
|
|
1446
|
-
const editor = "
|
|
1447
|
-
const contentStyle = "
|
|
1448
|
-
const imageStyle = "
|
|
1449
|
-
const imgWrapper = "
|
|
1450
|
-
const contain = "
|
|
1451
|
-
const cover = "
|
|
1452
|
-
const caption = "
|
|
1453
|
-
const
|
|
1454
|
-
const
|
|
1455
|
-
const
|
|
1456
|
-
const
|
|
1457
|
-
const
|
|
1458
|
-
const
|
|
1459
|
-
const
|
|
1460
|
-
const
|
|
1461
|
-
const
|
|
1462
|
-
const
|
|
1463
|
-
const
|
|
1464
|
-
const
|
|
1465
|
-
const
|
|
1466
|
-
const
|
|
1467
|
-
const closeButton = "
|
|
1468
|
-
const fadeIn = "
|
|
1469
|
-
const slideInLeft = "
|
|
1470
|
-
const slideInRight = "
|
|
1471
|
-
const slideInTop = "
|
|
1472
|
-
const slideInBottom = "
|
|
1473
|
-
const
|
|
1474
|
-
const
|
|
1482
|
+
const heroImage = "LightBox-module__heroImage___sTxNF";
|
|
1483
|
+
const background = "LightBox-module__background___rm9ml";
|
|
1484
|
+
const editor = "LightBox-module__editor___4ACaY";
|
|
1485
|
+
const contentStyle = "LightBox-module__contentStyle___Bgnsq";
|
|
1486
|
+
const imageStyle = "LightBox-module__imageStyle___tLIlB";
|
|
1487
|
+
const imgWrapper = "LightBox-module__imgWrapper___LuFUp";
|
|
1488
|
+
const contain = "LightBox-module__contain___8-yaS";
|
|
1489
|
+
const cover = "LightBox-module__cover___hNvOG";
|
|
1490
|
+
const caption = "LightBox-module__caption___b6L2I";
|
|
1491
|
+
const captionTextInner = "LightBox-module__captionTextInner___rCGNH";
|
|
1492
|
+
const lightboxSplide = "LightBox-module__lightboxSplide___XFuWC";
|
|
1493
|
+
const arrow = "LightBox-module__arrow___iz38X";
|
|
1494
|
+
const arrowVertical = "LightBox-module__arrowVertical___Zfz81";
|
|
1495
|
+
const nextArrow = "LightBox-module__nextArrow___zkAQN";
|
|
1496
|
+
const arrowInner = "LightBox-module__arrowInner___p48sW";
|
|
1497
|
+
const arrowImg = "LightBox-module__arrowImg___pNV88";
|
|
1498
|
+
const mirror = "LightBox-module__mirror___pjeXc";
|
|
1499
|
+
const thumbsContainerVertical = "LightBox-module__thumbsContainerVertical___wttk5";
|
|
1500
|
+
const thumbsContainer = "LightBox-module__thumbsContainer___osSma";
|
|
1501
|
+
const thumbsAlignStart = "LightBox-module__thumbsAlignStart___MO6tY";
|
|
1502
|
+
const thumbsAlignCenter = "LightBox-module__thumbsAlignCenter___Q4sUx";
|
|
1503
|
+
const thumbsAlignEnd = "LightBox-module__thumbsAlignEnd___p4y9R";
|
|
1504
|
+
const thumbItem = "LightBox-module__thumbItem___HvnF3";
|
|
1505
|
+
const closeButton = "LightBox-module__closeButton___g2khP";
|
|
1506
|
+
const fadeIn = "LightBox-module__fadeIn___0m5GW";
|
|
1507
|
+
const slideInLeft = "LightBox-module__slideInLeft___gPYwC";
|
|
1508
|
+
const slideInRight = "LightBox-module__slideInRight___S-pPp";
|
|
1509
|
+
const slideInTop = "LightBox-module__slideInTop___DFdAj";
|
|
1510
|
+
const slideInBottom = "LightBox-module__slideInBottom___m27kZ";
|
|
1511
|
+
const fadeOut = "LightBox-module__fadeOut___55qBR";
|
|
1512
|
+
const slideOutLeft = "LightBox-module__slideOutLeft___NvU7P";
|
|
1513
|
+
const slideOutRight = "LightBox-module__slideOutRight___SK7eC";
|
|
1514
|
+
const slideOutTop = "LightBox-module__slideOutTop___Vgg0z";
|
|
1515
|
+
const slideOutBottom = "LightBox-module__slideOutBottom___nJ0Ef";
|
|
1516
|
+
const scaleSlide = "LightBox-module__scaleSlide___vZriG";
|
|
1517
|
+
const classes = {
|
|
1518
|
+
heroImage,
|
|
1475
1519
|
background,
|
|
1476
|
-
backdropStyle,
|
|
1477
1520
|
editor,
|
|
1478
1521
|
contentStyle,
|
|
1479
1522
|
imageStyle,
|
|
@@ -1481,6 +1524,7 @@ const styles = {
|
|
|
1481
1524
|
contain,
|
|
1482
1525
|
cover,
|
|
1483
1526
|
caption,
|
|
1527
|
+
captionTextInner,
|
|
1484
1528
|
lightboxSplide,
|
|
1485
1529
|
arrow,
|
|
1486
1530
|
arrowVertical,
|
|
@@ -1494,16 +1538,20 @@ const styles = {
|
|
|
1494
1538
|
thumbsAlignCenter,
|
|
1495
1539
|
thumbsAlignEnd,
|
|
1496
1540
|
thumbItem,
|
|
1497
|
-
thumbImage,
|
|
1498
1541
|
closeButton,
|
|
1499
1542
|
fadeIn,
|
|
1500
1543
|
slideInLeft,
|
|
1501
1544
|
slideInRight,
|
|
1502
1545
|
slideInTop,
|
|
1503
1546
|
slideInBottom,
|
|
1547
|
+
fadeOut,
|
|
1548
|
+
slideOutLeft,
|
|
1549
|
+
slideOutRight,
|
|
1550
|
+
slideOutTop,
|
|
1551
|
+
slideOutBottom,
|
|
1504
1552
|
scaleSlide
|
|
1505
1553
|
};
|
|
1506
|
-
const getPositionStyles = (position, offset) => {
|
|
1554
|
+
const getPositionStyles = (position, offset, isEditor) => {
|
|
1507
1555
|
const styles2 = {};
|
|
1508
1556
|
const [vertical, horizontal] = position.split("-");
|
|
1509
1557
|
if (vertical === "top") {
|
|
@@ -1527,17 +1575,136 @@ const getPositionStyles = (position, offset) => {
|
|
|
1527
1575
|
styles2.right = "0";
|
|
1528
1576
|
}
|
|
1529
1577
|
if (vertical === "middle" && horizontal === "center") {
|
|
1530
|
-
styles2.transform = `translate(calc(-50% + ${offset.x}
|
|
1578
|
+
styles2.transform = `translate(calc(-50% + ${scalingValue(offset.x, isEditor)}), calc(-50% + ${scalingValue(offset.y, isEditor)}))`;
|
|
1531
1579
|
} else if (vertical === "middle") {
|
|
1532
|
-
styles2.transform = `translate(${offset.x}
|
|
1580
|
+
styles2.transform = `translate(${scalingValue(offset.x, isEditor)}, calc(-50% + ${scalingValue(offset.y, isEditor)}))`;
|
|
1533
1581
|
} else if (horizontal === "center") {
|
|
1534
|
-
styles2.transform = `translate(calc(-50% + ${offset.x}
|
|
1582
|
+
styles2.transform = `translate(calc(-50% + ${scalingValue(offset.x, isEditor)}), ${scalingValue(offset.y, isEditor)})`;
|
|
1535
1583
|
} else {
|
|
1536
|
-
styles2.transform = `translate(${offset.x}
|
|
1584
|
+
styles2.transform = `translate(${scalingValue(offset.x, isEditor)}, ${scalingValue(offset.y, isEditor)})`;
|
|
1537
1585
|
}
|
|
1538
1586
|
return styles2;
|
|
1539
1587
|
};
|
|
1540
|
-
function
|
|
1588
|
+
function getDisplayedImageRect(img2) {
|
|
1589
|
+
const container = img2.getBoundingClientRect();
|
|
1590
|
+
const containerW = container.width;
|
|
1591
|
+
const containerH = container.height;
|
|
1592
|
+
const imgW = img2.naturalWidth;
|
|
1593
|
+
const imgH = img2.naturalHeight;
|
|
1594
|
+
const containerRatio = containerW / containerH;
|
|
1595
|
+
const imgRatio = imgW / imgH;
|
|
1596
|
+
let renderedW, renderedH;
|
|
1597
|
+
if (imgRatio > containerRatio) {
|
|
1598
|
+
renderedW = containerW;
|
|
1599
|
+
renderedH = containerW / imgRatio;
|
|
1600
|
+
} else {
|
|
1601
|
+
renderedH = containerH;
|
|
1602
|
+
renderedW = containerH * imgRatio;
|
|
1603
|
+
}
|
|
1604
|
+
const offsetX = (containerW - renderedW) / 2 + container.left;
|
|
1605
|
+
const offsetY = (containerH - renderedH) / 2 + container.top;
|
|
1606
|
+
return {
|
|
1607
|
+
x: offsetX,
|
|
1608
|
+
y: offsetY,
|
|
1609
|
+
width: renderedW,
|
|
1610
|
+
height: renderedH
|
|
1611
|
+
};
|
|
1612
|
+
}
|
|
1613
|
+
function getColorAlpha(color) {
|
|
1614
|
+
const rgbaMatch = color.match(/rgba?\(([^)]+)\)/);
|
|
1615
|
+
if (rgbaMatch) {
|
|
1616
|
+
const values = rgbaMatch[1].split(",").map((v) => parseFloat(v.trim()));
|
|
1617
|
+
if (values.length === 4) {
|
|
1618
|
+
return values[3];
|
|
1619
|
+
}
|
|
1620
|
+
return 1;
|
|
1621
|
+
}
|
|
1622
|
+
const hexMatch = color.match(/^#([0-9a-fA-F]{8})$/);
|
|
1623
|
+
if (hexMatch) {
|
|
1624
|
+
const alphaHex = hexMatch[1].substring(6, 8);
|
|
1625
|
+
return parseInt(alphaHex, 16) / 255;
|
|
1626
|
+
}
|
|
1627
|
+
if (color.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/)) {
|
|
1628
|
+
return 1;
|
|
1629
|
+
}
|
|
1630
|
+
return 1;
|
|
1631
|
+
}
|
|
1632
|
+
function getAnimationClasses(type, direction) {
|
|
1633
|
+
const appearClass = (() => {
|
|
1634
|
+
if (type === "fade in") return classes.fadeIn;
|
|
1635
|
+
if (type === "slide in" || type === "mix") {
|
|
1636
|
+
switch (direction) {
|
|
1637
|
+
case "left":
|
|
1638
|
+
return classes.slideInLeft;
|
|
1639
|
+
case "right":
|
|
1640
|
+
return classes.slideInRight;
|
|
1641
|
+
case "top":
|
|
1642
|
+
return classes.slideInTop;
|
|
1643
|
+
case "bottom":
|
|
1644
|
+
return classes.slideInBottom;
|
|
1645
|
+
default:
|
|
1646
|
+
return classes.slideInRight;
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
return classes.fadeIn;
|
|
1650
|
+
})();
|
|
1651
|
+
const backdropAppearClass = (() => {
|
|
1652
|
+
if (type === "fade in" || type === "mix") return classes.fadeIn;
|
|
1653
|
+
if (type === "slide in") {
|
|
1654
|
+
switch (direction) {
|
|
1655
|
+
case "left":
|
|
1656
|
+
return classes.slideInLeft;
|
|
1657
|
+
case "right":
|
|
1658
|
+
return classes.slideInRight;
|
|
1659
|
+
case "top":
|
|
1660
|
+
return classes.slideInTop;
|
|
1661
|
+
case "bottom":
|
|
1662
|
+
return classes.slideInBottom;
|
|
1663
|
+
default:
|
|
1664
|
+
return classes.slideInRight;
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
return classes.fadeIn;
|
|
1668
|
+
})();
|
|
1669
|
+
const backdropDisappearClass = (() => {
|
|
1670
|
+
if (type === "fade in" || type === "mix") return classes.fadeOut;
|
|
1671
|
+
if (type === "slide in") {
|
|
1672
|
+
switch (direction) {
|
|
1673
|
+
case "left":
|
|
1674
|
+
return classes.slideOutLeft;
|
|
1675
|
+
case "right":
|
|
1676
|
+
return classes.slideOutRight;
|
|
1677
|
+
case "top":
|
|
1678
|
+
return classes.slideOutTop;
|
|
1679
|
+
case "bottom":
|
|
1680
|
+
return classes.slideOutBottom;
|
|
1681
|
+
default:
|
|
1682
|
+
return classes.slideOutRight;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
return classes.fadeOut;
|
|
1686
|
+
})();
|
|
1687
|
+
const disappearClass = (() => {
|
|
1688
|
+
if (type === "fade in") return classes.fadeOut;
|
|
1689
|
+
if (type === "slide in" || type === "mix") {
|
|
1690
|
+
switch (direction) {
|
|
1691
|
+
case "left":
|
|
1692
|
+
return classes.slideOutLeft;
|
|
1693
|
+
case "right":
|
|
1694
|
+
return classes.slideOutRight;
|
|
1695
|
+
case "top":
|
|
1696
|
+
return classes.slideOutTop;
|
|
1697
|
+
case "bottom":
|
|
1698
|
+
return classes.slideOutBottom;
|
|
1699
|
+
default:
|
|
1700
|
+
return classes.slideOutRight;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
return classes.fadeOut;
|
|
1704
|
+
})();
|
|
1705
|
+
return { appearClass, backdropAppearClass, backdropDisappearClass, disappearClass };
|
|
1706
|
+
}
|
|
1707
|
+
const LightboxGallery = ({ settings, content, styles: styles2, portalId, activeEvent, isEditor }) => {
|
|
1541
1708
|
const [open, setOpen] = React.useState(false);
|
|
1542
1709
|
const { url } = settings.thumbnailBlock.cover;
|
|
1543
1710
|
useEffect(() => {
|
|
@@ -1554,56 +1721,93 @@ function LightboxGallery({ settings, content, styles: styles2, portalId, activeE
|
|
|
1554
1721
|
{
|
|
1555
1722
|
src: url,
|
|
1556
1723
|
alt: "Cover",
|
|
1557
|
-
|
|
1724
|
+
className: classes.heroImage,
|
|
1558
1725
|
onClick: () => setOpen(true)
|
|
1559
1726
|
}
|
|
1560
1727
|
),
|
|
1561
|
-
/* @__PURE__ */ jsx(
|
|
1728
|
+
/* @__PURE__ */ jsx(
|
|
1729
|
+
Lightbox,
|
|
1730
|
+
{
|
|
1731
|
+
isOpen: open,
|
|
1732
|
+
onClose: () => setOpen(false),
|
|
1733
|
+
content,
|
|
1734
|
+
settings,
|
|
1735
|
+
lightboxStyles: styles2,
|
|
1736
|
+
portalId,
|
|
1737
|
+
isEditor
|
|
1738
|
+
}
|
|
1739
|
+
)
|
|
1562
1740
|
] });
|
|
1563
|
-
}
|
|
1564
|
-
const Lightbox = ({ isOpen, onClose, content,
|
|
1565
|
-
const [currentIndex, setCurrentIndex] =
|
|
1741
|
+
};
|
|
1742
|
+
const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId, isEditor }) => {
|
|
1743
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
1744
|
+
const [splideKey, setSplideKey] = useState(0);
|
|
1745
|
+
const [isClosing, setIsClosing] = useState(false);
|
|
1746
|
+
const [animationFinished, setAnimationFinished] = useState(false);
|
|
1747
|
+
const [thumbnailDimensions, setThumbnailDimensions] = useState({});
|
|
1566
1748
|
const lightboxRef = useRef(null);
|
|
1567
|
-
const
|
|
1749
|
+
const prevSliderTypeRef = useRef(null);
|
|
1750
|
+
const imageRef = useRef(null);
|
|
1751
|
+
const isClosingRef = useRef(false);
|
|
1752
|
+
const animationTargetRef = useRef(null);
|
|
1753
|
+
const animationEndHandlerRef = useRef(null);
|
|
1754
|
+
const appearAnimationEndHandlerRef = useRef(null);
|
|
1568
1755
|
const { appear, triggers, slider, thumbnail, controls, area, caption: caption2, layout } = settings.lightboxBlock;
|
|
1569
|
-
const
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1756
|
+
const { widthSettings, fontSettings, letterSpacing, textAlign, wordSpacing, fontSizeLineHeight, textAppearance, color } = lightboxStyles.caption;
|
|
1757
|
+
const { appearClass, backdropAppearClass, backdropDisappearClass, disappearClass } = getAnimationClasses(appear.type, appear.direction);
|
|
1758
|
+
useEffect(() => {
|
|
1759
|
+
const handleLayoutChange = () => {
|
|
1760
|
+
setTimeout(() => {
|
|
1761
|
+
var _a, _b;
|
|
1762
|
+
(_b = (_a = lightboxRef.current) == null ? void 0 : _a.splide) == null ? void 0 : _b.refresh();
|
|
1763
|
+
}, 16);
|
|
1764
|
+
};
|
|
1765
|
+
const handleComponentContentChange = () => {
|
|
1766
|
+
setSplideKey((prev) => prev + 1);
|
|
1767
|
+
};
|
|
1768
|
+
window.addEventListener("ArticleEditor.Layout:change", handleLayoutChange);
|
|
1769
|
+
window.addEventListener("ArticleEditor.ComponentContent:change", handleComponentContentChange);
|
|
1770
|
+
return () => {
|
|
1771
|
+
window.removeEventListener("ArticleEditor.Layout:change", handleLayoutChange);
|
|
1772
|
+
window.removeEventListener("ArticleEditor.ComponentContent:change", handleComponentContentChange);
|
|
1773
|
+
};
|
|
1774
|
+
}, []);
|
|
1775
|
+
const handleClose = useCallback(() => {
|
|
1776
|
+
const isMobile = window.matchMedia("(max-width: 768px)").matches;
|
|
1777
|
+
const colorAlpha = getColorAlpha(area.color);
|
|
1778
|
+
if (isMobile && !isEditor && colorAlpha > 0.9) {
|
|
1779
|
+
document.body.style.backgroundColor = "";
|
|
1588
1780
|
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1781
|
+
setIsClosing(true);
|
|
1782
|
+
isClosingRef.current = true;
|
|
1783
|
+
const handleAnimationEnd = (e) => {
|
|
1784
|
+
if (e.target === animationTargetRef.current && e.animationName) {
|
|
1785
|
+
if (animationTargetRef.current && animationEndHandlerRef.current) {
|
|
1786
|
+
animationTargetRef.current.removeEventListener("animationend", animationEndHandlerRef.current);
|
|
1787
|
+
}
|
|
1788
|
+
animationEndHandlerRef.current = null;
|
|
1789
|
+
onClose();
|
|
1790
|
+
setIsClosing(false);
|
|
1791
|
+
}
|
|
1792
|
+
};
|
|
1793
|
+
if (animationTargetRef.current) {
|
|
1794
|
+
animationEndHandlerRef.current = handleAnimationEnd;
|
|
1795
|
+
animationTargetRef.current.addEventListener("animationend", handleAnimationEnd);
|
|
1593
1796
|
}
|
|
1594
|
-
};
|
|
1595
|
-
const
|
|
1797
|
+
}, [onClose, area.color, isEditor]);
|
|
1798
|
+
const handleTriggerClick = (img2, clientX, clientY) => {
|
|
1596
1799
|
var _a, _b;
|
|
1800
|
+
if (!img2) return;
|
|
1597
1801
|
if (triggers.type === "click" && triggers.switch === "image") {
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1802
|
+
if (triggers.repeat === "close" && currentIndex === content.length - 1) {
|
|
1803
|
+
handleClose();
|
|
1804
|
+
} else {
|
|
1805
|
+
(_a = lightboxRef.current) == null ? void 0 : _a.go("+1");
|
|
1806
|
+
}
|
|
1807
|
+
} else if (triggers.type === "click" && triggers.switch === "50/50") {
|
|
1604
1808
|
const rect = img2.getBoundingClientRect();
|
|
1605
|
-
const clickX =
|
|
1606
|
-
const clickY =
|
|
1809
|
+
const clickX = clientX - rect.left;
|
|
1810
|
+
const clickY = clientY - rect.top;
|
|
1607
1811
|
const imgWidth = rect.width;
|
|
1608
1812
|
const imgHeight = rect.height;
|
|
1609
1813
|
let dir;
|
|
@@ -1615,362 +1819,435 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
|
|
|
1615
1819
|
(_b = lightboxRef.current) == null ? void 0 : _b.go(dir);
|
|
1616
1820
|
}
|
|
1617
1821
|
};
|
|
1822
|
+
const handleImageWrapperClick = (e) => {
|
|
1823
|
+
const currentImage = content[currentIndex];
|
|
1824
|
+
const isCover = (currentImage == null ? void 0 : currentImage.image.objectFit) === "cover";
|
|
1825
|
+
let clientX;
|
|
1826
|
+
let clientY;
|
|
1827
|
+
if ("changedTouches" in e && e.changedTouches.length > 0) {
|
|
1828
|
+
clientX = e.changedTouches[0].clientX;
|
|
1829
|
+
clientY = e.changedTouches[0].clientY;
|
|
1830
|
+
} else if ("clientX" in e) {
|
|
1831
|
+
clientX = e.clientX;
|
|
1832
|
+
clientY = e.clientY;
|
|
1833
|
+
} else {
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
let inside;
|
|
1837
|
+
if (isCover && imageRef.current) {
|
|
1838
|
+
const imgRect = imageRef.current.getBoundingClientRect();
|
|
1839
|
+
inside = clientX >= imgRect.left && clientX <= imgRect.right && clientY >= imgRect.top && clientY <= imgRect.bottom;
|
|
1840
|
+
} else {
|
|
1841
|
+
const rect = imageRef.current ? getDisplayedImageRect(imageRef.current) : null;
|
|
1842
|
+
if (!rect) {
|
|
1843
|
+
if (e.target === e.currentTarget) handleClose();
|
|
1844
|
+
return;
|
|
1845
|
+
}
|
|
1846
|
+
inside = clientX >= rect.x && clientX <= rect.x + rect.width && clientY >= rect.y && clientY <= rect.y + rect.height;
|
|
1847
|
+
}
|
|
1848
|
+
if (inside) {
|
|
1849
|
+
handleTriggerClick(imageRef.current, clientX, clientY);
|
|
1850
|
+
} else {
|
|
1851
|
+
handleClose();
|
|
1852
|
+
}
|
|
1853
|
+
};
|
|
1854
|
+
const onImageClick = (e) => {
|
|
1855
|
+
e.stopPropagation();
|
|
1856
|
+
handleTriggerClick(e.currentTarget, e.clientX, e.clientY);
|
|
1857
|
+
};
|
|
1618
1858
|
useEffect(() => {
|
|
1619
|
-
if (!isOpen
|
|
1859
|
+
if (!isOpen) return;
|
|
1620
1860
|
const onKeyDown = (event) => {
|
|
1861
|
+
var _a, _b;
|
|
1621
1862
|
if (event.key === "Escape") {
|
|
1622
|
-
|
|
1863
|
+
handleClose();
|
|
1623
1864
|
return;
|
|
1624
1865
|
}
|
|
1625
1866
|
if (event.key === "ArrowRight") {
|
|
1626
1867
|
setCurrentIndex((prev) => (prev + 1) % Math.max(content.length, 1));
|
|
1868
|
+
(_a = lightboxRef.current) == null ? void 0 : _a.go("+1");
|
|
1627
1869
|
return;
|
|
1628
1870
|
}
|
|
1629
1871
|
if (event.key === "ArrowLeft") {
|
|
1630
1872
|
setCurrentIndex((prev) => (prev - 1 + Math.max(content.length, 1)) % Math.max(content.length, 1));
|
|
1873
|
+
(_b = lightboxRef.current) == null ? void 0 : _b.go("-1");
|
|
1631
1874
|
}
|
|
1632
1875
|
};
|
|
1633
1876
|
window.addEventListener("keydown", onKeyDown);
|
|
1634
1877
|
return () => {
|
|
1635
1878
|
window.removeEventListener("keydown", onKeyDown);
|
|
1636
1879
|
};
|
|
1637
|
-
}, [isOpen,
|
|
1880
|
+
}, [isOpen, handleClose, content.length]);
|
|
1638
1881
|
useEffect(() => {
|
|
1639
|
-
if (isOpen)
|
|
1882
|
+
if (isOpen) {
|
|
1883
|
+
setCurrentIndex(0);
|
|
1884
|
+
isClosingRef.current = false;
|
|
1885
|
+
setIsClosing(false);
|
|
1886
|
+
setAnimationFinished(false);
|
|
1887
|
+
setThumbnailDimensions({});
|
|
1888
|
+
}
|
|
1889
|
+
return () => {
|
|
1890
|
+
if (animationTargetRef.current && animationEndHandlerRef.current) {
|
|
1891
|
+
animationTargetRef.current.removeEventListener("animationend", animationEndHandlerRef.current);
|
|
1892
|
+
animationEndHandlerRef.current = null;
|
|
1893
|
+
}
|
|
1894
|
+
setAnimationFinished(false);
|
|
1895
|
+
};
|
|
1640
1896
|
}, [isOpen]);
|
|
1897
|
+
useEffect(() => {
|
|
1898
|
+
if (prevSliderTypeRef.current !== null && prevSliderTypeRef.current !== slider.type) {
|
|
1899
|
+
setSplideKey((prev) => prev + 1);
|
|
1900
|
+
}
|
|
1901
|
+
prevSliderTypeRef.current = slider.type;
|
|
1902
|
+
}, [slider.type]);
|
|
1641
1903
|
useEffect(() => {
|
|
1642
1904
|
if (!isOpen) return;
|
|
1643
1905
|
const originalOverflow = document.body.style.overflow;
|
|
1906
|
+
const isMobile = window.matchMedia("(max-width: 768px)").matches;
|
|
1907
|
+
const colorAlpha = getColorAlpha(area.color);
|
|
1644
1908
|
document.body.style.overflow = "hidden";
|
|
1645
|
-
|
|
1909
|
+
setAnimationFinished(false);
|
|
1910
|
+
const handleAppearAnimationEnd = (e) => {
|
|
1911
|
+
if (e.target === animationTargetRef.current && !isClosingRef.current && e.animationName) {
|
|
1912
|
+
if (isMobile && !isEditor && colorAlpha > 0.9) {
|
|
1913
|
+
document.body.style.backgroundColor = area.color;
|
|
1914
|
+
}
|
|
1915
|
+
setAnimationFinished(true);
|
|
1916
|
+
if (animationTargetRef.current && appearAnimationEndHandlerRef.current) {
|
|
1917
|
+
animationTargetRef.current.removeEventListener("animationend", appearAnimationEndHandlerRef.current);
|
|
1918
|
+
}
|
|
1919
|
+
appearAnimationEndHandlerRef.current = null;
|
|
1920
|
+
}
|
|
1921
|
+
};
|
|
1922
|
+
if (animationTargetRef.current) {
|
|
1923
|
+
appearAnimationEndHandlerRef.current = handleAppearAnimationEnd;
|
|
1924
|
+
animationTargetRef.current.addEventListener("animationend", handleAppearAnimationEnd);
|
|
1925
|
+
}
|
|
1646
1926
|
const preventScroll = (e) => e.preventDefault();
|
|
1647
1927
|
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
1648
1928
|
return () => {
|
|
1649
1929
|
document.body.style.overflow = originalOverflow;
|
|
1650
1930
|
document.removeEventListener("touchmove", preventScroll);
|
|
1651
|
-
|
|
1931
|
+
if (animationTargetRef.current && appearAnimationEndHandlerRef.current) {
|
|
1932
|
+
animationTargetRef.current.removeEventListener("animationend", appearAnimationEndHandlerRef.current);
|
|
1933
|
+
appearAnimationEndHandlerRef.current = null;
|
|
1934
|
+
}
|
|
1935
|
+
setAnimationFinished(false);
|
|
1652
1936
|
};
|
|
1653
|
-
}, [isOpen]);
|
|
1937
|
+
}, [isOpen, isEditor, area.color]);
|
|
1654
1938
|
useEffect(() => {
|
|
1655
1939
|
if (!isOpen) return;
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
const
|
|
1662
|
-
if (
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
if (
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
const
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
img2.style.width = "100%";
|
|
1940
|
+
const handleTouchEnd = (e) => {
|
|
1941
|
+
if (isClosingRef.current) {
|
|
1942
|
+
e.stopPropagation();
|
|
1943
|
+
return;
|
|
1944
|
+
}
|
|
1945
|
+
const target = e.target;
|
|
1946
|
+
if (target && (target.closest(`.${classes.thumbsContainer}`) || target.closest(`.${classes.thumbItem}`))) {
|
|
1947
|
+
return;
|
|
1948
|
+
}
|
|
1949
|
+
if (e.touches.length === 0 && e.changedTouches.length > 0) {
|
|
1950
|
+
const currentImage = content[currentIndex];
|
|
1951
|
+
const isCover = (currentImage == null ? void 0 : currentImage.image.objectFit) === "cover";
|
|
1952
|
+
const touch = e.changedTouches[0];
|
|
1953
|
+
let inside;
|
|
1954
|
+
if (isCover && imageRef.current) {
|
|
1955
|
+
const imgRect = imageRef.current.getBoundingClientRect();
|
|
1956
|
+
inside = touch.clientX >= imgRect.left && touch.clientX <= imgRect.right && touch.clientY >= imgRect.top && touch.clientY <= imgRect.bottom;
|
|
1674
1957
|
} else {
|
|
1675
|
-
|
|
1958
|
+
const rect = imageRef.current ? getDisplayedImageRect(imageRef.current) : null;
|
|
1959
|
+
if (!rect) return;
|
|
1960
|
+
inside = touch.clientX >= rect.x && touch.clientX <= rect.x + rect.width && touch.clientY >= rect.y && touch.clientY <= rect.y + rect.height;
|
|
1961
|
+
}
|
|
1962
|
+
if (!inside) {
|
|
1963
|
+
e.stopPropagation();
|
|
1964
|
+
isClosingRef.current = true;
|
|
1965
|
+
const blockNextClick = (clickEvent) => {
|
|
1966
|
+
clickEvent.stopPropagation();
|
|
1967
|
+
clickEvent.preventDefault();
|
|
1968
|
+
document.removeEventListener("click", blockNextClick, true);
|
|
1969
|
+
};
|
|
1970
|
+
document.addEventListener("click", blockNextClick, true);
|
|
1971
|
+
handleClose();
|
|
1676
1972
|
}
|
|
1677
|
-
};
|
|
1678
|
-
if (img2.complete) {
|
|
1679
|
-
updateImageSize();
|
|
1680
|
-
} else {
|
|
1681
|
-
img2.onload = updateImageSize;
|
|
1682
1973
|
}
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
});
|
|
1686
|
-
resizeObserverRef.current.observe(container);
|
|
1687
|
-
resizeObserverRef.current.observe(img2);
|
|
1688
|
-
}, 0);
|
|
1974
|
+
};
|
|
1975
|
+
document.addEventListener("touchend", handleTouchEnd, { passive: true });
|
|
1689
1976
|
return () => {
|
|
1690
|
-
|
|
1691
|
-
if (resizeObserverRef.current) {
|
|
1692
|
-
resizeObserverRef.current.disconnect();
|
|
1693
|
-
resizeObserverRef.current = null;
|
|
1694
|
-
}
|
|
1977
|
+
document.removeEventListener("touchend", handleTouchEnd);
|
|
1695
1978
|
};
|
|
1696
|
-
}, [isOpen, currentIndex, content]);
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1699
|
-
|
|
1979
|
+
}, [isOpen, handleClose, currentIndex, content]);
|
|
1980
|
+
const backdropStyles = {
|
|
1981
|
+
backgroundColor: area.color,
|
|
1982
|
+
backdropFilter: `blur(${area.blur}px)`,
|
|
1983
|
+
animationDuration: `${parseInt(appear.duration)}ms`,
|
|
1984
|
+
animationTimingFunction: "ease",
|
|
1985
|
+
animationFillMode: "both"
|
|
1700
1986
|
};
|
|
1701
|
-
|
|
1702
|
-
const backdropDurationMs = appear.type === "fade in" || appear.type === "mix" ? Math.floor(appearDurationMs * 0.7) : appearDurationMs;
|
|
1703
|
-
const appearClass = (() => {
|
|
1704
|
-
if (appear.type === "fade in") return styles.fadeIn;
|
|
1705
|
-
if (appear.type === "slide in" || appear.type === "mix") {
|
|
1706
|
-
switch (appear.direction) {
|
|
1707
|
-
case "left":
|
|
1708
|
-
return styles.slideInLeft;
|
|
1709
|
-
case "right":
|
|
1710
|
-
return styles.slideInRight;
|
|
1711
|
-
case "top":
|
|
1712
|
-
return styles.slideInTop;
|
|
1713
|
-
case "bottom":
|
|
1714
|
-
return styles.slideInBottom;
|
|
1715
|
-
default:
|
|
1716
|
-
return styles.slideInRight;
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
return styles.fadeIn;
|
|
1720
|
-
})();
|
|
1721
|
-
const backdropAppearClass = (() => {
|
|
1722
|
-
if (appear.type === "fade in" || appear.type === "mix") return styles.fadeIn;
|
|
1723
|
-
if (appear.type === "slide in") {
|
|
1724
|
-
switch (appear.direction) {
|
|
1725
|
-
case "left":
|
|
1726
|
-
return styles.slideInLeft;
|
|
1727
|
-
case "right":
|
|
1728
|
-
return styles.slideInRight;
|
|
1729
|
-
case "top":
|
|
1730
|
-
return styles.slideInTop;
|
|
1731
|
-
case "bottom":
|
|
1732
|
-
return styles.slideInBottom;
|
|
1733
|
-
default:
|
|
1734
|
-
return styles.slideInRight;
|
|
1735
|
-
}
|
|
1736
|
-
}
|
|
1737
|
-
return styles.fadeIn;
|
|
1738
|
-
})();
|
|
1739
|
-
if (!isOpen) return null;
|
|
1987
|
+
if (!isOpen && !isClosing) return null;
|
|
1740
1988
|
return createPortal(
|
|
1741
1989
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1742
1990
|
/* @__PURE__ */ jsx(
|
|
1743
1991
|
"div",
|
|
1744
1992
|
{
|
|
1745
|
-
|
|
1746
|
-
|
|
1993
|
+
ref: !isEditor ? animationTargetRef : null,
|
|
1994
|
+
className: cn(classes.background, isClosing ? backdropDisappearClass : backdropAppearClass, { [classes.editor]: isEditor }),
|
|
1995
|
+
style: {
|
|
1996
|
+
...backdropStyles,
|
|
1997
|
+
...animationFinished && !isEditor && !isClosing ? { position: "absolute" } : {}
|
|
1998
|
+
}
|
|
1747
1999
|
}
|
|
1748
2000
|
),
|
|
1749
|
-
/* @__PURE__ */
|
|
2001
|
+
/* @__PURE__ */ jsxs(
|
|
1750
2002
|
"div",
|
|
1751
2003
|
{
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
"
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
...restStyles,
|
|
1796
|
-
"--position-transform": transform || "none"
|
|
1797
|
-
};
|
|
1798
|
-
})() : positionStyles;
|
|
1799
|
-
return /* @__PURE__ */ jsx(SplideSlide, { children: /* @__PURE__ */ jsx(
|
|
1800
|
-
"div",
|
|
1801
|
-
{
|
|
1802
|
-
className: styles.imgWrapper,
|
|
1803
|
-
onClick: handleImageWrapperClick,
|
|
1804
|
-
style: {
|
|
1805
|
-
padding: `${layout.padding.top}px ${layout.padding.right}px ${layout.padding.bottom}px ${layout.padding.left}px`
|
|
1806
|
-
},
|
|
1807
|
-
children: /* @__PURE__ */ jsx(
|
|
1808
|
-
"img",
|
|
1809
|
-
{
|
|
1810
|
-
className: cn(styles.imageStyle, {
|
|
1811
|
-
[styles.contain]: item.image.objectFit === "contain",
|
|
1812
|
-
[styles.cover]: item.image.objectFit === "cover",
|
|
1813
|
-
[styles.scaleSlide]: slider.type === "scale"
|
|
1814
|
-
}),
|
|
1815
|
-
src: item.image.url,
|
|
1816
|
-
alt: item.image.name ?? "",
|
|
1817
|
-
onClick: onImageClick,
|
|
1818
|
-
style: imageStyle2
|
|
1819
|
-
}
|
|
1820
|
-
)
|
|
1821
|
-
}
|
|
1822
|
-
) }, index);
|
|
1823
|
-
})
|
|
1824
|
-
}
|
|
1825
|
-
),
|
|
1826
|
-
controls.isActive && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1827
|
-
/* @__PURE__ */ jsx(
|
|
1828
|
-
"div",
|
|
2004
|
+
ref: isEditor ? animationTargetRef : null,
|
|
2005
|
+
className: cn(classes.contentStyle, !isClosing ? appearClass : disappearClass, { [classes.editor]: isEditor }),
|
|
2006
|
+
style: {
|
|
2007
|
+
animationDuration: `${parseInt(appear.duration)}ms`,
|
|
2008
|
+
animationTimingFunction: "ease",
|
|
2009
|
+
animationFillMode: "both"
|
|
2010
|
+
},
|
|
2011
|
+
children: [
|
|
2012
|
+
/* @__PURE__ */ jsx(
|
|
2013
|
+
Splide,
|
|
2014
|
+
{
|
|
2015
|
+
onMove: (splide) => setCurrentIndex(splide.index),
|
|
2016
|
+
ref: lightboxRef,
|
|
2017
|
+
className: classes.lightboxSplide,
|
|
2018
|
+
options: {
|
|
2019
|
+
arrows: false,
|
|
2020
|
+
speed: slider.duration ? parseInt(slider.duration) : 500,
|
|
2021
|
+
direction: slider.direction === "horiz" || slider.type === "fade" || slider.type === "scale" ? "ltr" : "ttb",
|
|
2022
|
+
pagination: false,
|
|
2023
|
+
drag: triggers.type === "drag",
|
|
2024
|
+
perPage: 1,
|
|
2025
|
+
width: "100%",
|
|
2026
|
+
height: "100%",
|
|
2027
|
+
type: slider.type === "fade" || slider.type === "scale" ? "fade" : "loop",
|
|
2028
|
+
padding: 0,
|
|
2029
|
+
rewind: (slider.type === "scale" || slider.type === "fade") && triggers.repeat === "loop"
|
|
2030
|
+
},
|
|
2031
|
+
style: { "--splide-speed": slider.duration },
|
|
2032
|
+
children: content.map((item, index) => {
|
|
2033
|
+
const positionStyles = getPositionStyles(layout.position, layout.offset, isEditor);
|
|
2034
|
+
const padding = `${scalingValue(layout.padding.top, isEditor)} ${scalingValue(layout.padding.right, isEditor)} ${scalingValue(layout.padding.bottom, isEditor)} ${scalingValue(layout.padding.left, isEditor)}`;
|
|
2035
|
+
const imageStyle2 = slider.type === "scale" ? (() => {
|
|
2036
|
+
const { transform, ...restStyles } = positionStyles;
|
|
2037
|
+
return {
|
|
2038
|
+
...restStyles,
|
|
2039
|
+
position: "absolute",
|
|
2040
|
+
padding,
|
|
2041
|
+
boxSizing: "border-box",
|
|
2042
|
+
"--position-transform": transform || "none"
|
|
2043
|
+
};
|
|
2044
|
+
})() : { ...positionStyles, position: "absolute", padding, boxSizing: "border-box" };
|
|
2045
|
+
return /* @__PURE__ */ jsx(SplideSlide, { children: /* @__PURE__ */ jsx("div", { className: classes.imgWrapper, onClick: handleImageWrapperClick, children: /* @__PURE__ */ jsx(
|
|
2046
|
+
"img",
|
|
1829
2047
|
{
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
"
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
handleArrowClick("-1");
|
|
1841
|
-
},
|
|
1842
|
-
children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
|
|
1843
|
-
SvgImage,
|
|
1844
|
-
{
|
|
1845
|
-
url: controls.arrowsImgUrl,
|
|
1846
|
-
fill: controls.color,
|
|
1847
|
-
hoverFill: controls.hover,
|
|
1848
|
-
className: cn(styles.arrowImg, styles.mirror)
|
|
1849
|
-
}
|
|
1850
|
-
)
|
|
1851
|
-
}
|
|
1852
|
-
)
|
|
2048
|
+
ref: index === currentIndex ? imageRef : null,
|
|
2049
|
+
className: cn(classes.imageStyle, {
|
|
2050
|
+
[classes.contain]: item.image.objectFit === "contain",
|
|
2051
|
+
[classes.cover]: item.image.objectFit === "cover",
|
|
2052
|
+
[classes.scaleSlide]: slider.type === "scale"
|
|
2053
|
+
}),
|
|
2054
|
+
onClick: item.image.objectFit !== "contain" ? onImageClick : void 0,
|
|
2055
|
+
src: item.image.url,
|
|
2056
|
+
alt: item.image.name ?? "",
|
|
2057
|
+
style: { ...imageStyle2, pointerEvents: item.image.objectFit === "contain" ? "none" : "auto" }
|
|
1853
2058
|
}
|
|
1854
|
-
),
|
|
1855
|
-
|
|
1856
|
-
|
|
2059
|
+
) }) }, index);
|
|
2060
|
+
})
|
|
2061
|
+
},
|
|
2062
|
+
splideKey
|
|
2063
|
+
),
|
|
2064
|
+
controls.isActive && controls.arrowsImgUrl && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2065
|
+
/* @__PURE__ */ jsx(
|
|
2066
|
+
"div",
|
|
2067
|
+
{
|
|
2068
|
+
className: cn(classes.arrow, { [classes.arrowVertical]: slider.direction === "vert" }),
|
|
2069
|
+
style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
|
|
2070
|
+
children: /* @__PURE__ */ jsx(
|
|
2071
|
+
"button",
|
|
1857
2072
|
{
|
|
1858
|
-
className:
|
|
1859
|
-
style: {
|
|
1860
|
-
|
|
1861
|
-
|
|
2073
|
+
className: classes.arrowInner,
|
|
2074
|
+
style: { transform: `translate(${scalingValue(controls.offset.x, isEditor)}, ${scalingValue(controls.offset.y * (slider.direction === "horiz" ? 1 : -1), isEditor)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})` },
|
|
2075
|
+
onClick: () => {
|
|
2076
|
+
var _a;
|
|
2077
|
+
return (_a = lightboxRef.current) == null ? void 0 : _a.go("-1");
|
|
2078
|
+
},
|
|
2079
|
+
"aria-label": "Previous",
|
|
2080
|
+
children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
|
|
2081
|
+
SvgImage,
|
|
1862
2082
|
{
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
onClick: (e) => {
|
|
1868
|
-
handleArrowClick("+1");
|
|
1869
|
-
},
|
|
1870
|
-
"aria-label": "Next",
|
|
1871
|
-
children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
|
|
1872
|
-
SvgImage,
|
|
1873
|
-
{
|
|
1874
|
-
url: controls.arrowsImgUrl,
|
|
1875
|
-
fill: controls.color,
|
|
1876
|
-
hoverFill: controls.hover,
|
|
1877
|
-
className: styles.arrowImg
|
|
1878
|
-
}
|
|
1879
|
-
)
|
|
2083
|
+
url: controls.arrowsImgUrl,
|
|
2084
|
+
fill: controls.color,
|
|
2085
|
+
hoverFill: controls.hover,
|
|
2086
|
+
className: cn(classes.arrowImg, classes.mirror)
|
|
1880
2087
|
}
|
|
1881
2088
|
)
|
|
1882
2089
|
}
|
|
1883
2090
|
)
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
2091
|
+
}
|
|
2092
|
+
),
|
|
2093
|
+
/* @__PURE__ */ jsx(
|
|
2094
|
+
"div",
|
|
2095
|
+
{
|
|
2096
|
+
className: cn(classes.arrow, classes.nextArrow, { [classes.arrowVertical]: slider.direction === "vert" }),
|
|
2097
|
+
style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
|
|
2098
|
+
children: /* @__PURE__ */ jsx(
|
|
1890
2099
|
"button",
|
|
1891
2100
|
{
|
|
1892
|
-
className:
|
|
1893
|
-
style: {
|
|
1894
|
-
|
|
1895
|
-
|
|
2101
|
+
className: classes.arrowInner,
|
|
2102
|
+
style: { transform: `translate(${scalingValue(controls.offset.x * (slider.direction === "horiz" ? -1 : 1), isEditor)}, ${scalingValue(controls.offset.y, isEditor)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})` },
|
|
2103
|
+
onClick: () => {
|
|
2104
|
+
var _a;
|
|
2105
|
+
return (_a = lightboxRef.current) == null ? void 0 : _a.go("+1");
|
|
1896
2106
|
},
|
|
1897
|
-
|
|
1898
|
-
children: /* @__PURE__ */ jsx(
|
|
2107
|
+
"aria-label": "Next",
|
|
2108
|
+
children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
|
|
2109
|
+
SvgImage,
|
|
2110
|
+
{
|
|
2111
|
+
url: controls.arrowsImgUrl,
|
|
2112
|
+
fill: controls.color,
|
|
2113
|
+
hoverFill: controls.hover,
|
|
2114
|
+
className: classes.arrowImg
|
|
2115
|
+
}
|
|
2116
|
+
)
|
|
1899
2117
|
}
|
|
1900
|
-
)
|
|
1901
|
-
}
|
|
1902
|
-
|
|
2118
|
+
)
|
|
2119
|
+
}
|
|
2120
|
+
)
|
|
2121
|
+
] }),
|
|
2122
|
+
area.closeIconUrl && (() => {
|
|
2123
|
+
const positionStyles = getPositionStyles(area.closeIconAlign, area.closeIconOffset, isEditor);
|
|
2124
|
+
const scaleTransform = `scale(${area.closeIconScale})`;
|
|
2125
|
+
const combinedTransform = positionStyles.transform ? `${positionStyles.transform} ${scaleTransform}` : scaleTransform;
|
|
2126
|
+
return /* @__PURE__ */ jsx("button", { className: classes.closeButton, style: { ...positionStyles, transform: combinedTransform }, onClick: handleClose, "aria-label": "Close lightbox", children: /* @__PURE__ */ jsx(SvgImage, { url: area.closeIconUrl }) });
|
|
2127
|
+
})(),
|
|
2128
|
+
caption2.isActive && /* @__PURE__ */ jsx(
|
|
2129
|
+
"div",
|
|
2130
|
+
{
|
|
2131
|
+
className: classes.caption,
|
|
2132
|
+
style: {
|
|
2133
|
+
...getPositionStyles(caption2.alignment, caption2.offset, isEditor),
|
|
2134
|
+
fontFamily: fontSettings.fontFamily,
|
|
2135
|
+
fontWeight: fontSettings.fontWeight,
|
|
2136
|
+
fontStyle: fontSettings.fontStyle,
|
|
2137
|
+
width: widthSettings.sizing === "auto" ? "max-content" : scalingValue(widthSettings.width, isEditor),
|
|
2138
|
+
letterSpacing: scalingValue(letterSpacing, isEditor),
|
|
2139
|
+
wordSpacing: scalingValue(wordSpacing, isEditor),
|
|
2140
|
+
textAlign,
|
|
2141
|
+
fontSize: scalingValue(fontSizeLineHeight.fontSize, isEditor),
|
|
2142
|
+
lineHeight: scalingValue(fontSizeLineHeight.lineHeight, isEditor),
|
|
2143
|
+
textTransform: textAppearance.textTransform ?? "none",
|
|
2144
|
+
textDecoration: textAppearance.textDecoration ?? "none",
|
|
2145
|
+
fontVariant: textAppearance.fontVariant ?? "normal",
|
|
2146
|
+
color
|
|
2147
|
+
},
|
|
2148
|
+
onClick: (e) => e.stopPropagation(),
|
|
2149
|
+
children: /* @__PURE__ */ jsx(
|
|
1903
2150
|
"div",
|
|
1904
2151
|
{
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
["--link-hover-color"]: caption2.hover
|
|
1909
|
-
},
|
|
2152
|
+
"data-styles": "caption",
|
|
2153
|
+
className: classes.captionTextInner,
|
|
2154
|
+
style: { ["--link-hover-color"]: caption2.hover },
|
|
1910
2155
|
children: /* @__PURE__ */ jsx(RichTextRenderer, { content: content[currentIndex].imageCaption })
|
|
1911
2156
|
}
|
|
1912
|
-
)
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
2157
|
+
)
|
|
2158
|
+
}
|
|
2159
|
+
),
|
|
2160
|
+
thumbnail.isActive && /* @__PURE__ */ jsx(
|
|
2161
|
+
"div",
|
|
2162
|
+
{
|
|
2163
|
+
className: cn(classes.thumbsContainer, {
|
|
2164
|
+
[classes.thumbsContainerVertical]: slider.direction === "vert",
|
|
2165
|
+
[classes.thumbsAlignStart]: thumbnail.align === "start",
|
|
2166
|
+
[classes.thumbsAlignCenter]: thumbnail.align === "center",
|
|
2167
|
+
[classes.thumbsAlignEnd]: thumbnail.align === "end"
|
|
2168
|
+
}),
|
|
2169
|
+
style: {
|
|
2170
|
+
position: isEditor ? "absolute" : "fixed",
|
|
2171
|
+
gap: scalingValue(thumbnail.grid.gap, isEditor),
|
|
2172
|
+
...getPositionStyles(thumbnail.position, thumbnail.offset, isEditor)
|
|
2173
|
+
},
|
|
2174
|
+
children: content.map((item, index) => {
|
|
2175
|
+
const isActive = index === currentIndex;
|
|
2176
|
+
const thumbDims = thumbnailDimensions[index];
|
|
2177
|
+
const baseSizeValue = thumbnail.grid.size;
|
|
2178
|
+
const activeSizeValue = baseSizeValue * (isActive ? thumbnail.activeState.scale : 1);
|
|
2179
|
+
const getFitDimensions = () => {
|
|
2180
|
+
if (thumbnail.fit !== "fit" || !thumbDims) return {};
|
|
2181
|
+
const aspectRatio = thumbDims.width / thumbDims.height;
|
|
2182
|
+
if (slider.direction === "horiz") {
|
|
2183
|
+
const heightValue = activeSizeValue;
|
|
2184
|
+
const widthValue = heightValue * aspectRatio;
|
|
2185
|
+
return {
|
|
2186
|
+
width: scalingValue(widthValue, isEditor),
|
|
2187
|
+
height: scalingValue(heightValue, isEditor)
|
|
2188
|
+
};
|
|
2189
|
+
} else {
|
|
2190
|
+
const widthValue = activeSizeValue;
|
|
2191
|
+
const heightValue = widthValue / aspectRatio;
|
|
2192
|
+
return {
|
|
2193
|
+
width: scalingValue(widthValue, isEditor),
|
|
2194
|
+
height: scalingValue(heightValue, isEditor)
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
};
|
|
2198
|
+
return /* @__PURE__ */ jsx(
|
|
2199
|
+
"button",
|
|
2200
|
+
{
|
|
2201
|
+
className: classes.thumbItem,
|
|
2202
|
+
style: {
|
|
2203
|
+
...slider.direction === "horiz" && thumbnail.fit !== "fit" ? { height: scalingValue(activeSizeValue, isEditor) } : {},
|
|
2204
|
+
...slider.direction === "vert" && thumbnail.fit !== "fit" ? { width: scalingValue(activeSizeValue, isEditor) } : {},
|
|
2205
|
+
...thumbnail.fit === "cover" ? { width: scalingValue(activeSizeValue, isEditor), height: scalingValue(activeSizeValue, isEditor) } : {},
|
|
2206
|
+
...thumbnail.fit === "fit" ? getFitDimensions() : {},
|
|
2207
|
+
transition: isActive ? "all 0.2s ease" : "none",
|
|
2208
|
+
opacity: isActive ? thumbnail.activeState.opacity / 100 : thumbnail.opacity / 100,
|
|
2209
|
+
["--thumb-hover"]: thumbnail.activeState.opacity / 100
|
|
2210
|
+
},
|
|
2211
|
+
onClick: (e) => {
|
|
2212
|
+
var _a;
|
|
2213
|
+
e.stopPropagation();
|
|
2214
|
+
setCurrentIndex(index);
|
|
2215
|
+
(_a = lightboxRef.current) == null ? void 0 : _a.go(index);
|
|
2216
|
+
},
|
|
2217
|
+
onMouseEnter: () => {
|
|
2218
|
+
var _a;
|
|
2219
|
+
if (thumbnail.triggers === "hov") {
|
|
2220
|
+
(_a = lightboxRef.current) == null ? void 0 : _a.go(index);
|
|
2221
|
+
}
|
|
2222
|
+
},
|
|
2223
|
+
children: /* @__PURE__ */ jsx(
|
|
2224
|
+
"img",
|
|
1935
2225
|
{
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
var _a;
|
|
1946
|
-
e.stopPropagation();
|
|
1947
|
-
setCurrentIndex(index);
|
|
1948
|
-
(_a = lightboxRef.current) == null ? void 0 : _a.go(index);
|
|
1949
|
-
},
|
|
1950
|
-
children: /* @__PURE__ */ jsx(
|
|
1951
|
-
"img",
|
|
1952
|
-
{
|
|
1953
|
-
src: item.image.url,
|
|
1954
|
-
alt: item.image.name ?? "",
|
|
1955
|
-
className: styles.thumbImage,
|
|
1956
|
-
style: {
|
|
1957
|
-
objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
|
|
1958
|
-
...thumbnail.fit === "fit" && slider.direction === "horiz" ? { width: "fit-content" } : {},
|
|
1959
|
-
...thumbnail.fit === "fit" && slider.direction === "vert" ? { height: "fit-content" } : {},
|
|
1960
|
-
...slider.direction === "horiz" ? { height: "100%" } : {},
|
|
1961
|
-
...slider.direction === "vert" ? { width: "100%" } : {}
|
|
1962
|
-
}
|
|
2226
|
+
src: item.image.url,
|
|
2227
|
+
alt: item.image.name ?? "",
|
|
2228
|
+
onLoad: (e) => {
|
|
2229
|
+
const img2 = e.currentTarget;
|
|
2230
|
+
if (img2.naturalWidth && img2.naturalHeight) {
|
|
2231
|
+
setThumbnailDimensions((prev) => ({
|
|
2232
|
+
...prev,
|
|
2233
|
+
[index]: { width: img2.naturalWidth, height: img2.naturalHeight }
|
|
2234
|
+
}));
|
|
1963
2235
|
}
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
2236
|
+
},
|
|
2237
|
+
style: {
|
|
2238
|
+
objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
|
|
2239
|
+
...thumbnail.fit === "fit" ? { maxWidth: "100%", maxHeight: "100%", objectFit: "contain" } : {},
|
|
2240
|
+
...thumbnail.fit === "cover" && slider.direction === "horiz" ? { width: "100%", height: "100%" } : {}
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
)
|
|
2244
|
+
},
|
|
2245
|
+
`${item.image.name}-${index}`
|
|
2246
|
+
);
|
|
2247
|
+
})
|
|
2248
|
+
}
|
|
2249
|
+
)
|
|
2250
|
+
]
|
|
1974
2251
|
}
|
|
1975
2252
|
)
|
|
1976
2253
|
] }),
|
|
@@ -1983,11 +2260,11 @@ const LightboxComponent = {
|
|
|
1983
2260
|
name: "Lightbox",
|
|
1984
2261
|
preview: {
|
|
1985
2262
|
type: "video",
|
|
1986
|
-
url: "https://cdn.cntrl.site/
|
|
2263
|
+
url: "https://cdn.cntrl.site/component-assets/lightbox.mp4"
|
|
1987
2264
|
},
|
|
1988
2265
|
defaultSize: {
|
|
1989
|
-
width:
|
|
1990
|
-
height:
|
|
2266
|
+
width: 440,
|
|
2267
|
+
height: 550
|
|
1991
2268
|
},
|
|
1992
2269
|
schema: {
|
|
1993
2270
|
type: "object",
|
|
@@ -2012,7 +2289,7 @@ const LightboxComponent = {
|
|
|
2012
2289
|
url: {
|
|
2013
2290
|
type: "string",
|
|
2014
2291
|
display: {
|
|
2015
|
-
type: "
|
|
2292
|
+
type: "cover-image-input"
|
|
2016
2293
|
}
|
|
2017
2294
|
}
|
|
2018
2295
|
}
|
|
@@ -2054,14 +2331,6 @@ const LightboxComponent = {
|
|
|
2054
2331
|
type: "direction-control"
|
|
2055
2332
|
},
|
|
2056
2333
|
enum: ["top", "left", "right", "bottom"]
|
|
2057
|
-
},
|
|
2058
|
-
repeat: {
|
|
2059
|
-
type: "string",
|
|
2060
|
-
title: "Repeat",
|
|
2061
|
-
display: {
|
|
2062
|
-
type: "ratio-group"
|
|
2063
|
-
},
|
|
2064
|
-
enum: ["close", "loop"]
|
|
2065
2334
|
}
|
|
2066
2335
|
}
|
|
2067
2336
|
},
|
|
@@ -2085,13 +2354,14 @@ const LightboxComponent = {
|
|
|
2085
2354
|
},
|
|
2086
2355
|
enum: ["image", "50/50"]
|
|
2087
2356
|
},
|
|
2088
|
-
|
|
2357
|
+
repeat: {
|
|
2089
2358
|
type: "string",
|
|
2090
|
-
|
|
2359
|
+
title: "Repeat",
|
|
2091
2360
|
display: {
|
|
2092
|
-
|
|
2361
|
+
visible: false,
|
|
2362
|
+
type: "ratio-group"
|
|
2093
2363
|
},
|
|
2094
|
-
enum: ["
|
|
2364
|
+
enum: ["close", "loop"]
|
|
2095
2365
|
}
|
|
2096
2366
|
}
|
|
2097
2367
|
},
|
|
@@ -2114,6 +2384,14 @@ const LightboxComponent = {
|
|
|
2114
2384
|
type: "ratio-group"
|
|
2115
2385
|
},
|
|
2116
2386
|
enum: ["horiz", "vert"]
|
|
2387
|
+
},
|
|
2388
|
+
duration: {
|
|
2389
|
+
type: "string",
|
|
2390
|
+
label: "T",
|
|
2391
|
+
display: {
|
|
2392
|
+
type: "step-selector"
|
|
2393
|
+
},
|
|
2394
|
+
enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
|
|
2117
2395
|
}
|
|
2118
2396
|
}
|
|
2119
2397
|
},
|
|
@@ -2168,25 +2446,20 @@ const LightboxComponent = {
|
|
|
2168
2446
|
type: "group"
|
|
2169
2447
|
},
|
|
2170
2448
|
properties: {
|
|
2171
|
-
|
|
2449
|
+
size: {
|
|
2172
2450
|
type: "number",
|
|
2173
|
-
label: "
|
|
2451
|
+
label: "Box",
|
|
2452
|
+
scalingEnabled: true,
|
|
2174
2453
|
display: {
|
|
2175
2454
|
type: "numeric-input",
|
|
2176
2455
|
visible: true
|
|
2177
2456
|
}
|
|
2178
2457
|
},
|
|
2179
|
-
width: {
|
|
2180
|
-
type: "number",
|
|
2181
|
-
label: "W",
|
|
2182
|
-
display: {
|
|
2183
|
-
type: "numeric-input",
|
|
2184
|
-
visible: false
|
|
2185
|
-
}
|
|
2186
|
-
},
|
|
2187
2458
|
gap: {
|
|
2188
2459
|
type: "number",
|
|
2189
2460
|
label: "Gap",
|
|
2461
|
+
scalingEnabled: true,
|
|
2462
|
+
min: 0,
|
|
2190
2463
|
display: {
|
|
2191
2464
|
type: "numeric-input"
|
|
2192
2465
|
}
|
|
@@ -2195,15 +2468,28 @@ const LightboxComponent = {
|
|
|
2195
2468
|
},
|
|
2196
2469
|
offset: {
|
|
2197
2470
|
type: "object",
|
|
2471
|
+
title: "Offset",
|
|
2198
2472
|
display: {
|
|
2199
|
-
type: "
|
|
2473
|
+
type: "group"
|
|
2200
2474
|
},
|
|
2201
2475
|
properties: {
|
|
2202
2476
|
x: {
|
|
2203
|
-
type: "number"
|
|
2477
|
+
type: "number",
|
|
2478
|
+
label: "X",
|
|
2479
|
+
scalingEnabled: true,
|
|
2480
|
+
display: {
|
|
2481
|
+
type: "numeric-input",
|
|
2482
|
+
visible: true
|
|
2483
|
+
}
|
|
2204
2484
|
},
|
|
2205
2485
|
y: {
|
|
2206
|
-
type: "number"
|
|
2486
|
+
type: "number",
|
|
2487
|
+
label: "Y",
|
|
2488
|
+
scalingEnabled: true,
|
|
2489
|
+
display: {
|
|
2490
|
+
type: "numeric-input",
|
|
2491
|
+
visible: true
|
|
2492
|
+
}
|
|
2207
2493
|
}
|
|
2208
2494
|
}
|
|
2209
2495
|
},
|
|
@@ -2228,7 +2514,7 @@ const LightboxComponent = {
|
|
|
2228
2514
|
scale: {
|
|
2229
2515
|
type: "number",
|
|
2230
2516
|
title: "Scale",
|
|
2231
|
-
min:
|
|
2517
|
+
min: 1,
|
|
2232
2518
|
max: 5,
|
|
2233
2519
|
step: 0.1,
|
|
2234
2520
|
display: {
|
|
@@ -2265,15 +2551,28 @@ const LightboxComponent = {
|
|
|
2265
2551
|
},
|
|
2266
2552
|
offset: {
|
|
2267
2553
|
type: "object",
|
|
2554
|
+
title: "Offset",
|
|
2268
2555
|
display: {
|
|
2269
|
-
type: "
|
|
2556
|
+
type: "group"
|
|
2270
2557
|
},
|
|
2271
2558
|
properties: {
|
|
2272
2559
|
x: {
|
|
2273
|
-
type: "number"
|
|
2560
|
+
type: "number",
|
|
2561
|
+
label: "X",
|
|
2562
|
+
scalingEnabled: true,
|
|
2563
|
+
display: {
|
|
2564
|
+
type: "numeric-input",
|
|
2565
|
+
visible: true
|
|
2566
|
+
}
|
|
2274
2567
|
},
|
|
2275
2568
|
y: {
|
|
2276
|
-
type: "number"
|
|
2569
|
+
type: "number",
|
|
2570
|
+
label: "Y",
|
|
2571
|
+
scalingEnabled: true,
|
|
2572
|
+
display: {
|
|
2573
|
+
type: "numeric-input",
|
|
2574
|
+
visible: true
|
|
2575
|
+
}
|
|
2277
2576
|
}
|
|
2278
2577
|
}
|
|
2279
2578
|
},
|
|
@@ -2285,15 +2584,23 @@ const LightboxComponent = {
|
|
|
2285
2584
|
},
|
|
2286
2585
|
properties: {
|
|
2287
2586
|
top: {
|
|
2587
|
+
min: 0,
|
|
2588
|
+
step: 1,
|
|
2288
2589
|
type: "number"
|
|
2289
2590
|
},
|
|
2290
2591
|
left: {
|
|
2592
|
+
min: 0,
|
|
2593
|
+
step: 1,
|
|
2291
2594
|
type: "number"
|
|
2292
2595
|
},
|
|
2293
2596
|
right: {
|
|
2597
|
+
min: 0,
|
|
2598
|
+
step: 1,
|
|
2294
2599
|
type: "number"
|
|
2295
2600
|
},
|
|
2296
2601
|
bottom: {
|
|
2602
|
+
min: 0,
|
|
2603
|
+
step: 1,
|
|
2297
2604
|
type: "number"
|
|
2298
2605
|
}
|
|
2299
2606
|
}
|
|
@@ -2319,16 +2626,29 @@ const LightboxComponent = {
|
|
|
2319
2626
|
}
|
|
2320
2627
|
},
|
|
2321
2628
|
offset: {
|
|
2629
|
+
title: "Offset",
|
|
2322
2630
|
type: "object",
|
|
2323
2631
|
display: {
|
|
2324
|
-
type: "
|
|
2632
|
+
type: "group"
|
|
2325
2633
|
},
|
|
2326
2634
|
properties: {
|
|
2327
2635
|
x: {
|
|
2328
|
-
type: "number"
|
|
2636
|
+
type: "number",
|
|
2637
|
+
label: "X",
|
|
2638
|
+
scalingEnabled: true,
|
|
2639
|
+
display: {
|
|
2640
|
+
type: "numeric-input",
|
|
2641
|
+
visible: true
|
|
2642
|
+
}
|
|
2329
2643
|
},
|
|
2330
2644
|
y: {
|
|
2331
|
-
type: "number"
|
|
2645
|
+
type: "number",
|
|
2646
|
+
label: "Y",
|
|
2647
|
+
scalingEnabled: true,
|
|
2648
|
+
display: {
|
|
2649
|
+
type: "numeric-input",
|
|
2650
|
+
visible: true
|
|
2651
|
+
}
|
|
2332
2652
|
}
|
|
2333
2653
|
}
|
|
2334
2654
|
},
|
|
@@ -2407,15 +2727,28 @@ const LightboxComponent = {
|
|
|
2407
2727
|
},
|
|
2408
2728
|
closeIconOffset: {
|
|
2409
2729
|
type: "object",
|
|
2730
|
+
title: "Offset",
|
|
2410
2731
|
display: {
|
|
2411
|
-
type: "
|
|
2732
|
+
type: "group"
|
|
2412
2733
|
},
|
|
2413
2734
|
properties: {
|
|
2414
2735
|
x: {
|
|
2415
|
-
type: "number"
|
|
2736
|
+
type: "number",
|
|
2737
|
+
label: "X",
|
|
2738
|
+
scalingEnabled: true,
|
|
2739
|
+
display: {
|
|
2740
|
+
type: "numeric-input",
|
|
2741
|
+
visible: true
|
|
2742
|
+
}
|
|
2416
2743
|
},
|
|
2417
2744
|
y: {
|
|
2418
|
-
type: "number"
|
|
2745
|
+
type: "number",
|
|
2746
|
+
label: "Y",
|
|
2747
|
+
scalingEnabled: true,
|
|
2748
|
+
display: {
|
|
2749
|
+
type: "numeric-input",
|
|
2750
|
+
visible: true
|
|
2751
|
+
}
|
|
2419
2752
|
}
|
|
2420
2753
|
}
|
|
2421
2754
|
}
|
|
@@ -2441,21 +2774,34 @@ const LightboxComponent = {
|
|
|
2441
2774
|
enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
|
|
2442
2775
|
},
|
|
2443
2776
|
offset: {
|
|
2777
|
+
title: "Offset",
|
|
2444
2778
|
type: "object",
|
|
2445
2779
|
display: {
|
|
2446
|
-
type: "
|
|
2780
|
+
type: "group"
|
|
2447
2781
|
},
|
|
2448
2782
|
properties: {
|
|
2449
2783
|
x: {
|
|
2450
|
-
type: "number"
|
|
2784
|
+
type: "number",
|
|
2785
|
+
label: "X",
|
|
2786
|
+
scalingEnabled: true,
|
|
2787
|
+
display: {
|
|
2788
|
+
type: "numeric-input",
|
|
2789
|
+
visible: true
|
|
2790
|
+
}
|
|
2451
2791
|
},
|
|
2452
2792
|
y: {
|
|
2453
|
-
type: "number"
|
|
2793
|
+
type: "number",
|
|
2794
|
+
label: "Y",
|
|
2795
|
+
scalingEnabled: true,
|
|
2796
|
+
display: {
|
|
2797
|
+
type: "numeric-input",
|
|
2798
|
+
visible: true
|
|
2799
|
+
}
|
|
2454
2800
|
}
|
|
2455
2801
|
}
|
|
2456
2802
|
},
|
|
2457
2803
|
hover: {
|
|
2458
|
-
title: "Hover",
|
|
2804
|
+
title: "Link Hover",
|
|
2459
2805
|
type: "string",
|
|
2460
2806
|
display: {
|
|
2461
2807
|
type: "settings-color-picker",
|
|
@@ -2468,71 +2814,208 @@ const LightboxComponent = {
|
|
|
2468
2814
|
}
|
|
2469
2815
|
},
|
|
2470
2816
|
default: {
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2817
|
+
"d": {
|
|
2818
|
+
thumbnailBlock: {
|
|
2819
|
+
cover: {
|
|
2820
|
+
url: "https://cdn.cntrl.site/component-assets/Cover.jpg"
|
|
2821
|
+
}
|
|
2822
|
+
},
|
|
2823
|
+
lightboxBlock: {
|
|
2824
|
+
appear: {
|
|
2825
|
+
type: "slide in",
|
|
2826
|
+
duration: "1000ms",
|
|
2827
|
+
direction: "bottom"
|
|
2828
|
+
},
|
|
2829
|
+
triggers: {
|
|
2830
|
+
type: "click",
|
|
2831
|
+
switch: "image",
|
|
2832
|
+
repeat: "loop"
|
|
2833
|
+
},
|
|
2834
|
+
slider: {
|
|
2835
|
+
type: "slide",
|
|
2836
|
+
direction: "vert",
|
|
2837
|
+
duration: "1000ms"
|
|
2838
|
+
},
|
|
2839
|
+
thumbnail: {
|
|
2840
|
+
isActive: true,
|
|
2841
|
+
position: "middle-left",
|
|
2842
|
+
fit: "fit",
|
|
2843
|
+
align: "start",
|
|
2844
|
+
triggers: "hov",
|
|
2845
|
+
grid: {
|
|
2846
|
+
size: 0.05,
|
|
2847
|
+
gap: 0.01
|
|
2848
|
+
},
|
|
2849
|
+
offset: { x: 0.01, y: 0 },
|
|
2850
|
+
opacity: 50,
|
|
2851
|
+
activeState: {
|
|
2852
|
+
scale: 1,
|
|
2853
|
+
opacity: 100
|
|
2854
|
+
}
|
|
2855
|
+
},
|
|
2856
|
+
layout: {
|
|
2857
|
+
position: "middle-center",
|
|
2858
|
+
offset: { x: 0, y: 0 },
|
|
2859
|
+
padding: { top: 0.06, right: 0, bottom: 0.06, left: 0 }
|
|
2860
|
+
},
|
|
2861
|
+
controls: {
|
|
2862
|
+
isActive: true,
|
|
2863
|
+
arrowsImgUrl: null,
|
|
2864
|
+
offset: { x: 0, y: 0 },
|
|
2865
|
+
scale: 1,
|
|
2866
|
+
color: "#000000",
|
|
2867
|
+
hover: "#cccccc"
|
|
2868
|
+
},
|
|
2869
|
+
area: {
|
|
2870
|
+
color: "rgba(28,31,34,0.9)",
|
|
2871
|
+
blur: 0,
|
|
2872
|
+
closeIconUrl: null,
|
|
2873
|
+
closeIconAlign: "top-right",
|
|
2874
|
+
closeIconOffset: { x: 0, y: 0 },
|
|
2875
|
+
closeIconScale: 1
|
|
2876
|
+
},
|
|
2877
|
+
caption: {
|
|
2878
|
+
isActive: true,
|
|
2879
|
+
alignment: "middle-center",
|
|
2880
|
+
offset: { x: 0, y: 0 },
|
|
2881
|
+
hover: "#cccccc"
|
|
2882
|
+
}
|
|
2474
2883
|
}
|
|
2475
2884
|
},
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
repeat: "close"
|
|
2482
|
-
},
|
|
2483
|
-
triggers: {
|
|
2484
|
-
type: "click",
|
|
2485
|
-
switch: "image",
|
|
2486
|
-
duration: "2000ms"
|
|
2487
|
-
},
|
|
2488
|
-
slider: {
|
|
2489
|
-
type: "fade",
|
|
2490
|
-
direction: "horiz"
|
|
2885
|
+
"m": {
|
|
2886
|
+
thumbnailBlock: {
|
|
2887
|
+
cover: {
|
|
2888
|
+
url: "https://cdn.cntrl.site/component-assets/Cover.jpg"
|
|
2889
|
+
}
|
|
2491
2890
|
},
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
},
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2891
|
+
lightboxBlock: {
|
|
2892
|
+
appear: {
|
|
2893
|
+
type: "fade in",
|
|
2894
|
+
duration: "500ms",
|
|
2895
|
+
direction: "bottom"
|
|
2896
|
+
},
|
|
2897
|
+
triggers: {
|
|
2898
|
+
type: "click",
|
|
2899
|
+
switch: "image",
|
|
2900
|
+
repeat: "loop"
|
|
2901
|
+
},
|
|
2902
|
+
slider: {
|
|
2903
|
+
type: "slide",
|
|
2904
|
+
direction: "horiz",
|
|
2905
|
+
duration: "1000ms"
|
|
2906
|
+
},
|
|
2907
|
+
thumbnail: {
|
|
2908
|
+
isActive: true,
|
|
2909
|
+
position: "bottom-center",
|
|
2910
|
+
fit: "fit",
|
|
2911
|
+
align: "start",
|
|
2912
|
+
triggers: "hov",
|
|
2913
|
+
grid: {
|
|
2914
|
+
size: 0.1,
|
|
2915
|
+
gap: 0.05
|
|
2916
|
+
},
|
|
2917
|
+
offset: { x: 0.01, y: -0.05 },
|
|
2918
|
+
opacity: 50,
|
|
2919
|
+
activeState: {
|
|
2920
|
+
scale: 1,
|
|
2921
|
+
opacity: 100
|
|
2922
|
+
}
|
|
2923
|
+
},
|
|
2924
|
+
layout: {
|
|
2925
|
+
position: "middle-center",
|
|
2926
|
+
offset: { x: 0, y: 0 },
|
|
2927
|
+
padding: { top: 0.06, right: 0.05, bottom: 0.06, left: 0.05 }
|
|
2928
|
+
},
|
|
2929
|
+
controls: {
|
|
2930
|
+
isActive: true,
|
|
2931
|
+
arrowsImgUrl: null,
|
|
2932
|
+
offset: { x: 0, y: 0 },
|
|
2506
2933
|
scale: 1,
|
|
2507
|
-
|
|
2934
|
+
color: "#000000",
|
|
2935
|
+
hover: "#cccccc"
|
|
2936
|
+
},
|
|
2937
|
+
area: {
|
|
2938
|
+
color: "rgba(28,31,34,0.9)",
|
|
2939
|
+
blur: 0,
|
|
2940
|
+
closeIconUrl: null,
|
|
2941
|
+
closeIconAlign: "top-right",
|
|
2942
|
+
closeIconOffset: { x: 0, y: 0 },
|
|
2943
|
+
closeIconScale: 1
|
|
2944
|
+
},
|
|
2945
|
+
caption: {
|
|
2946
|
+
isActive: true,
|
|
2947
|
+
alignment: "middle-center",
|
|
2948
|
+
offset: { x: 0, y: 0 },
|
|
2949
|
+
hover: "#cccccc"
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
},
|
|
2953
|
+
"t": {
|
|
2954
|
+
thumbnailBlock: {
|
|
2955
|
+
cover: {
|
|
2956
|
+
url: "https://cdn.cntrl.site/component-assets/Cover.jpg"
|
|
2508
2957
|
}
|
|
2509
2958
|
},
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2959
|
+
lightboxBlock: {
|
|
2960
|
+
appear: {
|
|
2961
|
+
type: "fade in",
|
|
2962
|
+
duration: "500ms",
|
|
2963
|
+
direction: "bottom"
|
|
2964
|
+
},
|
|
2965
|
+
triggers: {
|
|
2966
|
+
type: "click",
|
|
2967
|
+
switch: "image",
|
|
2968
|
+
repeat: "loop"
|
|
2969
|
+
},
|
|
2970
|
+
slider: {
|
|
2971
|
+
type: "slide",
|
|
2972
|
+
direction: "vert",
|
|
2973
|
+
duration: "1000ms"
|
|
2974
|
+
},
|
|
2975
|
+
thumbnail: {
|
|
2976
|
+
isActive: true,
|
|
2977
|
+
position: "middle-left",
|
|
2978
|
+
fit: "fit",
|
|
2979
|
+
align: "start",
|
|
2980
|
+
triggers: "hov",
|
|
2981
|
+
grid: {
|
|
2982
|
+
size: 0.05,
|
|
2983
|
+
gap: 0.01
|
|
2984
|
+
},
|
|
2985
|
+
offset: { x: 0.03, y: 0 },
|
|
2986
|
+
opacity: 50,
|
|
2987
|
+
activeState: {
|
|
2988
|
+
scale: 1,
|
|
2989
|
+
opacity: 100
|
|
2990
|
+
}
|
|
2991
|
+
},
|
|
2992
|
+
layout: {
|
|
2993
|
+
position: "middle-center",
|
|
2994
|
+
offset: { x: 0, y: 0 },
|
|
2995
|
+
padding: { top: 0.06, right: 0.1, bottom: 0.06, left: 0.1 }
|
|
2996
|
+
},
|
|
2997
|
+
controls: {
|
|
2998
|
+
isActive: true,
|
|
2999
|
+
arrowsImgUrl: null,
|
|
3000
|
+
offset: { x: 0, y: 0 },
|
|
3001
|
+
scale: 1,
|
|
3002
|
+
color: "#000000",
|
|
3003
|
+
hover: "#cccccc"
|
|
3004
|
+
},
|
|
3005
|
+
area: {
|
|
3006
|
+
color: "rgba(28,31,34,0.9)",
|
|
3007
|
+
blur: 0,
|
|
3008
|
+
closeIconUrl: null,
|
|
3009
|
+
closeIconAlign: "top-right",
|
|
3010
|
+
closeIconOffset: { x: 0, y: 0 },
|
|
3011
|
+
closeIconScale: 1
|
|
3012
|
+
},
|
|
3013
|
+
caption: {
|
|
3014
|
+
isActive: true,
|
|
3015
|
+
alignment: "middle-center",
|
|
3016
|
+
offset: { x: 0, y: 0 },
|
|
3017
|
+
hover: "#cccccc"
|
|
3018
|
+
}
|
|
2536
3019
|
}
|
|
2537
3020
|
}
|
|
2538
3021
|
},
|
|
@@ -2557,46 +3040,6 @@ const LightboxComponent = {
|
|
|
2557
3040
|
value: "vertical"
|
|
2558
3041
|
}
|
|
2559
3042
|
},
|
|
2560
|
-
{
|
|
2561
|
-
if: {
|
|
2562
|
-
name: "lightboxBlock.slider.direction",
|
|
2563
|
-
value: "vert"
|
|
2564
|
-
},
|
|
2565
|
-
then: {
|
|
2566
|
-
name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.width.display.visible",
|
|
2567
|
-
value: true
|
|
2568
|
-
}
|
|
2569
|
-
},
|
|
2570
|
-
{
|
|
2571
|
-
if: {
|
|
2572
|
-
name: "lightboxBlock.slider.direction",
|
|
2573
|
-
value: "horiz"
|
|
2574
|
-
},
|
|
2575
|
-
then: {
|
|
2576
|
-
name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.height.display.visible",
|
|
2577
|
-
value: true
|
|
2578
|
-
}
|
|
2579
|
-
},
|
|
2580
|
-
{
|
|
2581
|
-
if: {
|
|
2582
|
-
name: "lightboxBlock.slider.direction",
|
|
2583
|
-
value: "vert"
|
|
2584
|
-
},
|
|
2585
|
-
then: {
|
|
2586
|
-
name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.height.display.visible",
|
|
2587
|
-
value: false
|
|
2588
|
-
}
|
|
2589
|
-
},
|
|
2590
|
-
{
|
|
2591
|
-
if: {
|
|
2592
|
-
name: "lightboxBlock.slider.direction",
|
|
2593
|
-
value: "horiz"
|
|
2594
|
-
},
|
|
2595
|
-
then: {
|
|
2596
|
-
name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.width.display.visible",
|
|
2597
|
-
value: false
|
|
2598
|
-
}
|
|
2599
|
-
},
|
|
2600
3043
|
{
|
|
2601
3044
|
if: {
|
|
2602
3045
|
name: "lightboxBlock.appear.type",
|
|
@@ -2619,42 +3062,32 @@ const LightboxComponent = {
|
|
|
2619
3062
|
},
|
|
2620
3063
|
{
|
|
2621
3064
|
if: {
|
|
2622
|
-
name: "lightboxBlock.
|
|
2623
|
-
value: "
|
|
2624
|
-
},
|
|
2625
|
-
then: {
|
|
2626
|
-
name: "properties.lightboxBlock.properties.triggers.properties.duration.display.visible",
|
|
2627
|
-
value: true
|
|
2628
|
-
}
|
|
2629
|
-
},
|
|
2630
|
-
{
|
|
2631
|
-
if: {
|
|
2632
|
-
name: "lightboxBlock.triggers.type",
|
|
2633
|
-
value: "click"
|
|
3065
|
+
name: "lightboxBlock.slider.type",
|
|
3066
|
+
value: "fade"
|
|
2634
3067
|
},
|
|
2635
3068
|
then: {
|
|
2636
|
-
name: "properties.lightboxBlock.properties.
|
|
2637
|
-
value:
|
|
3069
|
+
name: "properties.lightboxBlock.properties.slider.properties.direction.display.visible",
|
|
3070
|
+
value: false
|
|
2638
3071
|
}
|
|
2639
3072
|
},
|
|
2640
3073
|
{
|
|
2641
3074
|
if: {
|
|
2642
|
-
name: "lightboxBlock.
|
|
2643
|
-
value: "
|
|
3075
|
+
name: "lightboxBlock.slider.type",
|
|
3076
|
+
value: "scale"
|
|
2644
3077
|
},
|
|
2645
3078
|
then: {
|
|
2646
|
-
name: "properties.lightboxBlock.properties.
|
|
3079
|
+
name: "properties.lightboxBlock.properties.slider.properties.direction.display.visible",
|
|
2647
3080
|
value: false
|
|
2648
3081
|
}
|
|
2649
3082
|
},
|
|
2650
3083
|
{
|
|
2651
|
-
if:
|
|
2652
|
-
name: "lightboxBlock.triggers.type",
|
|
2653
|
-
value: "
|
|
2654
|
-
|
|
3084
|
+
if: [
|
|
3085
|
+
{ name: "lightboxBlock.triggers.type", value: "click" },
|
|
3086
|
+
{ name: "lightboxBlock.triggers.switch", value: "image" }
|
|
3087
|
+
],
|
|
2655
3088
|
then: {
|
|
2656
|
-
name: "properties.lightboxBlock.properties.triggers.properties.
|
|
2657
|
-
value:
|
|
3089
|
+
name: "properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",
|
|
3090
|
+
value: true
|
|
2658
3091
|
}
|
|
2659
3092
|
}
|
|
2660
3093
|
]
|
|
@@ -2707,7 +3140,7 @@ const LightboxComponent = {
|
|
|
2707
3140
|
{
|
|
2708
3141
|
image: {
|
|
2709
3142
|
objectFit: "contain",
|
|
2710
|
-
url: "https://cdn.cntrl.site/
|
|
3143
|
+
url: "https://cdn.cntrl.site/component-assets/2.jpg",
|
|
2711
3144
|
name: "Slider-1.png"
|
|
2712
3145
|
},
|
|
2713
3146
|
imageCaption: [
|
|
@@ -2720,7 +3153,7 @@ const LightboxComponent = {
|
|
|
2720
3153
|
{
|
|
2721
3154
|
image: {
|
|
2722
3155
|
objectFit: "contain",
|
|
2723
|
-
url: "https://cdn.cntrl.site/
|
|
3156
|
+
url: "https://cdn.cntrl.site/component-assets/3.jpg",
|
|
2724
3157
|
name: "Slider-2.png"
|
|
2725
3158
|
},
|
|
2726
3159
|
imageCaption: [
|
|
@@ -2733,7 +3166,7 @@ const LightboxComponent = {
|
|
|
2733
3166
|
{
|
|
2734
3167
|
image: {
|
|
2735
3168
|
objectFit: "contain",
|
|
2736
|
-
url: "https://cdn.cntrl.site/
|
|
3169
|
+
url: "https://cdn.cntrl.site/component-assets/4.jpg",
|
|
2737
3170
|
name: "Slider-3.png"
|
|
2738
3171
|
},
|
|
2739
3172
|
imageCaption: [
|