@cntrl-site/components 0.1.0-alpha.9 → 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,56 +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();
1579
- }
1580
- };
1581
- const handleContentClick = (e) => {
1582
- if (!closeOnBackdropClick) return;
1583
- const target = e.target;
1584
- const currentTarget = e.currentTarget;
1585
- if (target === currentTarget) {
1586
- onClose();
1587
- return;
1756
+ const { widthSettings, fontSettings, letterSpacing, textAlign, wordSpacing, fontSizeLineHeight, textAppearance, color } = lightboxStyles.caption;
1757
+ const { appearClass, backdropAppearClass, backdropDisappearClass, disappearClass } = getAnimationClasses(appear.type, appear.direction);
1758
+ useEffect(() => {
1759
+ const handleLayoutChange = () => {
1760
+ setTimeout(() => {
1761
+ var _a, _b;
1762
+ (_b = (_a = lightboxRef.current) == null ? void 0 : _a.splide) == null ? void 0 : _b.refresh();
1763
+ }, 16);
1764
+ };
1765
+ const handleComponentContentChange = () => {
1766
+ setSplideKey((prev) => prev + 1);
1767
+ };
1768
+ window.addEventListener("ArticleEditor.Layout:change", handleLayoutChange);
1769
+ window.addEventListener("ArticleEditor.ComponentContent:change", handleComponentContentChange);
1770
+ return () => {
1771
+ window.removeEventListener("ArticleEditor.Layout:change", handleLayoutChange);
1772
+ window.removeEventListener("ArticleEditor.ComponentContent:change", handleComponentContentChange);
1773
+ };
1774
+ }, []);
1775
+ const handleClose = useCallback(() => {
1776
+ const isMobile = window.matchMedia("(max-width: 768px)").matches;
1777
+ const colorAlpha = getColorAlpha(area.color);
1778
+ if (isMobile && !isEditor && colorAlpha > 0.9) {
1779
+ document.body.style.backgroundColor = "";
1588
1780
  }
1589
- const isImg = target.tagName === "IMG" || target.closest("img");
1590
- const isButton = target.tagName === "BUTTON" || target.closest("button");
1591
- if (!isImg && !isButton) {
1592
- 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);
1593
1796
  }
1594
- };
1595
- const onImageClick = (e) => {
1797
+ }, [onClose, area.color, isEditor]);
1798
+ const handleTriggerClick = (img2, clientX, clientY) => {
1596
1799
  var _a, _b;
1800
+ if (!img2) return;
1597
1801
  if (triggers.type === "click" && triggers.switch === "image") {
1598
- e.stopPropagation();
1599
- (_a = lightboxRef.current) == null ? void 0 : _a.go("+1");
1600
- }
1601
- if (triggers.type === "click" && triggers.switch === "50/50") {
1602
- e.stopPropagation();
1603
- 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") {
1604
1808
  const rect = img2.getBoundingClientRect();
1605
- const clickX = e.clientX - rect.left;
1606
- const clickY = e.clientY - rect.top;
1809
+ const clickX = clientX - rect.left;
1810
+ const clickY = clientY - rect.top;
1607
1811
  const imgWidth = rect.width;
1608
1812
  const imgHeight = rect.height;
1609
1813
  let dir;
@@ -1615,362 +1819,431 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1615
1819
  (_b = lightboxRef.current) == null ? void 0 : _b.go(dir);
1616
1820
  }
1617
1821
  };
1822
+ const handleImageWrapperClick = (e) => {
1823
+ const currentImage = content[currentIndex];
1824
+ const isCover = (currentImage == null ? void 0 : currentImage.image.objectFit) === "cover";
1825
+ let clientX;
1826
+ let clientY;
1827
+ if ("changedTouches" in e && e.changedTouches.length > 0) {
1828
+ clientX = e.changedTouches[0].clientX;
1829
+ clientY = e.changedTouches[0].clientY;
1830
+ } else if ("clientX" in e) {
1831
+ clientX = e.clientX;
1832
+ clientY = e.clientY;
1833
+ } else {
1834
+ return;
1835
+ }
1836
+ let inside;
1837
+ if (isCover && imageRef.current) {
1838
+ const imgRect = imageRef.current.getBoundingClientRect();
1839
+ inside = clientX >= imgRect.left && clientX <= imgRect.right && clientY >= imgRect.top && clientY <= imgRect.bottom;
1840
+ } else {
1841
+ const rect = imageRef.current ? getDisplayedImageRect(imageRef.current) : null;
1842
+ if (!rect) {
1843
+ if (e.target === e.currentTarget) handleClose();
1844
+ return;
1845
+ }
1846
+ inside = clientX >= rect.x && clientX <= rect.x + rect.width && clientY >= rect.y && clientY <= rect.y + rect.height;
1847
+ }
1848
+ if (inside) {
1849
+ handleTriggerClick(imageRef.current, clientX, clientY);
1850
+ } else {
1851
+ handleClose();
1852
+ }
1853
+ };
1854
+ const onImageClick = (e) => {
1855
+ e.stopPropagation();
1856
+ handleTriggerClick(e.currentTarget, e.clientX, e.clientY);
1857
+ };
1618
1858
  useEffect(() => {
1619
- if (!isOpen || !closeOnEsc) return;
1859
+ if (!isOpen) return;
1620
1860
  const onKeyDown = (event) => {
1861
+ var _a, _b;
1621
1862
  if (event.key === "Escape") {
1622
- onClose();
1863
+ handleClose();
1623
1864
  return;
1624
1865
  }
1625
1866
  if (event.key === "ArrowRight") {
1626
1867
  setCurrentIndex((prev) => (prev + 1) % Math.max(content.length, 1));
1868
+ (_a = lightboxRef.current) == null ? void 0 : _a.go("+1");
1627
1869
  return;
1628
1870
  }
1629
1871
  if (event.key === "ArrowLeft") {
1630
1872
  setCurrentIndex((prev) => (prev - 1 + Math.max(content.length, 1)) % Math.max(content.length, 1));
1873
+ (_b = lightboxRef.current) == null ? void 0 : _b.go("-1");
1631
1874
  }
1632
1875
  };
1633
1876
  window.addEventListener("keydown", onKeyDown);
1634
1877
  return () => {
1635
1878
  window.removeEventListener("keydown", onKeyDown);
1636
1879
  };
1637
- }, [isOpen, closeOnEsc, onClose, content.length]);
1880
+ }, [isOpen, handleClose, content.length]);
1638
1881
  useEffect(() => {
1639
- 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
+ };
1640
1896
  }, [isOpen]);
