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