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