1897
+ useEffect(() => {
1898
+ if (prevSliderTypeRef.current !== null && prevSliderTypeRef.current !== slider.type) {
1899
+ setSplideKey((prev) => prev + 1);
1900
+ }
1901
+ prevSliderTypeRef.current = slider.type;
1902
+ }, [slider.type]);
1641
1903
  useEffect(() => {
1642
1904
  if (!isOpen) return;
1643
1905
  const originalOverflow = document.body.style.overflow;
1906
+ const isMobile = window.matchMedia("(max-width: 768px)").matches;
1907
+ const colorAlpha = getColorAlpha(area.color);
1644
1908
  document.body.style.overflow = "hidden";
1645
- 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
+ }
1646
1926
  const preventScroll = (e) => e.preventDefault();
1647
1927
  document.addEventListener("touchmove", preventScroll, { passive: false });
1648
1928
  return () => {
1649
1929
  document.body.style.overflow = originalOverflow;
1650
1930
  document.removeEventListener("touchmove", preventScroll);
1651
- 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);
1652
1936
  };
1653
- }, [isOpen]);
1937
+ }, [isOpen, isEditor, area.color]);
1654
1938
  useEffect(() => {
1655
1939
  if (!isOpen) return;
1656
- if (resizeObserverRef.current) {
1657
- resizeObserverRef.current.disconnect();
1658
- resizeObserverRef.current = null;
1659
- }
1660
- const timeoutId = setTimeout(() => {
1661
- const activeSlide = document.querySelector(".splide__slide.is-active");
1662
- if (!activeSlide) return;
1663
- const img2 = activeSlide.querySelector("img");
1664
- const container = activeSlide.querySelector(`.${styles.imgWrapper}`);
1665
- if (!img2 || !container) return;
1666
- const updateImageSize = () => {
1667
- if (!img2.naturalWidth || !img2.naturalHeight) return;
1668
- const imageAspectRatio = img2.naturalWidth / img2.naturalHeight;
1669
- const containerWidth = container.clientWidth;
1670
- const containerHeight = container.clientHeight;
1671
- const containerAspectRatio = containerWidth / containerHeight;
1672
- if (imageAspectRatio > containerAspectRatio) {
1673
- 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;
1674
1953
  } else {
1675
- 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();
1676
1968
  }
1677
- };
1678
- if (img2.complete) {
1679
- updateImageSize();
1680
- } else {
1681
- img2.onload = updateImageSize;
1682
1969
  }
1683
- resizeObserverRef.current = new ResizeObserver(() => {
1684
- updateImageSize();
1685
- });
1686
- resizeObserverRef.current.observe(container);
1687
- resizeObserverRef.current.observe(img2);
1688
- }, 0);
1970
+ };
1971
+ document.addEventListener("touchend", handleTouchEnd, { passive: true });
1689
1972
  return () => {
1690
- clearTimeout(timeoutId);
1691
- if (resizeObserverRef.current) {
1692
- resizeObserverRef.current.disconnect();
1693
- resizeObserverRef.current = null;
1694
- }
1973
+ document.removeEventListener("touchend", handleTouchEnd);
1695
1974
  };
1696
- }, [isOpen, currentIndex, content]);
1697
- const handleArrowClick = (dir) => {
1698
- var _a;
1699
- (_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"
1700
1982
  };
1701
- const appearDurationMs = appear.duration ? parseInt(appear.duration) : 300;
1702
- const backdropDurationMs = appear.type === "fade in" || appear.type === "mix" ? Math.floor(appearDurationMs * 0.7) : appearDurationMs;
1703
- const appearClass = (() => {
1704
- if (appear.type === "fade in") return styles.fadeIn;
1705
- if (appear.type === "slide in" || appear.type === "mix") {
1706
- switch (appear.direction) {
1707
- case "left":
1708
- return styles.slideInLeft;
1709
- case "right":
1710
- return styles.slideInRight;
1711
- case "top":
1712
- return styles.slideInTop;
1713
- case "bottom":
1714
- return styles.slideInBottom;
1715
- default:
1716
- return styles.slideInRight;
1717
- }
1718
- }
1719
- return styles.fadeIn;
1720
- })();
1721
- const backdropAppearClass = (() => {
1722
- if (appear.type === "fade in" || appear.type === "mix") return styles.fadeIn;
1723
- if (appear.type === "slide in") {
1724
- switch (appear.direction) {
1725
- case "left":
1726
- return styles.slideInLeft;
1727
- case "right":
1728
- return styles.slideInRight;
1729
- case "top":
1730
- return styles.slideInTop;
1731
- case "bottom":
1732
- return styles.slideInBottom;
1733
- default:
1734
- return styles.slideInRight;
1735
- }
1736
- }
1737
- return styles.fadeIn;
1738
- })();
1739
- if (!isOpen) return null;
1983
+ if (!isOpen && !isClosing) return null;
1740
1984
  return createPortal(
1741
1985
  /* @__PURE__ */ jsxs(Fragment, { children: [
1742
1986
  /* @__PURE__ */ jsx(
1743
1987
  "div",
1744
1988
  {
1745
- className: cn(styles.background, backdropAppearClass),
1746
- 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
+ }
1747
1995
  }
1748
1996
  ),
1749
- /* @__PURE__ */ jsx(
1997
+ /* @__PURE__ */ jsxs(
1750
1998
  "div",
1751
1999
  {
1752
- className: cn(styles.backdropStyle, { [styles.editor]: isEditor }),
1753
- onClick: handleBackdropClick,
1754
- onTouchEnd: handleBackdropClick,
1755
- children: /* @__PURE__ */ jsxs(
1756
- "div",
1757
- {
1758
- className: cn(styles.contentStyle, appearClass),
1759
- onClick: handleContentClick,
1760
- style: {
1761
- animationDuration: `${appearDurationMs}ms`,
1762
- animationTimingFunction: "ease",
1763
- animationFillMode: "both",
1764
- ...appear.type === "mix" && { animationDelay: `${backdropDurationMs}ms` },
1765
- "--splide-speed": triggers.duration || "500ms"
1766
- },
1767
- children: [
1768
- /* @__PURE__ */ jsx(
1769
- Splide,
1770
- {
1771
- onMove: (splide) => {
1772
- setCurrentIndex(splide.index);
1773
- },
1774
- ref: lightboxRef,
1775
- className: styles.lightboxSplide,
1776
- options: {
1777
- arrows: false,
1778
- speed: triggers.duration ? parseInt(triggers.duration) : 500,
1779
- direction: slider.direction === "horiz" || slider.type === "fade" || slider.type === "scale" ? "ltr" : "ttb",
1780
- pagination: false,
1781
- drag: triggers.type === "drag",
1782
- perPage: 1,
1783
- width: "100%",
1784
- height: "100%",
1785
- type: slider.type === "fade" || slider.type === "scale" ? "fade" : "loop",
1786
- padding: 0,
1787
- rewind: (slider.type === "scale" || slider.type === "fade") && appear.repeat !== "close"
1788
- },
1789
- style: { "--splide-speed": triggers.duration || "500ms" },
1790
- children: content.map((item, index) => {
1791
- const positionStyles = getPositionStyles(layout.position, layout.offset);
1792
- const imageStyle2 = slider.type === "scale" ? (() => {
1793
- const { transform, ...restStyles } = positionStyles;
1794
- return {
1795
- ...restStyles,
1796
- "--position-transform": transform || "none"
1797
- };
1798
- })() : positionStyles;
1799
- return /* @__PURE__ */ jsx(SplideSlide, { children: /* @__PURE__ */ jsx(
1800
- "div",
1801
- {
1802
- className: styles.imgWrapper,
1803
- onClick: handleImageWrapperClick,
1804
- style: {
1805
- padding: `${layout.padding.top}px ${layout.padding.right}px ${layout.padding.bottom}px ${layout.padding.left}px`
1806
- },
1807
- children: /* @__PURE__ */ jsx(
1808
- "img",
1809
- {
1810
- className: cn(styles.imageStyle, {
1811
- [styles.contain]: item.image.objectFit === "contain",
1812
- [styles.cover]: item.image.objectFit === "cover",
1813
- [styles.scaleSlide]: slider.type === "scale"
1814
- }),
1815
- src: item.image.url,
1816
- alt: item.image.name ?? "",
1817
- onClick: onImageClick,
1818
- style: imageStyle2
1819
- }
1820
- )
1821
- }
1822
- ) }, index);
1823
- })
1824
- }
1825
- ),
1826
- controls.isActive && /* @__PURE__ */ jsxs(Fragment, { children: [
1827
- /* @__PURE__ */ jsx(
1828
- "div",
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",
1829
2043
  {
1830
- className: cn(styles.arrow, { [styles.arrowVertical]: slider.direction === "vert" }),
1831
- style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
1832
- children: /* @__PURE__ */ jsx(
1833
- "button",
1834
- {
1835
- className: styles.arrowInner,
1836
- style: {
1837
- transform: `translate(${scalingValue(controls.offset.x)}, ${scalingValue(controls.offset.y * (slider.direction === "horiz" ? 1 : -1))}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
1838
- },
1839
- onClick: (e) => {
1840
- handleArrowClick("-1");
1841
- },
1842
- children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
1843
- SvgImage,
1844
- {
1845
- url: controls.arrowsImgUrl,
1846
- fill: controls.color,
1847
- hoverFill: controls.hover,
1848
- className: cn(styles.arrowImg, styles.mirror)
1849
- }
1850
- )
1851
- }
1852
- )
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" }
1853
2054
  }
1854
- ),
1855
- /* @__PURE__ */ jsx(
1856
- "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",
1857
2068
  {
1858
- className: cn(styles.arrow, styles.nextArrow, { [styles.arrowVertical]: slider.direction === "vert" }),
1859
- style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
1860
- children: /* @__PURE__ */ jsx(
1861
- "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,
1862
2078
  {
1863
- className: styles.arrowInner,
1864
- style: {
1865
- transform: `translate(${scalingValue(controls.offset.x * (slider.direction === "horiz" ? -1 : 1))}, ${scalingValue(controls.offset.y)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
1866
- },
1867
- onClick: (e) => {
1868
- handleArrowClick("+1");
1869
- },
1870
- "aria-label": "Next",
1871
- children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
1872
- SvgImage,
1873
- {
1874
- url: controls.arrowsImgUrl,
1875
- fill: controls.color,
1876
- hoverFill: controls.hover,
1877
- className: styles.arrowImg
1878
- }
1879
- )
2079
+ url: controls.arrowsImgUrl,
2080
+ fill: controls.color,
2081
+ hoverFill: controls.hover,
2082
+ className: cn(classes.arrowImg, classes.mirror)
1880
2083
  }
1881
2084
  )
1882
2085
  }
1883
2086
  )
1884
- ] }),
1885
- area.closeIconUrl && (() => {
1886
- const positionStyles = getPositionStyles(area.closeIconAlign, area.closeIconOffset);
1887
- const scaleTransform = `scale(${area.closeIconScale})`;
1888
- const combinedTransform = positionStyles.transform ? `${positionStyles.transform} ${scaleTransform}` : scaleTransform;
1889
- 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(
1890
2095
  "button",
1891
2096
  {
1892
- className: styles.closeButton,
1893
- style: {
1894
- ...positionStyles,
1895
- 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");
1896
2102
  },
1897
- onClick: onClose,
1898
- 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
+ )
1899
2113
  }
1900
- );
1901
- })(),
1902
- 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(
1903
2146
  "div",
1904
2147
  {
1905
- className: styles.caption,
1906
- style: {
1907
- ...getPositionStyles(caption2.alignment, caption2.offset),
1908
- ["--link-hover-color"]: caption2.hover
1909
- },
2148
+ "data-styles": "caption",
2149
+ className: classes.captionTextInner,
2150
+ style: { ["--link-hover-color"]: caption2.hover },
1910
2151
  children: /* @__PURE__ */ jsx(RichTextRenderer, { content: content[currentIndex].imageCaption })
1911
2152
  }
1912
- ),
1913
- thumbnail.isActive && /* @__PURE__ */ jsx(
1914
- "div",
1915
- {
1916
- className: cn(
1917
- styles.thumbsContainer,
1918
- {
1919
- [styles.thumbsContainerVertical]: slider.direction === "vert",
1920
- [styles.thumbsAlignStart]: thumbnail.align === "start",
1921
- [styles.thumbsAlignCenter]: thumbnail.align === "center",
1922
- [styles.thumbsAlignEnd]: thumbnail.align === "end"
1923
- }
1924
- ),
1925
- style: {
1926
- gap: `${thumbnail.grid.gap}px`,
1927
- ...slider.direction === "horiz" ? { height: `${thumbnail.grid.height}px` } : {},
1928
- ...slider.direction === "vert" ? { width: `${thumbnail.grid.width}px` } : {},
1929
- ...getPositionStyles(thumbnail.position, thumbnail.offset)
1930
- },
1931
- children: content.map((item, index) => {
1932
- const isActive = index === currentIndex;
1933
- return /* @__PURE__ */ jsx(
1934
- "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",
1935
2221
  {
1936
- className: styles.thumbItem,
1937
- style: {
1938
- transform: `scale(${isActive ? thumbnail.activeState.scale : 1})`,
1939
- ...slider.direction === "horiz" ? { height: "100%" } : {},
1940
- ...slider.direction === "vert" ? { width: "100%" } : {},
1941
- opacity: isActive ? thumbnail.activeState.opacity : thumbnail.opacity,
1942
- ["--thumb-hover"]: thumbnail.activeState.opacity
1943
- },
1944
- onClick: (e) => {
1945
- var _a;
1946
- e.stopPropagation();
1947
- setCurrentIndex(index);
1948
- (_a = lightboxRef.current) == null ? void 0 : _a.go(index);
1949
- },
1950
- children: /* @__PURE__ */ jsx(
1951
- "img",
1952
- {
1953
- src: item.image.url,
1954
- alt: item.image.name ?? "",
1955
- className: styles.thumbImage,
1956
- style: {
1957
- objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
1958
- ...thumbnail.fit === "fit" && slider.direction === "horiz" ? { width: "fit-content" } : {},
1959
- ...thumbnail.fit === "fit" && slider.direction === "vert" ? { height: "fit-content" } : {},
1960
- ...slider.direction === "horiz" ? { height: "100%" } : {},
1961
- ...slider.direction === "vert" ? { width: "100%" } : {}
1962
- }
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
+ }));
1963
2231
  }
1964
- )
1965
- },
1966
- `${item.image.url}-${index}`
1967
- );
1968
- })
1969
- }
1970
- )
1971
- ]
1972
- }
1973
- )
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
+ ]
1974
2247
  }
1975
2248
  )
1976
2249
  ] }),
