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

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