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