@@ -1983,11 +2256,11 @@ const LightboxComponent = {
1983
2256
  name: "Lightbox",
1984
2257
  preview: {
1985
2258
  type: "video",
1986
- url: "https://cdn.cntrl.site/projects/01GJ2SPDSH73MC92WW7ZA2CWBY/articles-assets/01KA24CHYZXJBZ0Q714B05A7VD.mp4"
2259
+ url: "https://cdn.cntrl.site/component-assets/lightbox.mp4"
1987
2260
  },
1988
2261
  defaultSize: {
1989
- width: 400,
1990
- height: 400
2262
+ width: 440,
2263
+ height: 550
1991
2264
  },
1992
2265
  schema: {
1993
2266
  type: "object",
@@ -2012,7 +2285,7 @@ const LightboxComponent = {
2012
2285
  url: {
2013
2286
  type: "string",
2014
2287
  display: {
2015
- type: "settings-image-input"
2288
+ type: "cover-image-input"
2016
2289
  }
2017
2290
  }
2018
2291
  }
@@ -2054,14 +2327,6 @@ const LightboxComponent = {
2054
2327
  type: "direction-control"
2055
2328
  },
2056
2329
  enum: ["top", "left", "right", "bottom"]
2057
- },
2058
- repeat: {
2059
- type: "string",
2060
- title: "Repeat",
2061
- display: {
2062
- type: "ratio-group"
2063
- },
2064
- enum: ["close", "loop"]
2065
2330
  }
2066
2331
  }
