@cntrl-site/components 0.1.0-alpha.8 → 0.1.0

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