@cntrl-site/components 0.0.6 → 0.1.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +2 -2
- package/dist/Components/ControlSlider/ControlSlider.d.ts +1 -1
- package/dist/Components/ControlSlider/ControlSliderComponent.d.ts +18 -20
- package/dist/Components/ImageRevealSlider/ControlImageRevealSliderComponent.d.ts +5 -7
- package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +1 -1
- package/dist/Components/Lightbox/Lightbox.d.ts +96 -0
- package/dist/Components/Lightbox/LightboxComponent.d.ts +2 -0
- package/dist/components.css +1 -1
- package/dist/index.js +1185 -130
- package/dist/index.mjs +1168 -113
- package/package.json +68 -68
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useRef, useMemo } from "react";
|
|
2
|
+
import React, { useState, useEffect, useRef, useMemo } from "react";
|
|
3
3
|
import { Splide, SplideSlide } from "@splidejs/react-splide";
|
|
4
4
|
import cn from "classnames";
|
|
5
|
+
import { createPortal } from "react-dom";
|
|
5
6
|
const wrapper = "ControlSlider-module__wrapper___sHEkd";
|
|
6
7
|
const sliderItem = "ControlSlider-module__sliderItem___QQSkR";
|
|
7
8
|
const sliderImage = "ControlSlider-module__sliderImage___9hRl-";
|
|
8
|
-
const arrow = "ControlSlider-module__arrow___05ghY";
|
|
9
|
-
const arrowVertical = "ControlSlider-module__arrowVertical___tBfVN";
|
|
10
|
-
const nextArrow = "ControlSlider-module__nextArrow___-30Yc";
|
|
11
|
-
const arrowInner = "ControlSlider-module__arrowInner___aEra3";
|
|
9
|
+
const arrow$1 = "ControlSlider-module__arrow___05ghY";
|
|
10
|
+
const arrowVertical$1 = "ControlSlider-module__arrowVertical___tBfVN";
|
|
11
|
+
const nextArrow$1 = "ControlSlider-module__nextArrow___-30Yc";
|
|
12
|
+
const arrowInner$1 = "ControlSlider-module__arrowInner___aEra3";
|
|
12
13
|
const arrowIcon = "ControlSlider-module__arrowIcon___S4ztF";
|
|
13
|
-
const arrowImg = "ControlSlider-module__arrowImg___2dwJW";
|
|
14
|
-
const mirror = "ControlSlider-module__mirror___brd6U";
|
|
14
|
+
const arrowImg$1 = "ControlSlider-module__arrowImg___2dwJW";
|
|
15
|
+
const mirror$1 = "ControlSlider-module__mirror___brd6U";
|
|
15
16
|
const pagination = "ControlSlider-module__pagination___bicLF";
|
|
16
17
|
const paginationInner = "ControlSlider-module__paginationInner___bT-P-";
|
|
17
18
|
const paginationVertical = "ControlSlider-module__paginationVertical___zYqKw";
|
|
@@ -26,7 +27,7 @@ const paginationInsideLeft = "ControlSlider-module__paginationInsideLeft___yOBRZ
|
|
|
26
27
|
const paginationInsideRight = "ControlSlider-module__paginationInsideRight___Rtt3o";
|
|
27
28
|
const paginationOutsideLeft = "ControlSlider-module__paginationOutsideLeft___lahaw";
|
|
28
29
|
const paginationOutsideRight = "ControlSlider-module__paginationOutsideRight___EtuQa";
|
|
29
|
-
const imgWrapper = "ControlSlider-module__imgWrapper___UjEgB";
|
|
30
|
+
const imgWrapper$1 = "ControlSlider-module__imgWrapper___UjEgB";
|
|
30
31
|
const captionBlock = "ControlSlider-module__captionBlock___dJ6-j";
|
|
31
32
|
const captionTextWrapper = "ControlSlider-module__captionTextWrapper___HFlpf";
|
|
32
33
|
const captionText = "ControlSlider-module__captionText___uGBVc";
|
|
@@ -42,19 +43,19 @@ const bottomLeftAlignment = "ControlSlider-module__bottomLeftAlignment___cTP2-";
|
|
|
42
43
|
const bottomCenterAlignment = "ControlSlider-module__bottomCenterAlignment___c54fB";
|
|
43
44
|
const bottomRightAlignment = "ControlSlider-module__bottomRightAlignment___kEwrz";
|
|
44
45
|
const clickOverlay = "ControlSlider-module__clickOverlay___DZA28";
|
|
45
|
-
const contain = "ControlSlider-module__contain___pLyq7";
|
|
46
|
-
const cover = "ControlSlider-module__cover___KdDat";
|
|
47
|
-
const styles$
|
|
46
|
+
const contain$1 = "ControlSlider-module__contain___pLyq7";
|
|
47
|
+
const cover$1 = "ControlSlider-module__cover___KdDat";
|
|
48
|
+
const styles$4 = {
|
|
48
49
|
wrapper,
|
|
49
50
|
sliderItem,
|
|
50
51
|
sliderImage,
|
|
51
|
-
arrow,
|
|
52
|
-
arrowVertical,
|
|
53
|
-
nextArrow,
|
|
54
|
-
arrowInner,
|
|
52
|
+
arrow: arrow$1,
|
|
53
|
+
arrowVertical: arrowVertical$1,
|
|
54
|
+
nextArrow: nextArrow$1,
|
|
55
|
+
arrowInner: arrowInner$1,
|
|
55
56
|
arrowIcon,
|
|
56
|
-
arrowImg,
|
|
57
|
-
mirror,
|
|
57
|
+
arrowImg: arrowImg$1,
|
|
58
|
+
mirror: mirror$1,
|
|
58
59
|
pagination,
|
|
59
60
|
paginationInner,
|
|
60
61
|
paginationVertical,
|
|
@@ -69,7 +70,7 @@ const styles$3 = {
|
|
|
69
70
|
paginationInsideRight,
|
|
70
71
|
paginationOutsideLeft,
|
|
71
72
|
paginationOutsideRight,
|
|
72
|
-
imgWrapper,
|
|
73
|
+
imgWrapper: imgWrapper$1,
|
|
73
74
|
captionBlock,
|
|
74
75
|
captionTextWrapper,
|
|
75
76
|
captionText,
|
|
@@ -85,18 +86,18 @@ const styles$3 = {
|
|
|
85
86
|
bottomCenterAlignment,
|
|
86
87
|
bottomRightAlignment,
|
|
87
88
|
clickOverlay,
|
|
88
|
-
contain,
|
|
89
|
-
cover
|
|
89
|
+
contain: contain$1,
|
|
90
|
+
cover: cover$1
|
|
90
91
|
};
|
|
91
92
|
const link$1 = "RichTextRenderer-module__link___BWeZ2";
|
|
92
|
-
const styles$
|
|
93
|
+
const styles$3 = {
|
|
93
94
|
link: link$1
|
|
94
95
|
};
|
|
95
96
|
const RichTextRenderer = ({ content }) => {
|
|
96
97
|
const getChildren = (children) => {
|
|
97
98
|
return children.map((child, i) => {
|
|
98
99
|
if (child.type === "link") {
|
|
99
|
-
return /* @__PURE__ */ jsx("a", { className: styles$
|
|
100
|
+
return /* @__PURE__ */ jsx("a", { className: styles$3.link, href: child.value, target: child.target, children: getChildren(child.children) }, i);
|
|
100
101
|
}
|
|
101
102
|
return /* @__PURE__ */ jsx("span", { style: getLeafCss(child), children: child.text }, i);
|
|
102
103
|
});
|
|
@@ -125,7 +126,7 @@ function scalingValue(value, isEditor = false) {
|
|
|
125
126
|
}
|
|
126
127
|
const svg = "SvgImage-module__svg___q3xE-";
|
|
127
128
|
const img = "SvgImage-module__img___VsTm-";
|
|
128
|
-
const styles$
|
|
129
|
+
const styles$2 = {
|
|
129
130
|
svg,
|
|
130
131
|
img
|
|
131
132
|
};
|
|
@@ -138,13 +139,13 @@ const SvgImage = ({ url, fill = "#000000", hoverFill = "#CCCCCC", className = ""
|
|
|
138
139
|
}
|
|
139
140
|
}, []);
|
|
140
141
|
if (!url.endsWith(".svg") || !supportsMask) {
|
|
141
|
-
return /* @__PURE__ */ jsx("img", { src: url, alt: "", className: cn(styles$
|
|
142
|
+
return /* @__PURE__ */ jsx("img", { src: url, alt: "", className: cn(styles$2.img, className) });
|
|
142
143
|
}
|
|
143
144
|
return /* @__PURE__ */ jsx(
|
|
144
145
|
"span",
|
|
145
146
|
{
|
|
146
147
|
"data-supports-mask": supportsMask,
|
|
147
|
-
className: cn(styles$
|
|
148
|
+
className: cn(styles$2.svg, className),
|
|
148
149
|
style: {
|
|
149
150
|
"--svg": `url(${url})`,
|
|
150
151
|
"--fill": fill,
|
|
@@ -154,15 +155,15 @@ const SvgImage = ({ url, fill = "#000000", hoverFill = "#CCCCCC", className = ""
|
|
|
154
155
|
);
|
|
155
156
|
};
|
|
156
157
|
const alignmentClassName = {
|
|
157
|
-
"top-left": styles$
|
|
158
|
-
"top-center": styles$
|
|
159
|
-
"top-right": styles$
|
|
160
|
-
"middle-left": styles$
|
|
161
|
-
"middle-center": styles$
|
|
162
|
-
"middle-right": styles$
|
|
163
|
-
"bottom-left": styles$
|
|
164
|
-
"bottom-center": styles$
|
|
165
|
-
"bottom-right": styles$
|
|
158
|
+
"top-left": styles$4.topLeftAlignment,
|
|
159
|
+
"top-center": styles$4.topCenterAlignment,
|
|
160
|
+
"top-right": styles$4.topRightAlignment,
|
|
161
|
+
"middle-left": styles$4.middleLeftAlignment,
|
|
162
|
+
"middle-center": styles$4.middleCenterAlignment,
|
|
163
|
+
"middle-right": styles$4.middleRightAlignment,
|
|
164
|
+
"bottom-left": styles$4.bottomLeftAlignment,
|
|
165
|
+
"bottom-center": styles$4.bottomCenterAlignment,
|
|
166
|
+
"bottom-right": styles$4.bottomRightAlignment
|
|
166
167
|
};
|
|
167
168
|
function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
168
169
|
const [sliderRef, setSliderRef] = useState(null);
|
|
@@ -171,7 +172,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
171
172
|
const [wrapperRef, setWrapperRef] = useState(null);
|
|
172
173
|
const [currentSlideIndex, setCurrentSlideIndex] = useState(0);
|
|
173
174
|
const [key, setKey] = useState(0);
|
|
174
|
-
const { direction, transition, controls, pagination: pagination2, caption, triggers } = settings;
|
|
175
|
+
const { direction, transition, controls, pagination: pagination2, caption: caption2, triggers } = settings;
|
|
175
176
|
const prevSliderTypeRef = useRef(transition.type);
|
|
176
177
|
const { x: controlsOffsetX, y: controlsOffsetY } = settings.controls.offset;
|
|
177
178
|
const handleArrowClick = (dir) => {
|
|
@@ -197,10 +198,10 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
197
198
|
setKey((prev) => prev + 1);
|
|
198
199
|
prevSliderTypeRef.current = transition.type;
|
|
199
200
|
}, [transition.type]);
|
|
200
|
-
return /* @__PURE__ */ jsx("div", { className: cn(styles$
|
|
201
|
+
return /* @__PURE__ */ jsx("div", { className: cn(styles$4.wrapper, { [styles$4.editor]: isEditor }), ref: setWrapperRef, children: /* @__PURE__ */ jsxs(
|
|
201
202
|
"div",
|
|
202
203
|
{
|
|
203
|
-
className: styles$
|
|
204
|
+
className: styles$4.sliderInner,
|
|
204
205
|
style: {
|
|
205
206
|
width: sliderDimensions ? sliderDimensions.width : "100%",
|
|
206
207
|
height: sliderDimensions ? sliderDimensions.height : "100%",
|
|
@@ -210,17 +211,17 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
210
211
|
settings.caption.isActive && /* @__PURE__ */ jsx(
|
|
211
212
|
"div",
|
|
212
213
|
{
|
|
213
|
-
className: cn(styles$
|
|
214
|
+
className: cn(styles$4.captionBlock),
|
|
214
215
|
children: /* @__PURE__ */ jsx(
|
|
215
216
|
"div",
|
|
216
217
|
{
|
|
217
|
-
className: styles$
|
|
218
|
+
className: styles$4.captionTextWrapper,
|
|
218
219
|
children: content.map((item, index) => /* @__PURE__ */ jsx(
|
|
219
220
|
"div",
|
|
220
221
|
{
|
|
221
|
-
className: cn(styles$
|
|
222
|
-
[styles$
|
|
223
|
-
[styles$
|
|
222
|
+
className: cn(styles$4.captionText, alignmentClassName[caption2.alignment], {
|
|
223
|
+
[styles$4.withPointerEvents]: index === currentSlideIndex && isEditor,
|
|
224
|
+
[styles$4.active]: index === currentSlideIndex
|
|
224
225
|
}),
|
|
225
226
|
style: {
|
|
226
227
|
fontFamily: fontSettings.fontFamily,
|
|
@@ -242,12 +243,12 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
242
243
|
"div",
|
|
243
244
|
{
|
|
244
245
|
"data-styles": "caption",
|
|
245
|
-
className: styles$
|
|
246
|
+
className: styles$4.captionTextInner,
|
|
246
247
|
style: {
|
|
247
|
-
"--link-hover-color":
|
|
248
|
+
"--link-hover-color": caption2.hover,
|
|
248
249
|
position: "relative",
|
|
249
|
-
top: scalingValue(
|
|
250
|
-
left: scalingValue(
|
|
250
|
+
top: scalingValue(caption2.offset.y, isEditor),
|
|
251
|
+
left: scalingValue(caption2.offset.x, isEditor)
|
|
251
252
|
},
|
|
252
253
|
children: /* @__PURE__ */ jsx(RichTextRenderer, { content: item.imageCaption })
|
|
253
254
|
}
|
|
@@ -285,17 +286,17 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
285
286
|
children: content.map((item, index) => /* @__PURE__ */ jsx(SplideSlide, { children: /* @__PURE__ */ jsx(
|
|
286
287
|
"div",
|
|
287
288
|
{
|
|
288
|
-
className: styles$
|
|
289
|
+
className: styles$4.sliderItem,
|
|
289
290
|
children: /* @__PURE__ */ jsx(
|
|
290
291
|
"div",
|
|
291
292
|
{
|
|
292
|
-
className: styles$
|
|
293
|
+
className: styles$4.imgWrapper,
|
|
293
294
|
children: /* @__PURE__ */ jsx(
|
|
294
295
|
"img",
|
|
295
296
|
{
|
|
296
|
-
className: cn(styles$
|
|
297
|
-
[styles$
|
|
298
|
-
[styles$
|
|
297
|
+
className: cn(styles$4.sliderImage, {
|
|
298
|
+
[styles$4.contain]: item.image.objectFit === "contain",
|
|
299
|
+
[styles$4.cover]: item.image.objectFit === "cover"
|
|
299
300
|
}),
|
|
300
301
|
src: item.image.url,
|
|
301
302
|
alt: item.image.name ?? ""
|
|
@@ -312,8 +313,8 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
312
313
|
/* @__PURE__ */ jsx(
|
|
313
314
|
"div",
|
|
314
315
|
{
|
|
315
|
-
className: cn(styles$
|
|
316
|
-
[styles$
|
|
316
|
+
className: cn(styles$4.arrow, {
|
|
317
|
+
[styles$4.arrowVertical]: direction === "vert"
|
|
317
318
|
}),
|
|
318
319
|
style: {
|
|
319
320
|
color: controls.color,
|
|
@@ -325,7 +326,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
325
326
|
onClick: () => {
|
|
326
327
|
handleArrowClick("-1");
|
|
327
328
|
},
|
|
328
|
-
className: styles$
|
|
329
|
+
className: styles$4.arrowInner,
|
|
329
330
|
style: {
|
|
330
331
|
transform: `translate(${scalingValue(controlsOffsetX, isEditor)}, ${scalingValue(controlsOffsetY * (direction === "horiz" ? 1 : -1), isEditor)}) scale(${settings.controls.scale / 100}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
|
|
331
332
|
},
|
|
@@ -336,10 +337,10 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
336
337
|
url: controls.arrowsImgUrl,
|
|
337
338
|
fill: controls.color,
|
|
338
339
|
hoverFill: controls.hover,
|
|
339
|
-
className: cn(styles$
|
|
340
|
+
className: cn(styles$4.arrowImg, styles$4.mirror)
|
|
340
341
|
}
|
|
341
342
|
),
|
|
342
|
-
!controls.arrowsImgUrl && /* @__PURE__ */ jsx(ArrowIcon, { color: controls.color, className: cn(styles$
|
|
343
|
+
!controls.arrowsImgUrl && /* @__PURE__ */ jsx(ArrowIcon, { color: controls.color, className: cn(styles$4.arrowIcon, styles$4.arrowImg, styles$4.mirror) })
|
|
343
344
|
]
|
|
344
345
|
}
|
|
345
346
|
)
|
|
@@ -348,8 +349,8 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
348
349
|
/* @__PURE__ */ jsx(
|
|
349
350
|
"div",
|
|
350
351
|
{
|
|
351
|
-
className: cn(styles$
|
|
352
|
-
[styles$
|
|
352
|
+
className: cn(styles$4.arrow, styles$4.nextArrow, {
|
|
353
|
+
[styles$4.arrowVertical]: direction === "vert"
|
|
353
354
|
}),
|
|
354
355
|
style: {
|
|
355
356
|
color: controls.color,
|
|
@@ -358,7 +359,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
358
359
|
children: /* @__PURE__ */ jsxs(
|
|
359
360
|
"button",
|
|
360
361
|
{
|
|
361
|
-
className: styles$
|
|
362
|
+
className: styles$4.arrowInner,
|
|
362
363
|
onClick: () => handleArrowClick("+1"),
|
|
363
364
|
style: {
|
|
364
365
|
transform: `translate(${scalingValue(controlsOffsetX * (direction === "horiz" ? -1 : 1), isEditor)}, ${scalingValue(controlsOffsetY, isEditor)}) scale(${settings.controls.scale / 100}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
|
|
@@ -370,10 +371,10 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
370
371
|
url: controls.arrowsImgUrl,
|
|
371
372
|
fill: controls.color,
|
|
372
373
|
hoverFill: controls.hover,
|
|
373
|
-
className: styles$
|
|
374
|
+
className: styles$4.arrowImg
|
|
374
375
|
}
|
|
375
376
|
),
|
|
376
|
-
!controls.arrowsImgUrl && /* @__PURE__ */ jsx(ArrowIcon, { color: controls.color, className: cn(styles$
|
|
377
|
+
!controls.arrowsImgUrl && /* @__PURE__ */ jsx(ArrowIcon, { color: controls.color, className: cn(styles$4.arrowIcon, styles$4.arrowImg) })
|
|
377
378
|
]
|
|
378
379
|
}
|
|
379
380
|
)
|
|
@@ -383,7 +384,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
383
384
|
triggers.triggersList.click && /* @__PURE__ */ jsx(
|
|
384
385
|
"div",
|
|
385
386
|
{
|
|
386
|
-
className: styles$
|
|
387
|
+
className: styles$4.clickOverlay,
|
|
387
388
|
onClick: () => {
|
|
388
389
|
if (sliderRef) {
|
|
389
390
|
sliderRef.go("+1");
|
|
@@ -394,21 +395,21 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
394
395
|
pagination2.isActive && /* @__PURE__ */ jsx(
|
|
395
396
|
"div",
|
|
396
397
|
{
|
|
397
|
-
className: cn(styles$
|
|
398
|
-
[styles$
|
|
399
|
-
[styles$
|
|
400
|
-
[styles$
|
|
401
|
-
[styles$
|
|
402
|
-
[styles$
|
|
403
|
-
[styles$
|
|
404
|
-
[styles$
|
|
405
|
-
[styles$
|
|
406
|
-
[styles$
|
|
398
|
+
className: cn(styles$4.pagination, {
|
|
399
|
+
[styles$4.paginationInsideBottom]: pagination2.position === "inside-1" && direction === "horiz",
|
|
400
|
+
[styles$4.paginationInsideTop]: pagination2.position === "inside-2" && direction === "horiz",
|
|
401
|
+
[styles$4.paginationOutsideBottom]: pagination2.position === "outside-1" && direction === "horiz",
|
|
402
|
+
[styles$4.paginationOutsideTop]: pagination2.position === "outside-2" && direction === "horiz",
|
|
403
|
+
[styles$4.paginationInsideLeft]: pagination2.position === "inside-1" && direction === "vert",
|
|
404
|
+
[styles$4.paginationInsideRight]: pagination2.position === "inside-2" && direction === "vert",
|
|
405
|
+
[styles$4.paginationOutsideLeft]: pagination2.position === "outside-1" && direction === "vert",
|
|
406
|
+
[styles$4.paginationOutsideRight]: pagination2.position === "outside-2" && direction === "vert",
|
|
407
|
+
[styles$4.paginationVertical]: direction === "vert"
|
|
407
408
|
}),
|
|
408
409
|
children: /* @__PURE__ */ jsx(
|
|
409
410
|
"div",
|
|
410
411
|
{
|
|
411
|
-
className: styles$
|
|
412
|
+
className: styles$4.paginationInner,
|
|
412
413
|
style: {
|
|
413
414
|
backgroundColor: pagination2.colors[2],
|
|
414
415
|
transform: `scale(${pagination2.scale / 100}) translate(${scalingValue(pagination2.offset.x, isEditor)}, ${scalingValue(pagination2.offset.y, isEditor)}) rotate(${direction === "horiz" ? "0deg" : "90deg"})`
|
|
@@ -421,12 +422,12 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
|
|
|
421
422
|
sliderRef.go(index);
|
|
422
423
|
}
|
|
423
424
|
},
|
|
424
|
-
className: cn(styles$
|
|
425
|
+
className: cn(styles$4.paginationItem),
|
|
425
426
|
children: /* @__PURE__ */ jsx(
|
|
426
427
|
"div",
|
|
427
428
|
{
|
|
428
|
-
className: cn(styles$
|
|
429
|
-
[styles$
|
|
429
|
+
className: cn(styles$4.dot, {
|
|
430
|
+
[styles$4.activeDot]: index === currentSlideIndex
|
|
430
431
|
}),
|
|
431
432
|
style: {
|
|
432
433
|
backgroundColor: index === currentSlideIndex ? pagination2.colors[0] : pagination2.colors[1],
|
|
@@ -468,7 +469,7 @@ const ControlSliderComponent = {
|
|
|
468
469
|
type: "object",
|
|
469
470
|
properties: {
|
|
470
471
|
triggers: {
|
|
471
|
-
|
|
472
|
+
title: "triggers",
|
|
472
473
|
icon: "target",
|
|
473
474
|
tooltip: "Triggers",
|
|
474
475
|
type: "object",
|
|
@@ -498,7 +499,7 @@ const ControlSliderComponent = {
|
|
|
498
499
|
}
|
|
499
500
|
},
|
|
500
501
|
direction: {
|
|
501
|
-
|
|
502
|
+
title: "direction",
|
|
502
503
|
icon: "horizontal-resize",
|
|
503
504
|
tooltip: "Direction",
|
|
504
505
|
type: "string",
|
|
@@ -508,7 +509,7 @@ const ControlSliderComponent = {
|
|
|
508
509
|
enum: ["horiz", "vert"]
|
|
509
510
|
},
|
|
510
511
|
transition: {
|
|
511
|
-
|
|
512
|
+
title: "transit",
|
|
512
513
|
icon: "transition",
|
|
513
514
|
tooltip: "Transition",
|
|
514
515
|
type: "object",
|
|
@@ -522,7 +523,7 @@ const ControlSliderComponent = {
|
|
|
522
523
|
},
|
|
523
524
|
backgroundColor: {
|
|
524
525
|
type: ["string", "null"],
|
|
525
|
-
|
|
526
|
+
title: "BG Color",
|
|
526
527
|
display: {
|
|
527
528
|
visible: false,
|
|
528
529
|
type: "settings-color-picker",
|
|
@@ -531,7 +532,7 @@ const ControlSliderComponent = {
|
|
|
531
532
|
},
|
|
532
533
|
duration: {
|
|
533
534
|
type: "string",
|
|
534
|
-
label: "hourglass
|
|
535
|
+
label: "icon:hourglass",
|
|
535
536
|
display: {
|
|
536
537
|
type: "step-selector"
|
|
537
538
|
},
|
|
@@ -540,7 +541,7 @@ const ControlSliderComponent = {
|
|
|
540
541
|
}
|
|
541
542
|
},
|
|
542
543
|
controls: {
|
|
543
|
-
|
|
544
|
+
title: "controls",
|
|
544
545
|
icon: "controls",
|
|
545
546
|
tooltip: "Controls",
|
|
546
547
|
type: "object",
|
|
@@ -573,7 +574,7 @@ const ControlSliderComponent = {
|
|
|
573
574
|
},
|
|
574
575
|
scale: {
|
|
575
576
|
type: "number",
|
|
576
|
-
|
|
577
|
+
title: "scale",
|
|
577
578
|
min: 50,
|
|
578
579
|
max: 600,
|
|
579
580
|
display: {
|
|
@@ -581,7 +582,7 @@ const ControlSliderComponent = {
|
|
|
581
582
|
}
|
|
582
583
|
},
|
|
583
584
|
color: {
|
|
584
|
-
|
|
585
|
+
title: "color",
|
|
585
586
|
type: "string",
|
|
586
587
|
display: {
|
|
587
588
|
type: "settings-color-picker",
|
|
@@ -589,7 +590,7 @@ const ControlSliderComponent = {
|
|
|
589
590
|
}
|
|
590
591
|
},
|
|
591
592
|
hover: {
|
|
592
|
-
|
|
593
|
+
title: "hover",
|
|
593
594
|
type: "string",
|
|
594
595
|
display: {
|
|
595
596
|
type: "settings-color-picker",
|
|
@@ -599,7 +600,7 @@ const ControlSliderComponent = {
|
|
|
599
600
|
}
|
|
600
601
|
},
|
|
601
602
|
pagination: {
|
|
602
|
-
|
|
603
|
+
title: "nav",
|
|
603
604
|
icon: "pagination",
|
|
604
605
|
tooltip: "Navigation",
|
|
605
606
|
type: "object",
|
|
@@ -611,7 +612,6 @@ const ControlSliderComponent = {
|
|
|
611
612
|
}
|
|
612
613
|
},
|
|
613
614
|
position: {
|
|
614
|
-
name: "nav position",
|
|
615
615
|
display: {
|
|
616
616
|
type: "socket",
|
|
617
617
|
direction: "horizontal"
|
|
@@ -635,7 +635,7 @@ const ControlSliderComponent = {
|
|
|
635
635
|
},
|
|
636
636
|
scale: {
|
|
637
637
|
type: "number",
|
|
638
|
-
|
|
638
|
+
title: "scale",
|
|
639
639
|
min: 10,
|
|
640
640
|
max: 400,
|
|
641
641
|
display: {
|
|
@@ -647,14 +647,14 @@ const ControlSliderComponent = {
|
|
|
647
647
|
type: "settings-color-picker",
|
|
648
648
|
format: "multiple"
|
|
649
649
|
},
|
|
650
|
-
|
|
650
|
+
title: "color",
|
|
651
651
|
type: "array",
|
|
652
652
|
items: {
|
|
653
653
|
type: "string"
|
|
654
654
|
}
|
|
655
655
|
},
|
|
656
656
|
hover: {
|
|
657
|
-
|
|
657
|
+
title: "hover",
|
|
658
658
|
type: "string",
|
|
659
659
|
display: {
|
|
660
660
|
type: "settings-color-picker",
|
|
@@ -664,7 +664,7 @@ const ControlSliderComponent = {
|
|
|
664
664
|
}
|
|
665
665
|
},
|
|
666
666
|
caption: {
|
|
667
|
-
|
|
667
|
+
title: "Caption",
|
|
668
668
|
icon: "text-icon",
|
|
669
669
|
tooltip: "Caption",
|
|
670
670
|
type: "object",
|
|
@@ -676,7 +676,6 @@ const ControlSliderComponent = {
|
|
|
676
676
|
}
|
|
677
677
|
},
|
|
678
678
|
alignment: {
|
|
679
|
-
name: "Alignment",
|
|
680
679
|
type: "string",
|
|
681
680
|
display: {
|
|
682
681
|
type: "align-grid"
|
|
@@ -698,7 +697,7 @@ const ControlSliderComponent = {
|
|
|
698
697
|
}
|
|
699
698
|
},
|
|
700
699
|
hover: {
|
|
701
|
-
|
|
700
|
+
title: "hover",
|
|
702
701
|
type: "string",
|
|
703
702
|
display: {
|
|
704
703
|
type: "settings-color-picker",
|
|
@@ -789,11 +788,11 @@ const ControlSliderComponent = {
|
|
|
789
788
|
properties: {
|
|
790
789
|
image: {
|
|
791
790
|
type: "object",
|
|
791
|
+
label: "Image",
|
|
792
792
|
display: {
|
|
793
|
-
type: "media-input",
|
|
794
|
-
label: "Image",
|
|
795
793
|
minWidth: 58,
|
|
796
|
-
maxWidth: 108
|
|
794
|
+
maxWidth: 108,
|
|
795
|
+
type: "media-input"
|
|
797
796
|
},
|
|
798
797
|
properties: {
|
|
799
798
|
url: {
|
|
@@ -810,10 +809,10 @@ const ControlSliderComponent = {
|
|
|
810
809
|
required: ["url", "name"]
|
|
811
810
|
},
|
|
812
811
|
imageCaption: {
|
|
812
|
+
placeholder: "Add Caption...",
|
|
813
|
+
label: "Description",
|
|
813
814
|
display: {
|
|
814
815
|
type: "rich-text",
|
|
815
|
-
label: "Description",
|
|
816
|
-
placeholder: "Add Caption...",
|
|
817
816
|
minWidth: 300,
|
|
818
817
|
maxWidth: 550
|
|
819
818
|
}
|
|
@@ -998,7 +997,7 @@ const ControlSliderComponent = {
|
|
|
998
997
|
const imageRevealSlider = "ImageRevealSlider-module__imageRevealSlider___UE5Ob";
|
|
999
998
|
const image = "ImageRevealSlider-module__image___Qjt-e";
|
|
1000
999
|
const link = "ImageRevealSlider-module__link___N-iLG";
|
|
1001
|
-
const styles = {
|
|
1000
|
+
const styles$1 = {
|
|
1002
1001
|
imageRevealSlider,
|
|
1003
1002
|
image,
|
|
1004
1003
|
link
|
|
@@ -1133,12 +1132,12 @@ function ImageRevealSlider({ settings, content, isEditor }) {
|
|
|
1133
1132
|
{
|
|
1134
1133
|
ref: divRef,
|
|
1135
1134
|
onClick: handleClick,
|
|
1136
|
-
className: styles.imageRevealSlider,
|
|
1135
|
+
className: styles$1.imageRevealSlider,
|
|
1137
1136
|
style: { cursor: cursorType !== "system" && defaultCursor ? `url(${target === "area" ? hoverCursor : defaultCursor}), auto` : "default" },
|
|
1138
1137
|
children: placedImages.map((img2) => /* @__PURE__ */ jsx(
|
|
1139
1138
|
"div",
|
|
1140
1139
|
{
|
|
1141
|
-
className: styles.wrapper,
|
|
1140
|
+
className: styles$1.wrapper,
|
|
1142
1141
|
style: {
|
|
1143
1142
|
top: `${img2.y}px`,
|
|
1144
1143
|
left: `${img2.x}px`,
|
|
@@ -1148,12 +1147,12 @@ function ImageRevealSlider({ settings, content, isEditor }) {
|
|
|
1148
1147
|
height: "auto",
|
|
1149
1148
|
cursor: cursorType !== "system" && hoverCursor ? `url(${hoverCursor}), auto` : "default"
|
|
1150
1149
|
},
|
|
1151
|
-
children: target === "area" && img2.link ? /* @__PURE__ */ jsx("a", { href: img2.link, target: "_blank", className: styles.link, children: /* @__PURE__ */ jsx(
|
|
1150
|
+
children: target === "area" && img2.link ? /* @__PURE__ */ jsx("a", { href: img2.link, target: "_blank", className: styles$1.link, children: /* @__PURE__ */ jsx(
|
|
1152
1151
|
"img",
|
|
1153
1152
|
{
|
|
1154
1153
|
src: img2.url,
|
|
1155
1154
|
alt: img2.name,
|
|
1156
|
-
className: styles.image
|
|
1155
|
+
className: styles$1.image
|
|
1157
1156
|
},
|
|
1158
1157
|
img2.id
|
|
1159
1158
|
) }) : /* @__PURE__ */ jsx(
|
|
@@ -1161,7 +1160,7 @@ function ImageRevealSlider({ settings, content, isEditor }) {
|
|
|
1161
1160
|
{
|
|
1162
1161
|
src: img2.url,
|
|
1163
1162
|
alt: img2.name,
|
|
1164
|
-
className: styles.image
|
|
1163
|
+
className: styles$1.image
|
|
1165
1164
|
},
|
|
1166
1165
|
img2.id
|
|
1167
1166
|
)
|
|
@@ -1191,18 +1190,17 @@ const ControlImageRevealSliderComponent = {
|
|
|
1191
1190
|
type: "object",
|
|
1192
1191
|
properties: {
|
|
1193
1192
|
imageSize: {
|
|
1194
|
-
|
|
1193
|
+
title: "IMG SIZE",
|
|
1195
1194
|
icon: "size",
|
|
1196
1195
|
tooltip: "IMG SIZE",
|
|
1197
1196
|
type: "object",
|
|
1198
1197
|
properties: {
|
|
1199
1198
|
sizeType: {
|
|
1200
|
-
name: "sizeType",
|
|
1201
1199
|
type: "string",
|
|
1202
1200
|
display: {
|
|
1203
1201
|
type: "ratio-group"
|
|
1204
1202
|
},
|
|
1205
|
-
enum: ["as
|
|
1203
|
+
enum: ["as is", "custom", "random"]
|
|
1206
1204
|
},
|
|
1207
1205
|
imageWidth: {
|
|
1208
1206
|
type: "number",
|
|
@@ -1230,13 +1228,12 @@ const ControlImageRevealSliderComponent = {
|
|
|
1230
1228
|
}
|
|
1231
1229
|
},
|
|
1232
1230
|
cursor: {
|
|
1233
|
-
|
|
1231
|
+
title: "cursor",
|
|
1234
1232
|
icon: "cursor",
|
|
1235
1233
|
tooltip: "cursor",
|
|
1236
1234
|
type: "object",
|
|
1237
1235
|
properties: {
|
|
1238
1236
|
cursorType: {
|
|
1239
|
-
name: "cursorType",
|
|
1240
1237
|
type: "string",
|
|
1241
1238
|
display: {
|
|
1242
1239
|
type: "ratio-group"
|
|
@@ -1245,24 +1242,24 @@ const ControlImageRevealSliderComponent = {
|
|
|
1245
1242
|
},
|
|
1246
1243
|
defaultCursor: {
|
|
1247
1244
|
type: ["string", "null"],
|
|
1245
|
+
title: "Default",
|
|
1248
1246
|
display: {
|
|
1249
1247
|
type: "settings-image-input",
|
|
1250
|
-
title: "Default",
|
|
1251
1248
|
visible: false
|
|
1252
1249
|
}
|
|
1253
1250
|
},
|
|
1254
1251
|
hoverCursor: {
|
|
1255
1252
|
type: ["string", "null"],
|
|
1253
|
+
title: "Hover",
|
|
1256
1254
|
display: {
|
|
1257
1255
|
type: "settings-image-input",
|
|
1258
|
-
title: "Hover",
|
|
1259
1256
|
visible: false
|
|
1260
1257
|
}
|
|
1261
1258
|
}
|
|
1262
1259
|
}
|
|
1263
1260
|
},
|
|
1264
1261
|
position: {
|
|
1265
|
-
|
|
1262
|
+
title: "position",
|
|
1266
1263
|
icon: "transition",
|
|
1267
1264
|
tooltip: "Position",
|
|
1268
1265
|
type: "object",
|
|
@@ -1438,9 +1435,1067 @@ const ControlImageRevealSliderComponent = {
|
|
|
1438
1435
|
}
|
|
1439
1436
|
}
|
|
1440
1437
|
};
|
|
1438
|
+
const backdropStyle = "LightBox-module__backdropStyle___yWDe2";
|
|
1439
|
+
const contentStyle = "LightBox-module__contentStyle___Bgnsq";
|
|
1440
|
+
const imageStyle = "LightBox-module__imageStyle___tLIlB";
|
|
1441
|
+
const imgWrapper = "LightBox-module__imgWrapper___LuFUp";
|
|
1442
|
+
const contain = "LightBox-module__contain___8-yaS";
|
|
1443
|
+
const cover = "LightBox-module__cover___hNvOG";
|
|
1444
|
+
const caption = "LightBox-module__caption___b6L2I";
|
|
1445
|
+
const arrow = "LightBox-module__arrow___iz38X";
|
|
1446
|
+
const arrowVertical = "LightBox-module__arrowVertical___Zfz81";
|
|
1447
|
+
const nextArrow = "LightBox-module__nextArrow___zkAQN";
|
|
1448
|
+
const arrowInner = "LightBox-module__arrowInner___p48sW";
|
|
1449
|
+
const arrowImg = "LightBox-module__arrowImg___pNV88";
|
|
1450
|
+
const mirror = "LightBox-module__mirror___pjeXc";
|
|
1451
|
+
const thumbsContainer = "LightBox-module__thumbsContainer___osSma";
|
|
1452
|
+
const thumbItem = "LightBox-module__thumbItem___HvnF3";
|
|
1453
|
+
const thumbImage = "LightBox-module__thumbImage___OJ19m";
|
|
1454
|
+
const fadeIn = "LightBox-module__fadeIn___0m5GW";
|
|
1455
|
+
const slideInLeft = "LightBox-module__slideInLeft___gPYwC";
|
|
1456
|
+
const slideInRight = "LightBox-module__slideInRight___S-pPp";
|
|
1457
|
+
const slideInTop = "LightBox-module__slideInTop___DFdAj";
|
|
1458
|
+
const slideInBottom = "LightBox-module__slideInBottom___m27kZ";
|
|
1459
|
+
const styles = {
|
|
1460
|
+
backdropStyle,
|
|
1461
|
+
contentStyle,
|
|
1462
|
+
imageStyle,
|
|
1463
|
+
imgWrapper,
|
|
1464
|
+
contain,
|
|
1465
|
+
cover,
|
|
1466
|
+
caption,
|
|
1467
|
+
arrow,
|
|
1468
|
+
arrowVertical,
|
|
1469
|
+
nextArrow,
|
|
1470
|
+
arrowInner,
|
|
1471
|
+
arrowImg,
|
|
1472
|
+
mirror,
|
|
1473
|
+
thumbsContainer,
|
|
1474
|
+
thumbItem,
|
|
1475
|
+
thumbImage,
|
|
1476
|
+
fadeIn,
|
|
1477
|
+
slideInLeft,
|
|
1478
|
+
slideInRight,
|
|
1479
|
+
slideInTop,
|
|
1480
|
+
slideInBottom
|
|
1481
|
+
};
|
|
1482
|
+
function LightboxGallery({ settings, content, styles: styles2, portalId }) {
|
|
1483
|
+
const [open, setOpen] = React.useState(false);
|
|
1484
|
+
const { url: coverUrl } = settings.cover;
|
|
1485
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
1486
|
+
/* @__PURE__ */ jsx(
|
|
1487
|
+
"img",
|
|
1488
|
+
{
|
|
1489
|
+
src: coverUrl,
|
|
1490
|
+
alt: "Cover",
|
|
1491
|
+
style: { width: "100%", height: "100%", cursor: "pointer" },
|
|
1492
|
+
onClick: () => setOpen(true)
|
|
1493
|
+
}
|
|
1494
|
+
),
|
|
1495
|
+
/* @__PURE__ */ jsx(Lightbox, { isOpen: open, onClose: () => setOpen(false), content, settings, portalId })
|
|
1496
|
+
] });
|
|
1497
|
+
}
|
|
1498
|
+
const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = true, closeOnEsc = true, portalId }) => {
|
|
1499
|
+
var _a;
|
|
1500
|
+
const [currentIndex, setCurrentIndex] = React.useState(0);
|
|
1501
|
+
const lightboxRef = useRef(null);
|
|
1502
|
+
const handleBackdropClick = (e) => {
|
|
1503
|
+
if (!closeOnBackdropClick) return;
|
|
1504
|
+
if (e.target === e.currentTarget) {
|
|
1505
|
+
onClose();
|
|
1506
|
+
}
|
|
1507
|
+
};
|
|
1508
|
+
const handleImageWrapperClick = (e) => {
|
|
1509
|
+
if (!closeOnBackdropClick) return;
|
|
1510
|
+
if (e.target === e.currentTarget) {
|
|
1511
|
+
onClose();
|
|
1512
|
+
}
|
|
1513
|
+
};
|
|
1514
|
+
const onImageClick = (e) => {
|
|
1515
|
+
var _a2, _b;
|
|
1516
|
+
if (settings.triggers.type === "click" && settings.triggers.switch === "image") {
|
|
1517
|
+
e.stopPropagation();
|
|
1518
|
+
(_a2 = lightboxRef.current) == null ? void 0 : _a2.go("+1");
|
|
1519
|
+
}
|
|
1520
|
+
if (settings.triggers.type === "click" && settings.triggers.switch === "50/50") {
|
|
1521
|
+
e.stopPropagation();
|
|
1522
|
+
const img2 = e.currentTarget;
|
|
1523
|
+
const rect = img2.getBoundingClientRect();
|
|
1524
|
+
const clickX = e.clientX - rect.left;
|
|
1525
|
+
const clickY = e.clientY - rect.top;
|
|
1526
|
+
const imgWidth = rect.width;
|
|
1527
|
+
const imgHeight = rect.height;
|
|
1528
|
+
let dir;
|
|
1529
|
+
if (settings.slider.direction === "horiz") {
|
|
1530
|
+
dir = clickX < imgWidth / 2 ? "-1" : "+1";
|
|
1531
|
+
} else {
|
|
1532
|
+
dir = clickY < imgHeight / 2 ? "-1" : "+1";
|
|
1533
|
+
}
|
|
1534
|
+
(_b = lightboxRef.current) == null ? void 0 : _b.go(dir);
|
|
1535
|
+
}
|
|
1536
|
+
};
|
|
1537
|
+
useEffect(() => {
|
|
1538
|
+
if (!isOpen || !closeOnEsc) return;
|
|
1539
|
+
const onKeyDown = (event) => {
|
|
1540
|
+
if (event.key === "Escape") {
|
|
1541
|
+
onClose();
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
if (event.key === "ArrowRight") {
|
|
1545
|
+
setCurrentIndex((prev) => (prev + 1) % Math.max(content.length, 1));
|
|
1546
|
+
return;
|
|
1547
|
+
}
|
|
1548
|
+
if (event.key === "ArrowLeft") {
|
|
1549
|
+
setCurrentIndex((prev) => (prev - 1 + Math.max(content.length, 1)) % Math.max(content.length, 1));
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
window.addEventListener("keydown", onKeyDown);
|
|
1553
|
+
return () => {
|
|
1554
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
1555
|
+
};
|
|
1556
|
+
}, [isOpen, closeOnEsc, onClose, content.length]);
|
|
1557
|
+
useEffect(() => {
|
|
1558
|
+
if (isOpen) setCurrentIndex(0);
|
|
1559
|
+
}, [isOpen]);
|
|
1560
|
+
const handleArrowClick = (dir) => {
|
|
1561
|
+
var _a2;
|
|
1562
|
+
(_a2 = lightboxRef.current) == null ? void 0 : _a2.go(dir);
|
|
1563
|
+
};
|
|
1564
|
+
const appearDurationMs = ((_a = settings.appear) == null ? void 0 : _a.duration) ? parseInt(settings.appear.duration) : 300;
|
|
1565
|
+
const appearClass = (() => {
|
|
1566
|
+
var _a2, _b;
|
|
1567
|
+
if (((_a2 = settings.appear) == null ? void 0 : _a2.type) === "fade in") return styles.fadeIn;
|
|
1568
|
+
if (((_b = settings.appear) == null ? void 0 : _b.type) === "slide in") {
|
|
1569
|
+
switch (settings.appear.direction) {
|
|
1570
|
+
case "left":
|
|
1571
|
+
return styles.slideInLeft;
|
|
1572
|
+
case "right":
|
|
1573
|
+
return styles.slideInRight;
|
|
1574
|
+
case "top":
|
|
1575
|
+
return styles.slideInTop;
|
|
1576
|
+
case "bottom":
|
|
1577
|
+
return styles.slideInBottom;
|
|
1578
|
+
default:
|
|
1579
|
+
return styles.slideInRight;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
return styles.fadeIn;
|
|
1583
|
+
})();
|
|
1584
|
+
if (!isOpen) return null;
|
|
1585
|
+
return createPortal(
|
|
1586
|
+
/* @__PURE__ */ jsx(
|
|
1587
|
+
"div",
|
|
1588
|
+
{
|
|
1589
|
+
className: cn(styles.backdropStyle, styles.fadeIn),
|
|
1590
|
+
style: { backgroundColor: settings.area.color, backdropFilter: `blur(${settings.area.blur}px)`, animationDuration: `${appearDurationMs}ms`, animationTimingFunction: "ease", animationFillMode: "both" },
|
|
1591
|
+
onClick: handleBackdropClick,
|
|
1592
|
+
children: /* @__PURE__ */ jsxs(
|
|
1593
|
+
"div",
|
|
1594
|
+
{
|
|
1595
|
+
className: cn(styles.contentStyle, appearClass),
|
|
1596
|
+
style: {
|
|
1597
|
+
padding: `${settings.layout.padding.top}px ${settings.layout.padding.right}px ${settings.layout.padding.bottom}px ${settings.layout.padding.left}px`,
|
|
1598
|
+
animationDuration: `${appearDurationMs}ms`,
|
|
1599
|
+
animationTimingFunction: "ease",
|
|
1600
|
+
animationFillMode: "both"
|
|
1601
|
+
},
|
|
1602
|
+
children: [
|
|
1603
|
+
/* @__PURE__ */ jsx(
|
|
1604
|
+
Splide,
|
|
1605
|
+
{
|
|
1606
|
+
onMove: (splide) => {
|
|
1607
|
+
setCurrentIndex(splide.index);
|
|
1608
|
+
},
|
|
1609
|
+
ref: lightboxRef,
|
|
1610
|
+
options: {
|
|
1611
|
+
arrows: false,
|
|
1612
|
+
speed: settings.triggers.duration ? parseInt(settings.triggers.duration) : 500,
|
|
1613
|
+
direction: settings.slider.direction === "horiz" || settings.slider.type === "fade" ? "ltr" : "ttb",
|
|
1614
|
+
pagination: false,
|
|
1615
|
+
drag: settings.triggers.type === "drag",
|
|
1616
|
+
perPage: 1,
|
|
1617
|
+
width: "100%",
|
|
1618
|
+
height: "100%",
|
|
1619
|
+
type: settings.slider.type === "fade" ? "fade" : "loop",
|
|
1620
|
+
padding: 0,
|
|
1621
|
+
rewind: false
|
|
1622
|
+
},
|
|
1623
|
+
children: content.map((item, index) => /* @__PURE__ */ jsx(SplideSlide, { children: /* @__PURE__ */ jsx("div", { className: styles.imgWrapper, onClick: handleImageWrapperClick, children: /* @__PURE__ */ jsx(
|
|
1624
|
+
"img",
|
|
1625
|
+
{
|
|
1626
|
+
className: cn(styles.imageStyle, {
|
|
1627
|
+
[styles.contain]: item.image.objectFit === "contain",
|
|
1628
|
+
[styles.cover]: item.image.objectFit === "cover"
|
|
1629
|
+
}),
|
|
1630
|
+
src: item.image.url,
|
|
1631
|
+
alt: item.image.name ?? "",
|
|
1632
|
+
onClick: onImageClick
|
|
1633
|
+
}
|
|
1634
|
+
) }) }, index))
|
|
1635
|
+
}
|
|
1636
|
+
),
|
|
1637
|
+
settings.controls.isActive && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1638
|
+
/* @__PURE__ */ jsx(
|
|
1639
|
+
"div",
|
|
1640
|
+
{
|
|
1641
|
+
className: cn(styles.arrow, { [styles.arrowVertical]: settings.slider.direction === "vert" }),
|
|
1642
|
+
style: { color: settings.controls.color, ["--arrow-hover-color"]: settings.controls.hover },
|
|
1643
|
+
children: /* @__PURE__ */ jsx(
|
|
1644
|
+
"button",
|
|
1645
|
+
{
|
|
1646
|
+
className: styles.arrowInner,
|
|
1647
|
+
style: {
|
|
1648
|
+
transform: `translate(${scalingValue(settings.controls.offset.x)}, ${scalingValue(settings.controls.offset.y * (settings.slider.direction === "horiz" ? 1 : -1))}) scale(${settings.controls.scale / 100}) rotate(${settings.slider.direction === "horiz" ? "0deg" : "90deg"})`
|
|
1649
|
+
},
|
|
1650
|
+
onClick: (e) => {
|
|
1651
|
+
handleArrowClick("-1");
|
|
1652
|
+
},
|
|
1653
|
+
children: settings.controls.arrowsImgUrl && /* @__PURE__ */ jsx(
|
|
1654
|
+
SvgImage,
|
|
1655
|
+
{
|
|
1656
|
+
url: settings.controls.arrowsImgUrl,
|
|
1657
|
+
fill: settings.controls.color,
|
|
1658
|
+
hoverFill: settings.controls.hover,
|
|
1659
|
+
className: cn(styles.arrowImg, styles.mirror)
|
|
1660
|
+
}
|
|
1661
|
+
)
|
|
1662
|
+
}
|
|
1663
|
+
)
|
|
1664
|
+
}
|
|
1665
|
+
),
|
|
1666
|
+
/* @__PURE__ */ jsx(
|
|
1667
|
+
"div",
|
|
1668
|
+
{
|
|
1669
|
+
className: cn(styles.arrow, styles.nextArrow, { [styles.arrowVertical]: settings.slider.direction === "vert" }),
|
|
1670
|
+
style: { color: settings.controls.color, ["--arrow-hover-color"]: settings.controls.hover },
|
|
1671
|
+
children: /* @__PURE__ */ jsx(
|
|
1672
|
+
"button",
|
|
1673
|
+
{
|
|
1674
|
+
className: styles.arrowInner,
|
|
1675
|
+
style: {
|
|
1676
|
+
transform: `translate(${scalingValue(settings.controls.offset.x * (settings.slider.direction === "horiz" ? -1 : 1))}, ${scalingValue(settings.controls.offset.y)}) scale(${settings.controls.scale / 100}) rotate(${settings.slider.direction === "horiz" ? "0deg" : "90deg"})`
|
|
1677
|
+
},
|
|
1678
|
+
onClick: (e) => {
|
|
1679
|
+
handleArrowClick("+1");
|
|
1680
|
+
},
|
|
1681
|
+
"aria-label": "Next",
|
|
1682
|
+
children: settings.controls.arrowsImgUrl && /* @__PURE__ */ jsx(
|
|
1683
|
+
SvgImage,
|
|
1684
|
+
{
|
|
1685
|
+
url: settings.controls.arrowsImgUrl,
|
|
1686
|
+
fill: settings.controls.color,
|
|
1687
|
+
hoverFill: settings.controls.hover,
|
|
1688
|
+
className: styles.arrowImg
|
|
1689
|
+
}
|
|
1690
|
+
)
|
|
1691
|
+
}
|
|
1692
|
+
)
|
|
1693
|
+
}
|
|
1694
|
+
)
|
|
1695
|
+
] }),
|
|
1696
|
+
settings.area.closeIconUrl && /* @__PURE__ */ jsx("button", { className: styles.closeButton, style: { top: settings.area.closeIconOffset.y, left: settings.area.closeIconOffset.x }, onClick: onClose, children: /* @__PURE__ */ jsx(SvgImage, { url: settings.area.closeIconUrl, fill: settings.area.color }) }),
|
|
1697
|
+
settings.caption.isActive && /* @__PURE__ */ jsx("div", { className: styles.caption, style: { top: settings.caption.offset.y, left: settings.caption.offset.x, color: settings.caption.color }, children: /* @__PURE__ */ jsx(RichTextRenderer, { content: content[currentIndex].imageCaption }) }),
|
|
1698
|
+
settings.thumbnail.isActive && /* @__PURE__ */ jsx(
|
|
1699
|
+
"div",
|
|
1700
|
+
{
|
|
1701
|
+
className: cn(styles.thumbsContainer),
|
|
1702
|
+
style: {
|
|
1703
|
+
gap: `${settings.thumbnail.grid.gap}px`,
|
|
1704
|
+
height: `${settings.thumbnail.grid.height}px`
|
|
1705
|
+
},
|
|
1706
|
+
children: content.map((item, index) => {
|
|
1707
|
+
const isActive = index === currentIndex;
|
|
1708
|
+
return /* @__PURE__ */ jsx(
|
|
1709
|
+
"button",
|
|
1710
|
+
{
|
|
1711
|
+
className: styles.thumbItem,
|
|
1712
|
+
style: {
|
|
1713
|
+
transform: `scale(${isActive ? settings.thumbnail.activeState.scale : 1})`,
|
|
1714
|
+
height: "100%",
|
|
1715
|
+
opacity: isActive ? settings.thumbnail.activeState.opacity : settings.thumbnail.opacity,
|
|
1716
|
+
["--thumb-hover"]: settings.thumbnail.activeState.opacity
|
|
1717
|
+
},
|
|
1718
|
+
onClick: (e) => {
|
|
1719
|
+
var _a2;
|
|
1720
|
+
e.stopPropagation();
|
|
1721
|
+
setCurrentIndex(index);
|
|
1722
|
+
(_a2 = lightboxRef.current) == null ? void 0 : _a2.go(index);
|
|
1723
|
+
},
|
|
1724
|
+
children: /* @__PURE__ */ jsx(
|
|
1725
|
+
"img",
|
|
1726
|
+
{
|
|
1727
|
+
src: item.image.url,
|
|
1728
|
+
alt: item.image.name ?? "",
|
|
1729
|
+
className: styles.thumbImage,
|
|
1730
|
+
style: { objectFit: settings.thumbnail.fit === "cover" ? "cover" : "contain" }
|
|
1731
|
+
}
|
|
1732
|
+
)
|
|
1733
|
+
},
|
|
1734
|
+
`${item.image.url}-${index}`
|
|
1735
|
+
);
|
|
1736
|
+
})
|
|
1737
|
+
}
|
|
1738
|
+
)
|
|
1739
|
+
]
|
|
1740
|
+
}
|
|
1741
|
+
)
|
|
1742
|
+
}
|
|
1743
|
+
),
|
|
1744
|
+
document.getElementById(portalId)
|
|
1745
|
+
);
|
|
1746
|
+
};
|
|
1747
|
+
const LightboxComponent = {
|
|
1748
|
+
element: LightboxGallery,
|
|
1749
|
+
id: "lightbox",
|
|
1750
|
+
name: "Lightbox",
|
|
1751
|
+
preview: {
|
|
1752
|
+
type: "video",
|
|
1753
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7EQ4ME6CP4KX7TJ4HPAXFEW.mp4"
|
|
1754
|
+
},
|
|
1755
|
+
defaultSize: {
|
|
1756
|
+
width: 400,
|
|
1757
|
+
height: 400
|
|
1758
|
+
},
|
|
1759
|
+
schema: {
|
|
1760
|
+
type: "object",
|
|
1761
|
+
properties: {
|
|
1762
|
+
settings: {
|
|
1763
|
+
layoutBased: true,
|
|
1764
|
+
type: "object",
|
|
1765
|
+
properties: {
|
|
1766
|
+
cover: {
|
|
1767
|
+
title: "COVER",
|
|
1768
|
+
icon: "image",
|
|
1769
|
+
tooltip: "Cover Image",
|
|
1770
|
+
type: "object",
|
|
1771
|
+
properties: {
|
|
1772
|
+
url: {
|
|
1773
|
+
type: "string",
|
|
1774
|
+
display: {
|
|
1775
|
+
type: "settings-image-input"
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
},
|
|
1780
|
+
appear: {
|
|
1781
|
+
title: "APPEAR",
|
|
1782
|
+
icon: "transition",
|
|
1783
|
+
tooltip: "Appearance",
|
|
1784
|
+
type: "object",
|
|
1785
|
+
properties: {
|
|
1786
|
+
type: {
|
|
1787
|
+
type: "string",
|
|
1788
|
+
display: {
|
|
1789
|
+
type: "ratio-group"
|
|
1790
|
+
},
|
|
1791
|
+
enum: ["slide in", "fade in", "mix"]
|
|
1792
|
+
},
|
|
1793
|
+
duration: {
|
|
1794
|
+
type: "string",
|
|
1795
|
+
label: "hourglass-icon",
|
|
1796
|
+
display: {
|
|
1797
|
+
type: "step-selector"
|
|
1798
|
+
},
|
|
1799
|
+
enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
|
|
1800
|
+
},
|
|
1801
|
+
direction: {
|
|
1802
|
+
type: "string",
|
|
1803
|
+
title: "FROM",
|
|
1804
|
+
display: {
|
|
1805
|
+
visible: false,
|
|
1806
|
+
type: "direction-control"
|
|
1807
|
+
},
|
|
1808
|
+
enum: ["top", "bottom", "left", "right"]
|
|
1809
|
+
},
|
|
1810
|
+
repeat: {
|
|
1811
|
+
type: "string",
|
|
1812
|
+
title: "Repeat",
|
|
1813
|
+
display: {
|
|
1814
|
+
type: "ratio-group"
|
|
1815
|
+
},
|
|
1816
|
+
enum: ["close", "loop"]
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
},
|
|
1820
|
+
triggers: {
|
|
1821
|
+
title: "TRIGGERS",
|
|
1822
|
+
icon: "target",
|
|
1823
|
+
tooltip: "Triggers",
|
|
1824
|
+
type: "object",
|
|
1825
|
+
properties: {
|
|
1826
|
+
type: {
|
|
1827
|
+
type: "string",
|
|
1828
|
+
display: {
|
|
1829
|
+
type: "ratio-group"
|
|
1830
|
+
},
|
|
1831
|
+
enum: ["click", "drag", "scroll"]
|
|
1832
|
+
},
|
|
1833
|
+
switch: {
|
|
1834
|
+
type: "string",
|
|
1835
|
+
display: {
|
|
1836
|
+
type: "ratio-group"
|
|
1837
|
+
},
|
|
1838
|
+
enum: ["image", "50/50"]
|
|
1839
|
+
},
|
|
1840
|
+
duration: {
|
|
1841
|
+
type: "string",
|
|
1842
|
+
label: "hourglass-icon",
|
|
1843
|
+
display: {
|
|
1844
|
+
type: "step-selector"
|
|
1845
|
+
},
|
|
1846
|
+
enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
},
|
|
1850
|
+
slider: {
|
|
1851
|
+
title: "SLIDER",
|
|
1852
|
+
icon: "horizontal-resize",
|
|
1853
|
+
tooltip: "Slider",
|
|
1854
|
+
type: "object",
|
|
1855
|
+
properties: {
|
|
1856
|
+
type: {
|
|
1857
|
+
type: "string",
|
|
1858
|
+
display: {
|
|
1859
|
+
type: "ratio-group"
|
|
1860
|
+
},
|
|
1861
|
+
enum: ["slide", "fade", "scale"]
|
|
1862
|
+
},
|
|
1863
|
+
direction: {
|
|
1864
|
+
type: "string",
|
|
1865
|
+
display: {
|
|
1866
|
+
visible: false,
|
|
1867
|
+
type: "ratio-group"
|
|
1868
|
+
},
|
|
1869
|
+
enum: ["horiz", "vert"]
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
},
|
|
1873
|
+
thumbnail: {
|
|
1874
|
+
title: "THUMB",
|
|
1875
|
+
icon: "pagination",
|
|
1876
|
+
tooltip: "Thumbnail",
|
|
1877
|
+
type: "object",
|
|
1878
|
+
properties: {
|
|
1879
|
+
isActive: {
|
|
1880
|
+
type: "boolean",
|
|
1881
|
+
display: {
|
|
1882
|
+
type: "setting-toggle"
|
|
1883
|
+
}
|
|
1884
|
+
},
|
|
1885
|
+
position: {
|
|
1886
|
+
display: {
|
|
1887
|
+
type: "align-grid"
|
|
1888
|
+
},
|
|
1889
|
+
type: "string",
|
|
1890
|
+
enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
|
|
1891
|
+
},
|
|
1892
|
+
fit: {
|
|
1893
|
+
type: "string",
|
|
1894
|
+
display: {
|
|
1895
|
+
type: "ratio-group"
|
|
1896
|
+
},
|
|
1897
|
+
enum: ["cover", "fit"]
|
|
1898
|
+
},
|
|
1899
|
+
align: {
|
|
1900
|
+
type: "string",
|
|
1901
|
+
title: "Align",
|
|
1902
|
+
display: {
|
|
1903
|
+
type: "ratio-group"
|
|
1904
|
+
},
|
|
1905
|
+
enum: ["top", "center", "bottom"]
|
|
1906
|
+
},
|
|
1907
|
+
triggers: {
|
|
1908
|
+
type: "string",
|
|
1909
|
+
title: "Triggers",
|
|
1910
|
+
display: {
|
|
1911
|
+
type: "ratio-group"
|
|
1912
|
+
},
|
|
1913
|
+
enum: ["click", "hover"]
|
|
1914
|
+
},
|
|
1915
|
+
grid: {
|
|
1916
|
+
type: "object",
|
|
1917
|
+
title: "Grid",
|
|
1918
|
+
display: {
|
|
1919
|
+
type: "group"
|
|
1920
|
+
},
|
|
1921
|
+
properties: {
|
|
1922
|
+
height: {
|
|
1923
|
+
type: "number",
|
|
1924
|
+
label: "H",
|
|
1925
|
+
display: {
|
|
1926
|
+
type: "numeric-input"
|
|
1927
|
+
}
|
|
1928
|
+
},
|
|
1929
|
+
gap: {
|
|
1930
|
+
type: "number",
|
|
1931
|
+
label: "Gap",
|
|
1932
|
+
display: {
|
|
1933
|
+
type: "numeric-input"
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
},
|
|
1938
|
+
offset: {
|
|
1939
|
+
type: "object",
|
|
1940
|
+
display: {
|
|
1941
|
+
type: "offset-controls"
|
|
1942
|
+
},
|
|
1943
|
+
properties: {
|
|
1944
|
+
x: {
|
|
1945
|
+
type: "number"
|
|
1946
|
+
},
|
|
1947
|
+
y: {
|
|
1948
|
+
type: "number"
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
},
|
|
1952
|
+
opacity: {
|
|
1953
|
+
type: "number",
|
|
1954
|
+
title: "Opacity",
|
|
1955
|
+
label: "icon:opacity",
|
|
1956
|
+
min: 0,
|
|
1957
|
+
max: 100,
|
|
1958
|
+
step: 1,
|
|
1959
|
+
display: {
|
|
1960
|
+
type: "numeric-input"
|
|
1961
|
+
}
|
|
1962
|
+
},
|
|
1963
|
+
activeState: {
|
|
1964
|
+
type: "object",
|
|
1965
|
+
title: "ACTIVE",
|
|
1966
|
+
display: {
|
|
1967
|
+
type: "group"
|
|
1968
|
+
},
|
|
1969
|
+
properties: {
|
|
1970
|
+
scale: {
|
|
1971
|
+
type: "number",
|
|
1972
|
+
title: "Scale",
|
|
1973
|
+
min: 1,
|
|
1974
|
+
max: 2,
|
|
1975
|
+
step: 0.1,
|
|
1976
|
+
display: {
|
|
1977
|
+
type: "range-control"
|
|
1978
|
+
}
|
|
1979
|
+
},
|
|
1980
|
+
opacity: {
|
|
1981
|
+
type: "number",
|
|
1982
|
+
title: "Opacity",
|
|
1983
|
+
label: "icon:opacity",
|
|
1984
|
+
min: 0,
|
|
1985
|
+
max: 100,
|
|
1986
|
+
step: 1,
|
|
1987
|
+
display: {
|
|
1988
|
+
type: "numeric-input"
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
},
|
|
1995
|
+
layout: {
|
|
1996
|
+
title: "LAYOUT",
|
|
1997
|
+
icon: "layout",
|
|
1998
|
+
tooltip: "Layout",
|
|
1999
|
+
type: "object",
|
|
2000
|
+
properties: {
|
|
2001
|
+
position: {
|
|
2002
|
+
display: {
|
|
2003
|
+
type: "align-grid"
|
|
2004
|
+
},
|
|
2005
|
+
type: "string",
|
|
2006
|
+
enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
|
|
2007
|
+
},
|
|
2008
|
+
offset: {
|
|
2009
|
+
type: "object",
|
|
2010
|
+
display: {
|
|
2011
|
+
type: "offset-controls"
|
|
2012
|
+
},
|
|
2013
|
+
properties: {
|
|
2014
|
+
x: {
|
|
2015
|
+
type: "number"
|
|
2016
|
+
},
|
|
2017
|
+
y: {
|
|
2018
|
+
type: "number"
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
},
|
|
2022
|
+
padding: {
|
|
2023
|
+
type: "object",
|
|
2024
|
+
title: "Padding",
|
|
2025
|
+
display: {
|
|
2026
|
+
type: "padding-controls"
|
|
2027
|
+
},
|
|
2028
|
+
properties: {
|
|
2029
|
+
top: {
|
|
2030
|
+
type: "number"
|
|
2031
|
+
},
|
|
2032
|
+
right: {
|
|
2033
|
+
type: "number"
|
|
2034
|
+
},
|
|
2035
|
+
bottom: {
|
|
2036
|
+
type: "number"
|
|
2037
|
+
},
|
|
2038
|
+
left: {
|
|
2039
|
+
type: "number"
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
},
|
|
2045
|
+
controls: {
|
|
2046
|
+
title: "CONTROLS",
|
|
2047
|
+
icon: "controls",
|
|
2048
|
+
tooltip: "Controls",
|
|
2049
|
+
type: "object",
|
|
2050
|
+
properties: {
|
|
2051
|
+
isActive: {
|
|
2052
|
+
type: "boolean",
|
|
2053
|
+
display: {
|
|
2054
|
+
type: "setting-toggle"
|
|
2055
|
+
}
|
|
2056
|
+
},
|
|
2057
|
+
arrowsImgUrl: {
|
|
2058
|
+
type: ["string", "null"],
|
|
2059
|
+
display: {
|
|
2060
|
+
type: "settings-image-input"
|
|
2061
|
+
}
|
|
2062
|
+
},
|
|
2063
|
+
offset: {
|
|
2064
|
+
type: "object",
|
|
2065
|
+
display: {
|
|
2066
|
+
type: "offset-controls"
|
|
2067
|
+
},
|
|
2068
|
+
properties: {
|
|
2069
|
+
x: {
|
|
2070
|
+
type: "number"
|
|
2071
|
+
},
|
|
2072
|
+
y: {
|
|
2073
|
+
type: "number"
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
},
|
|
2077
|
+
scale: {
|
|
2078
|
+
type: "number",
|
|
2079
|
+
title: "Scale",
|
|
2080
|
+
min: 0,
|
|
2081
|
+
max: 1,
|
|
2082
|
+
display: {
|
|
2083
|
+
type: "range-control"
|
|
2084
|
+
}
|
|
2085
|
+
},
|
|
2086
|
+
color: {
|
|
2087
|
+
title: "Color",
|
|
2088
|
+
type: "string",
|
|
2089
|
+
display: {
|
|
2090
|
+
type: "settings-color-picker",
|
|
2091
|
+
format: "single"
|
|
2092
|
+
}
|
|
2093
|
+
},
|
|
2094
|
+
hover: {
|
|
2095
|
+
title: "Hover",
|
|
2096
|
+
type: "string",
|
|
2097
|
+
display: {
|
|
2098
|
+
type: "settings-color-picker",
|
|
2099
|
+
format: "single"
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
},
|
|
2104
|
+
area: {
|
|
2105
|
+
title: "AREA",
|
|
2106
|
+
icon: "background",
|
|
2107
|
+
tooltip: "Area",
|
|
2108
|
+
type: "object",
|
|
2109
|
+
properties: {
|
|
2110
|
+
color: {
|
|
2111
|
+
type: "string",
|
|
2112
|
+
display: {
|
|
2113
|
+
type: "settings-color-picker",
|
|
2114
|
+
format: "single"
|
|
2115
|
+
}
|
|
2116
|
+
},
|
|
2117
|
+
blur: {
|
|
2118
|
+
type: "number",
|
|
2119
|
+
label: "icon:blur",
|
|
2120
|
+
display: {
|
|
2121
|
+
type: "numeric-input"
|
|
2122
|
+
}
|
|
2123
|
+
},
|
|
2124
|
+
closeIconUrl: {
|
|
2125
|
+
type: ["string", "null"],
|
|
2126
|
+
title: "CLOSE ICON",
|
|
2127
|
+
display: {
|
|
2128
|
+
type: "settings-image-input"
|
|
2129
|
+
}
|
|
2130
|
+
},
|
|
2131
|
+
closeIconAlign: {
|
|
2132
|
+
display: {
|
|
2133
|
+
type: "align-grid",
|
|
2134
|
+
direction: "horizontal"
|
|
2135
|
+
},
|
|
2136
|
+
type: "string",
|
|
2137
|
+
enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
|
|
2138
|
+
},
|
|
2139
|
+
closeIconOffset: {
|
|
2140
|
+
type: "object",
|
|
2141
|
+
display: {
|
|
2142
|
+
type: "offset-controls"
|
|
2143
|
+
},
|
|
2144
|
+
properties: {
|
|
2145
|
+
x: {
|
|
2146
|
+
type: "number"
|
|
2147
|
+
},
|
|
2148
|
+
y: {
|
|
2149
|
+
type: "number"
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
},
|
|
2155
|
+
caption: {
|
|
2156
|
+
title: "DESC",
|
|
2157
|
+
icon: "text-icon",
|
|
2158
|
+
tooltip: "Description",
|
|
2159
|
+
type: "object",
|
|
2160
|
+
properties: {
|
|
2161
|
+
alignment: {
|
|
2162
|
+
type: "string",
|
|
2163
|
+
display: {
|
|
2164
|
+
type: "align-grid"
|
|
2165
|
+
},
|
|
2166
|
+
enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
|
|
2167
|
+
},
|
|
2168
|
+
offset: {
|
|
2169
|
+
type: "object",
|
|
2170
|
+
display: {
|
|
2171
|
+
type: "offset-controls"
|
|
2172
|
+
},
|
|
2173
|
+
properties: {
|
|
2174
|
+
x: {
|
|
2175
|
+
type: "number"
|
|
2176
|
+
},
|
|
2177
|
+
y: {
|
|
2178
|
+
type: "number"
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
},
|
|
2182
|
+
color: {
|
|
2183
|
+
title: "Color",
|
|
2184
|
+
type: "string",
|
|
2185
|
+
display: {
|
|
2186
|
+
type: "settings-color-picker",
|
|
2187
|
+
format: "single"
|
|
2188
|
+
}
|
|
2189
|
+
},
|
|
2190
|
+
hover: {
|
|
2191
|
+
title: "Hover",
|
|
2192
|
+
type: "string",
|
|
2193
|
+
display: {
|
|
2194
|
+
type: "settings-color-picker",
|
|
2195
|
+
format: "single"
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
},
|
|
2201
|
+
default: {
|
|
2202
|
+
cover: {
|
|
2203
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMHNP08T27H1649S67NZV.png"
|
|
2204
|
+
},
|
|
2205
|
+
appear: {
|
|
2206
|
+
type: "slide in",
|
|
2207
|
+
duration: "1000ms",
|
|
2208
|
+
direction: "right",
|
|
2209
|
+
repeat: "close"
|
|
2210
|
+
},
|
|
2211
|
+
triggers: {
|
|
2212
|
+
type: "click",
|
|
2213
|
+
switch: "image",
|
|
2214
|
+
duration: "2000ms"
|
|
2215
|
+
},
|
|
2216
|
+
slider: {
|
|
2217
|
+
type: "fade",
|
|
2218
|
+
direction: "horiz"
|
|
2219
|
+
},
|
|
2220
|
+
thumbnail: {
|
|
2221
|
+
isActive: true,
|
|
2222
|
+
position: "bottom-center",
|
|
2223
|
+
fit: "cover",
|
|
2224
|
+
align: "center",
|
|
2225
|
+
triggers: "click",
|
|
2226
|
+
grid: {
|
|
2227
|
+
height: 60,
|
|
2228
|
+
gap: 8
|
|
2229
|
+
},
|
|
2230
|
+
offset: { x: 0, y: 0 },
|
|
2231
|
+
opacity: 100,
|
|
2232
|
+
activeState: {
|
|
2233
|
+
scale: 1,
|
|
2234
|
+
opacity: 100
|
|
2235
|
+
}
|
|
2236
|
+
},
|
|
2237
|
+
layout: {
|
|
2238
|
+
position: "middle-center",
|
|
2239
|
+
offset: { x: 0, y: 0 },
|
|
2240
|
+
padding: { top: 0, right: 0, bottom: 0, left: 0 }
|
|
2241
|
+
},
|
|
2242
|
+
controls: {
|
|
2243
|
+
isActive: true,
|
|
2244
|
+
arrowsImgUrl: null,
|
|
2245
|
+
offset: { x: 0, y: 0 },
|
|
2246
|
+
scale: 1,
|
|
2247
|
+
color: "#000000",
|
|
2248
|
+
hover: "#cccccc"
|
|
2249
|
+
},
|
|
2250
|
+
area: {
|
|
2251
|
+
color: "rgba(0,0,0,0.9)",
|
|
2252
|
+
blur: 0,
|
|
2253
|
+
closeIconUrl: null,
|
|
2254
|
+
closeIconAlign: "top-right",
|
|
2255
|
+
closeIconOffset: { x: 12, y: 12 }
|
|
2256
|
+
},
|
|
2257
|
+
caption: {
|
|
2258
|
+
alignment: "middle-center",
|
|
2259
|
+
offset: { x: 0, y: 0 },
|
|
2260
|
+
color: "#000000",
|
|
2261
|
+
hover: "#cccccc"
|
|
2262
|
+
}
|
|
2263
|
+
},
|
|
2264
|
+
displayRules: [
|
|
2265
|
+
{
|
|
2266
|
+
if: {
|
|
2267
|
+
name: "appear.type",
|
|
2268
|
+
value: "slide in"
|
|
2269
|
+
},
|
|
2270
|
+
then: {
|
|
2271
|
+
value: true,
|
|
2272
|
+
name: "properties.appear.properties.direction.display.visible"
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
]
|
|
2276
|
+
},
|
|
2277
|
+
content: {
|
|
2278
|
+
layoutBased: false,
|
|
2279
|
+
type: "array",
|
|
2280
|
+
settings: {
|
|
2281
|
+
addItemFromFileExplorer: true,
|
|
2282
|
+
defaultWidth: 500
|
|
2283
|
+
},
|
|
2284
|
+
items: {
|
|
2285
|
+
type: "object",
|
|
2286
|
+
properties: {
|
|
2287
|
+
image: {
|
|
2288
|
+
type: "object",
|
|
2289
|
+
display: {
|
|
2290
|
+
type: "media-input",
|
|
2291
|
+
label: "Image",
|
|
2292
|
+
minWidth: 58,
|
|
2293
|
+
maxWidth: 108
|
|
2294
|
+
},
|
|
2295
|
+
properties: {
|
|
2296
|
+
url: {
|
|
2297
|
+
type: "string"
|
|
2298
|
+
},
|
|
2299
|
+
name: {
|
|
2300
|
+
type: "string"
|
|
2301
|
+
},
|
|
2302
|
+
objectFit: {
|
|
2303
|
+
type: "string",
|
|
2304
|
+
enum: ["cover", "contain"]
|
|
2305
|
+
}
|
|
2306
|
+
},
|
|
2307
|
+
required: ["url", "name"]
|
|
2308
|
+
},
|
|
2309
|
+
imageCaption: {
|
|
2310
|
+
display: {
|
|
2311
|
+
type: "rich-text",
|
|
2312
|
+
label: "Description",
|
|
2313
|
+
placeholder: "Add Caption...",
|
|
2314
|
+
minWidth: 300,
|
|
2315
|
+
maxWidth: 550
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
},
|
|
2319
|
+
required: ["image"]
|
|
2320
|
+
},
|
|
2321
|
+
default: [
|
|
2322
|
+
{
|
|
2323
|
+
image: {
|
|
2324
|
+
objectFit: "cover",
|
|
2325
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMHNP08T27H1649S67NZV.png",
|
|
2326
|
+
name: "Slider-1.png"
|
|
2327
|
+
},
|
|
2328
|
+
imageCaption: [
|
|
2329
|
+
{
|
|
2330
|
+
type: "paragraph",
|
|
2331
|
+
children: [{ text: "" }]
|
|
2332
|
+
}
|
|
2333
|
+
]
|
|
2334
|
+
},
|
|
2335
|
+
{
|
|
2336
|
+
image: {
|
|
2337
|
+
objectFit: "cover",
|
|
2338
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMTZA3RYMXKF0M095D6JD.png",
|
|
2339
|
+
name: "Slider-2.png"
|
|
2340
|
+
},
|
|
2341
|
+
imageCaption: [
|
|
2342
|
+
{
|
|
2343
|
+
type: "paragraph",
|
|
2344
|
+
children: [{ text: "" }]
|
|
2345
|
+
}
|
|
2346
|
+
]
|
|
2347
|
+
},
|
|
2348
|
+
{
|
|
2349
|
+
image: {
|
|
2350
|
+
objectFit: "cover",
|
|
2351
|
+
url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMVSCMPVJBG2WF5KJZYHZ.png",
|
|
2352
|
+
name: "Slider-3.png"
|
|
2353
|
+
},
|
|
2354
|
+
imageCaption: [
|
|
2355
|
+
{
|
|
2356
|
+
type: "paragraph",
|
|
2357
|
+
children: [{ text: "" }]
|
|
2358
|
+
}
|
|
2359
|
+
]
|
|
2360
|
+
}
|
|
2361
|
+
]
|
|
2362
|
+
},
|
|
2363
|
+
styles: {
|
|
2364
|
+
layoutBased: true,
|
|
2365
|
+
type: "object",
|
|
2366
|
+
properties: {
|
|
2367
|
+
caption: {
|
|
2368
|
+
dataName: "caption",
|
|
2369
|
+
type: "object",
|
|
2370
|
+
properties: {
|
|
2371
|
+
fontSettings: {
|
|
2372
|
+
type: "object",
|
|
2373
|
+
display: {
|
|
2374
|
+
type: "font-settings"
|
|
2375
|
+
},
|
|
2376
|
+
properties: {
|
|
2377
|
+
fontFamily: {
|
|
2378
|
+
type: "string"
|
|
2379
|
+
},
|
|
2380
|
+
fontWeight: {
|
|
2381
|
+
type: "number"
|
|
2382
|
+
},
|
|
2383
|
+
fontStyle: {
|
|
2384
|
+
type: "string"
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
},
|
|
2388
|
+
widthSettings: {
|
|
2389
|
+
display: {
|
|
2390
|
+
type: "text-width-control"
|
|
2391
|
+
},
|
|
2392
|
+
type: "object",
|
|
2393
|
+
properties: {
|
|
2394
|
+
width: {
|
|
2395
|
+
type: "number"
|
|
2396
|
+
},
|
|
2397
|
+
sizing: {
|
|
2398
|
+
type: "string",
|
|
2399
|
+
enum: ["auto", "manual"]
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
},
|
|
2403
|
+
fontSizeLineHeight: {
|
|
2404
|
+
type: "object",
|
|
2405
|
+
display: {
|
|
2406
|
+
type: "font-size-line-height"
|
|
2407
|
+
},
|
|
2408
|
+
properties: {
|
|
2409
|
+
fontSize: {
|
|
2410
|
+
type: "number"
|
|
2411
|
+
},
|
|
2412
|
+
lineHeight: {
|
|
2413
|
+
type: "number"
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
},
|
|
2417
|
+
letterSpacing: {
|
|
2418
|
+
display: {
|
|
2419
|
+
type: "letter-spacing-input"
|
|
2420
|
+
},
|
|
2421
|
+
type: "number"
|
|
2422
|
+
},
|
|
2423
|
+
wordSpacing: {
|
|
2424
|
+
display: {
|
|
2425
|
+
type: "word-spacing-input"
|
|
2426
|
+
},
|
|
2427
|
+
type: "number"
|
|
2428
|
+
},
|
|
2429
|
+
textAlign: {
|
|
2430
|
+
display: {
|
|
2431
|
+
type: "text-align-control"
|
|
2432
|
+
},
|
|
2433
|
+
type: "string",
|
|
2434
|
+
enum: ["left", "center", "right", "justify"]
|
|
2435
|
+
},
|
|
2436
|
+
textAppearance: {
|
|
2437
|
+
display: {
|
|
2438
|
+
type: "text-appearance"
|
|
2439
|
+
},
|
|
2440
|
+
properties: {
|
|
2441
|
+
textTransform: {
|
|
2442
|
+
type: "string",
|
|
2443
|
+
enum: ["none", "uppercase", "lowercase", "capitalize"]
|
|
2444
|
+
},
|
|
2445
|
+
textDecoration: {
|
|
2446
|
+
type: "string",
|
|
2447
|
+
enum: ["none", "underline"]
|
|
2448
|
+
},
|
|
2449
|
+
fontVariant: {
|
|
2450
|
+
type: "string",
|
|
2451
|
+
enum: ["normal", "small-caps"]
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
},
|
|
2455
|
+
color: {
|
|
2456
|
+
display: {
|
|
2457
|
+
type: "style-panel-color-picker"
|
|
2458
|
+
},
|
|
2459
|
+
type: "string"
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
},
|
|
2464
|
+
default: {
|
|
2465
|
+
caption: {
|
|
2466
|
+
widthSettings: {
|
|
2467
|
+
width: 0.13,
|
|
2468
|
+
sizing: "auto"
|
|
2469
|
+
},
|
|
2470
|
+
fontSettings: {
|
|
2471
|
+
fontFamily: "Arial",
|
|
2472
|
+
fontWeight: 400,
|
|
2473
|
+
fontStyle: "normal"
|
|
2474
|
+
},
|
|
2475
|
+
fontSizeLineHeight: {
|
|
2476
|
+
fontSize: 0.02,
|
|
2477
|
+
lineHeight: 0.02
|
|
2478
|
+
},
|
|
2479
|
+
letterSpacing: 0,
|
|
2480
|
+
wordSpacing: 0,
|
|
2481
|
+
textAlign: "left",
|
|
2482
|
+
textAppearance: {
|
|
2483
|
+
textTransform: "none",
|
|
2484
|
+
textDecoration: "none",
|
|
2485
|
+
fontVariant: "normal"
|
|
2486
|
+
},
|
|
2487
|
+
color: "#000000"
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
},
|
|
2492
|
+
required: ["settings", "content", "styles"]
|
|
2493
|
+
}
|
|
2494
|
+
};
|
|
1441
2495
|
const components = [
|
|
1442
2496
|
ControlSliderComponent,
|
|
1443
|
-
ControlImageRevealSliderComponent
|
|
2497
|
+
ControlImageRevealSliderComponent,
|
|
2498
|
+
LightboxComponent
|
|
1444
2499
|
];
|
|
1445
2500
|
export {
|
|
1446
2501
|
components
|