2067
2332
  },
@@ -2085,13 +2350,14 @@ const LightboxComponent = {
2085
2350
  },
2086
2351
  enum: ["image", "50/50"]
2087
2352
  },
2088
- duration: {
2353
+ repeat: {
2089
2354
  type: "string",
2090
- label: "T",
2355
+ title: "Repeat",
2091
2356
  display: {
2092
- type: "step-selector"
2357
+ visible: false,
2358
+ type: "ratio-group"
2093
2359
  },
2094
- enum: ["100ms", "250ms", "500ms", "1000ms", "1500ms", "2000ms"]
2360
+ enum: ["close", "loop"]
2095
2361
  }
2096
2362
  }
2097
2363
  },
@@ -2114,6 +2380,14 @@ const LightboxComponent = {
2114
2380
  type: "ratio-group"
2115
2381
  },
2116
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"]
2117
2391
  }
2118
2392
  }
2119
2393
  },
@@ -2168,25 +2442,20 @@ const LightboxComponent = {
2168
2442
  type: "group"
2169
2443
  },
2170
2444
  properties: {
2171
- height: {
2445
+ size: {
2172
2446
  type: "number",
2173
- label: "H",
2447
+ label: "Box",
2448
+ scalingEnabled: true,
2174
2449
  display: {
2175
2450
  type: "numeric-input",
2176
2451
  visible: true
2177
2452
  }
2178
2453
  },
2179
- width: {
2180
- type: "number",
2181
- label: "W",
2182
- display: {
2183
- type: "numeric-input",
2184
- visible: false
2185
- }
2186
- },
2187
2454
  gap: {
2188
2455
  type: "number",
2189
2456
  label: "Gap",
2457
+ scalingEnabled: true,
2458
+ min: 0,
2190
2459
  display: {
2191
2460
  type: "numeric-input"
2192
2461
  }
@@ -2195,15 +2464,28 @@ const LightboxComponent = {
2195
2464
  },
2196
2465
  offset: {
2197
2466
  type: "object",
2467
+ title: "Offset",
2198
2468
  display: {
2199
- type: "offset-controls"
2469
+ type: "group"
2200
2470
  },
2201
2471
  properties: {
2202
2472
  x: {
2203
- type: "number"
2473
+ type: "number",
2474
+ label: "X",
2475
+ scalingEnabled: true,
2476
+ display: {
2477
+ type: "numeric-input",
2478
+ visible: true
2479
+ }
2204
2480
  },
2205
2481
  y: {
2206
- type: "number"
2482
+ type: "number",
2483
+ label: "Y",
2484
+ scalingEnabled: true,
2485
+ display: {
2486
+ type: "numeric-input",
2487
+ visible: true
2488
+ }
2207
2489
  }
2208
2490
  }
2209
2491
  },
@@ -2228,7 +2510,7 @@ const LightboxComponent = {
2228
2510
  scale: {
2229
2511
  type: "number",
2230
2512
  title: "Scale",
2231
- min: 0.5,
2513
+ min: 1,
2232
2514
  max: 5,
2233
2515
  step: 0.1,
2234
2516
  display: {
@@ -2265,15 +2547,28 @@ const LightboxComponent = {
2265
2547
  },
2266
2548
  offset: {
2267
2549
  type: "object",
2550
+ title: "Offset",
2268
2551
  display: {
2269
- type: "offset-controls"
2552
+ type: "group"
2270
2553
  },
2271
2554
  properties: {
2272
2555
  x: {
2273
- type: "number"
2556
+ type: "number",
2557
+ label: "X",
2558
+ scalingEnabled: true,
2559
+ display: {
2560
+ type: "numeric-input",
2561
+ visible: true
2562
+ }
2274
2563
  },
2275
2564
  y: {
2276
- type: "number"
2565
+ type: "number",
2566
+ label: "Y",
2567
+ scalingEnabled: true,
2568
+ display: {
2569
+ type: "numeric-input",
2570
+ visible: true
2571
+ }
2277
2572
  }
2278
2573
  }
2279
2574
  },
@@ -2285,15 +2580,23 @@ const LightboxComponent = {
2285
2580
  },
2286
2581
  properties: {
2287
2582
  top: {
2583
+ min: 0,
2584
+ step: 1,
2288
2585
  type: "number"
2289
2586
  },
2290
2587
  left: {
2588
+ min: 0,
2589
+ step: 1,
2291
2590
  type: "number"
2292
2591
  },
2293
2592
  right: {
2593
+ min: 0,
2594
+ step: 1,
2294
2595
  type: "number"
2295
2596
  },
2296
2597
  bottom: {
2598
+ min: 0,
2599
+ step: 1,
2297
2600
  type: "number"
2298
2601
  }
2299
2602
  }
@@ -2319,16 +2622,29 @@ const LightboxComponent = {
2319
2622
  }
2320
2623
  },
2321
2624
  offset: {
2625
+ title: "Offset",
2322
2626
  type: "object",
2323
2627
  display: {
2324
- type: "offset-controls"
2628
+ type: "group"
2325
2629
  },
2326
2630
  properties: {
2327
2631
  x: {
2328
- type: "number"
2632
+ type: "number",
2633
+ label: "X",
2634
+ scalingEnabled: true,
2635
+ display: {
2636
+ type: "numeric-input",
2637
+ visible: true
2638
+ }
2329
2639
  },
2330
2640
  y: {
2331
- type: "number"
2641
+ type: "number",
2642
+ label: "Y",
2643
+ scalingEnabled: true,
2644
+ display: {
2645
+ type: "numeric-input",
2646
+ visible: true
2647
+ }
2332
2648
  }
2333
2649
  }
2334
2650
  },
@@ -2407,15 +2723,28 @@ const LightboxComponent = {
2407
2723
  },
2408
2724
  closeIconOffset: {
2409
2725
  type: "object",
2726
+ title: "Offset",
2410
2727
  display: {
2411
- type: "offset-controls"
2728
+ type: "group"
2412
2729
  },
2413
2730
  properties: {
2414
2731
  x: {
2415
- type: "number"
2732
+ type: "number",
2733
+ label: "X",
2734
+ scalingEnabled: true,
2735
+ display: {
2736
+ type: "numeric-input",
2737
+ visible: true
2738
+ }
2416
2739
  },
2417
2740
  y: {
2418
- type: "number"
2741
+ type: "number",
2742
+ label: "Y",
2743
+ scalingEnabled: true,
2744
+ display: {
2745
+ type: "numeric-input",
2746
+ visible: true
2747
+ }
2419
2748
  }
2420
2749
  }
2421
2750
  }
@@ -2441,21 +2770,34 @@ const LightboxComponent = {
2441
2770
  enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
2442
2771
  },
2443
2772
  offset: {
2773
+ title: "Offset",
2444
2774
  type: "object",
2445
2775
  display: {
2446
- type: "offset-controls"
2776
+ type: "group"
2447
2777
  },
2448
2778
  properties: {
2449
2779
  x: {
2450
- type: "number"
2780
+ type: "number",
2781
+ label: "X",
2782
+ scalingEnabled: true,
2783
+ display: {
2784
+ type: "numeric-input",
2785
+ visible: true
2786
+ }
2451
2787
  },
2452
2788
  y: {
2453
- type: "number"
2789
+ type: "number",
2790
+ label: "Y",
2791
+ scalingEnabled: true,
2792
+ display: {
2793
+ type: "numeric-input",
2794
+ visible: true
2795
+ }
2454
2796
  }
2455
2797
  }
2456
2798
  },
2457
2799
  hover: {
2458
- title: "Hover",
2800
+ title: "Link Hover",
2459
2801
  type: "string",
2460
2802
  display: {
2461
2803
  type: "settings-color-picker",
@@ -2468,71 +2810,208 @@ const LightboxComponent = {
2468
2810
  }
2469
2811
  },
2470
2812
  default: {
2471
- thumbnailBlock: {
2472
- cover: {
2473
- 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
+ }
2474
2879
  }
2475
2880
  },
2476
- lightboxBlock: {
2477
- appear: {
2478
- type: "slide in",
2479
- duration: "1000ms",
2480
- direction: "right",
2481
- repeat: "close"
2482
- },
2483
- triggers: {
2484
- type: "click",
2485
- switch: "image",
2486
- duration: "2000ms"
2487
- },
2488
- slider: {
2489
- type: "fade",
2490
- direction: "horiz"
2881
+ "m": {
2882
+ thumbnailBlock: {
2883
+ cover: {
2884
+ url: "https://cdn.cntrl.site/component-assets/Cover.jpg"
2885
+ }
2491
2886
  },
2492
- thumbnail: {
2493
- isActive: true,
2494
- position: "bottom-center",
2495
- fit: "cover",
2496
- align: "center",
2497
- triggers: "clk",
2498
- grid: {
2499
- height: 60,
2500
- width: 60,
2501
- gap: 8
2502
- },
2503
- offset: { x: 0, y: 0 },
2504
- opacity: 100,
2505
- 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 },
2506
2929
  scale: 1,
2507
- 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"
2508
2953
  }
2509
2954
  },
2510
- layout: {
2511
- position: "middle-center",
2512
- offset: { x: 0, y: 0 },
2513
- padding: { top: 0, right: 0, bottom: 0, left: 0 }
2514
- },
2515
- controls: {
2516
- isActive: true,
2517
- arrowsImgUrl: null,
2518
- offset: { x: 0, y: 0 },
2519
- scale: 1,
2520
- color: "#000000",
2521
- hover: "#cccccc"
2522
- },
2523
- area: {
2524
- color: "rgba(0,0,0,0.9)",
2525
- blur: 0,
2526
- closeIconUrl: null,
2527
- closeIconAlign: "top-right",
2528
- closeIconOffset: { x: 0, y: 0 },
2529
- closeIconScale: 1
2530
- },
2531
- caption: {
2532
- isActive: true,
2533
- alignment: "middle-center",
2534
- offset: { x: 0, y: 0 },
2535
- 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
+ }
2536
3015
  }
2537
3016
  }
2538
3017
  },
@@ -2557,46 +3036,6 @@ const LightboxComponent = {
2557
3036
  value: "vertical"
2558
3037
  }
2559
3038
  },
2560
- {
2561
- if: {
2562
- name: "lightboxBlock.slider.direction",
2563
- value: "vert"
2564
- },
2565
- then: {
2566
- name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.width.display.visible",
2567
- value: true
2568
- }
2569
- },
2570
- {
2571
- if: {
2572
- name: "lightboxBlock.slider.direction",
2573
- value: "horiz"
2574
- },
2575
- then: {
2576
- name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.height.display.visible",
2577
- value: true
2578
- }
2579
- },
2580
- {
2581
- if: {
2582
- name: "lightboxBlock.slider.direction",
2583
- value: "vert"
2584
- },
2585
- then: {
2586
- name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.height.display.visible",
2587
- value: false
2588
- }
2589
- },
2590
- {
2591
- if: {
2592
- name: "lightboxBlock.slider.direction",
2593
- value: "horiz"
2594
- },
2595
- then: {
2596
- name: "properties.lightboxBlock.properties.thumbnail.properties.grid.properties.width.display.visible",
2597
- value: false
2598
- }
2599
- },
2600
3039
  {
2601
3040
  if: {
2602
3041
  name: "lightboxBlock.appear.type",
@@ -2619,42 +3058,32 @@ const LightboxComponent = {
2619
3058
  },
2620
3059
  {
2621
3060
  if: {
2622
- name: "lightboxBlock.triggers.type",
2623
- value: "click"
2624
- },
2625
- then: {
2626
- name: "properties.lightboxBlock.properties.triggers.properties.duration.display.visible",
2627
- value: true
2628
- }
2629
- },
2630
- {
2631
- if: {
2632
- name: "lightboxBlock.triggers.type",
2633
- value: "click"
3061
+ name: "lightboxBlock.slider.type",
3062
+ value: "fade"
2634
3063
  },
2635
3064
  then: {
2636
- name: "properties.lightboxBlock.properties.triggers.properties.switch.display.visible",
2637
- value: true
3065
+ name: "properties.lightboxBlock.properties.slider.properties.direction.display.visible",
3066
+ value: false
2638
3067
  }
2639
3068
  },
2640
3069
  {
2641
3070
  if: {
2642
- name: "lightboxBlock.triggers.type",
2643
- value: "drag"
3071
+ name: "lightboxBlock.slider.type",
3072
+ value: "scale"
2644
3073
  },
2645
3074
  then: {
2646
- name: "properties.lightboxBlock.properties.triggers.properties.duration.display.visible",
3075
+ name: "properties.lightboxBlock.properties.slider.properties.direction.display.visible",
2647
3076
  value: false
2648
3077
  }
2649
3078
  },
2650
3079
  {
2651
- if: {
2652
- name: "lightboxBlock.triggers.type",
2653
- value: "drag"
2654
- },
3080
+ if: [
3081
+ { name: "lightboxBlock.triggers.type", value: "click" },
3082
+ { name: "lightboxBlock.triggers.switch", value: "image" }
3083
+ ],
2655
3084
  then: {
2656
- name: "properties.lightboxBlock.properties.triggers.properties.switch.display.visible",
2657
- value: false
3085
+ name: "properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",
3086
+ value: true
2658
3087
  }
2659
3088
  }
2660
3089
  ]
@@ -2707,7 +3136,7 @@ const LightboxComponent = {
2707
3136
  {
2708
3137
  image: {
2709
3138
  objectFit: "contain",
2710
- url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMHNP08T27H1649S67NZV.png",
3139
+ url: "https://cdn.cntrl.site/component-assets/2.jpg",
2711
3140
  name: "Slider-1.png"
2712
3141
  },
2713
3142
  imageCaption: [
@@ -2720,7 +3149,7 @@ const LightboxComponent = {
2720
3149
  {
2721
3150
  image: {
2722
3151
  objectFit: "contain",
2723
- url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMTZA3RYMXKF0M095D6JD.png",
3152
+ url: "https://cdn.cntrl.site/component-assets/3.jpg",
2724
3153
  name: "Slider-2.png"
2725
3154
  },
2726
3155
  imageCaption: [
@@ -2733,7 +3162,7 @@ const LightboxComponent = {
2733
3162
  {
2734
3163
  image: {
2735
3164
  objectFit: "contain",
2736
- url: "https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERMVSCMPVJBG2WF5KJZYHZ.png",
3165
+ url: "https://cdn.cntrl.site/component-assets/4.jpg",
2737
3166
  name: "Slider-3.png"
2738
3167
  },
2739
3168
  imageCaption: [