@ozguraltan/strapi-content-input 1.0.9 → 1.0.11

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.
@@ -4,7 +4,9 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const reactDom = require("react-dom");
6
6
  const cloneDeep = require("lodash/cloneDeep");
7
- const index = require("./index-ysKdDQY1.js");
7
+ const index = require("./index-DKVaYg3t.js");
8
+ const react = require("swiper/react");
9
+ const modules = require("swiper/modules");
8
10
  const admin = require("@strapi/strapi/admin");
9
11
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
10
12
  const React__default = /* @__PURE__ */ _interopDefault(React);
@@ -2318,6 +2320,7 @@ function buildRichSampleRows() {
2318
2320
  }
2319
2321
  ];
2320
2322
  }
2323
+ const SWIPER_BUNDLE_CSS = '/**\n * Swiper 14.4.0\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * https://swiperjs.com\n *\n * Copyright 2014-2026 Vladimir Kharlampidi\n *\n * Released under the MIT License\n *\n * Released on: October 30, 2026\n */\n\n:root{--swiper-theme-color:#007aff}:host{display:block;margin-left:auto;margin-right:auto;position:relative;z-index:1}.swiper{display:block;list-style:none;margin-left:auto;margin-right:auto;overflow:hidden;padding:0;position:relative;z-index:1}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{box-sizing:initial;display:flex;height:100%;position:relative;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function,initial);width:100%;z-index:1}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{display:block;flex-shrink:0;height:100%;position:relative;transition-property:transform;width:100%}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{backface-visibility:hidden;transform:translateZ(0)}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px;.swiper-cube-shadow,.swiper-slide{transform-style:preserve-3d}}.swiper-css-mode{>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none}}>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}&.swiper-horizontal{>.swiper-wrapper{scroll-snap-type:x mandatory}>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-slides-offset-before);scroll-margin-inline-start:var(--swiper-slides-offset-before)}>.swiper-wrapper>.swiper-slide:last-child{margin-inline-end:var(--swiper-slides-offset-after)}}&.swiper-vertical{>.swiper-wrapper{scroll-snap-type:y mandatory}>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-slides-offset-before);scroll-margin-block-start:var(--swiper-slides-offset-before)}>.swiper-wrapper>.swiper-slide:last-child{margin-block-end:var(--swiper-slides-offset-after)}}&.swiper-free-mode{>.swiper-wrapper{scroll-snap-type:none}>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}}&.swiper-centered{>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}}&.swiper-centered.swiper-horizontal{>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}}&.swiper-centered.swiper-vertical{>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}>.swiper-wrapper:before{height:var(--swiper-centered-offset-after);min-width:1px;width:100%}}}.swiper-3d{.swiper-slide-shadow,.swiper-slide-shadow-bottom,.swiper-slide-shadow-left,.swiper-slide-shadow-right,.swiper-slide-shadow-top{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:10}.swiper-slide-shadow{background:#00000026}.swiper-slide-shadow-left{background-image:linear-gradient(270deg,#00000080,#0000)}.swiper-slide-shadow-right{background-image:linear-gradient(90deg,#00000080,#0000)}.swiper-slide-shadow-top{background-image:linear-gradient(0deg,#00000080,#0000)}.swiper-slide-shadow-bottom{background-image:linear-gradient(180deg,#00000080,#0000)}}.swiper-lazy-preloader{border:4px solid var(--swiper-preloader-color,var(--swiper-theme-color));border-radius:50%;border-top:4px solid #0000;box-sizing:border-box;height:42px;left:50%;margin-left:-21px;margin-top:-21px;position:absolute;top:50%;transform-origin:50%;width:42px;z-index:10}.swiper-watch-progress .swiper-slide-visible,.swiper:not(.swiper-watch-progress){.swiper-lazy-preloader{animation:swiper-preloader-spin 1s linear infinite}}.swiper-lazy-preloader-white{--swiper-preloader-color:#fff}.swiper-lazy-preloader-black{--swiper-preloader-color:#000}@keyframes swiper-preloader-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.swiper-virtual .swiper-slide{-webkit-backface-visibility:hidden;transform:translateZ(0)}.swiper-virtual.swiper-css-mode{.swiper-wrapper:after{content:"";left:0;pointer-events:none;position:absolute;top:0}}.swiper-virtual.swiper-css-mode.swiper-horizontal{.swiper-wrapper:after{height:1px;width:var(--swiper-virtual-size)}}.swiper-virtual.swiper-css-mode.swiper-vertical{.swiper-wrapper:after{height:var(--swiper-virtual-size);width:1px}}:root{--swiper-navigation-size:44px}.swiper-button-next,.swiper-button-prev{align-items:center;color:var(--swiper-navigation-color,var(--swiper-theme-color));cursor:pointer;display:flex;height:var(--swiper-navigation-size);justify-content:center;position:absolute;width:var(--swiper-navigation-size);z-index:10;&.swiper-button-disabled{cursor:auto;opacity:.35;pointer-events:none}&.swiper-button-hidden{cursor:auto;opacity:0;pointer-events:none}.swiper-navigation-disabled &{display:none!important}::slotted(svg),svg{height:100%;object-fit:contain;transform-origin:center;width:100%;fill:currentColor;pointer-events:none}}.swiper-button-lock{display:none}.swiper-button-next,.swiper-button-prev{margin-top:calc(0px - var(--swiper-navigation-size)/2);top:var(--swiper-navigation-top-offset,50%)}.swiper-button-prev{left:var(--swiper-navigation-sides-offset,4px);right:auto;.swiper-navigation-icon,::slotted(.swiper-navigation-icon){transform:rotate(180deg)}}.swiper-button-next{left:auto;right:var(--swiper-navigation-sides-offset,4px)}.swiper-horizontal{.swiper-button-next,.swiper-button-prev,~.swiper-button-next,~.swiper-button-prev{margin-left:0;margin-top:calc(0px - var(--swiper-navigation-size)/2);top:var(--swiper-navigation-top-offset,50%)}&.swiper-rtl .swiper-button-next,&.swiper-rtl~.swiper-button-next,&~.swiper-button-prev,.swiper-button-prev{left:var(--swiper-navigation-sides-offset,4px);right:auto}&.swiper-rtl .swiper-button-prev,&.swiper-rtl~.swiper-button-prev,&~.swiper-button-next,.swiper-button-next{left:auto;right:var(--swiper-navigation-sides-offset,4px)}&.swiper-rtl .swiper-button-next,&.swiper-rtl~.swiper-button-next,&~.swiper-button-prev,.swiper-button-prev{.swiper-navigation-icon,::slotted(.swiper-navigation-icon){transform:rotate(180deg)}}&.swiper-rtl .swiper-button-prev,&.swiper-rtl~.swiper-button-prev{.swiper-navigation-icon,::slotted(.swiper-navigation-icon){transform:rotate(0deg)}}}.swiper-vertical{.swiper-button-next,.swiper-button-prev,~.swiper-button-next,~.swiper-button-prev{left:var(--swiper-navigation-top-offset,50%);margin-left:calc(0px - var(--swiper-navigation-size)/2);margin-top:0;right:auto}.swiper-button-prev,~.swiper-button-prev{bottom:auto;top:var(--swiper-navigation-sides-offset,4px);.swiper-navigation-icon,::slotted(.swiper-navigation-icon){transform:rotate(-90deg)}}.swiper-button-next,~.swiper-button-next{bottom:var(--swiper-navigation-sides-offset,4px);top:auto;.swiper-navigation-icon,::slotted(.swiper-navigation-icon){transform:rotate(90deg)}}}.swiper-pagination{position:absolute;text-align:center;transform:translateZ(0);transition:opacity .3s;z-index:10;&.swiper-pagination-hidden{opacity:0}&.swiper-pagination-disabled,.swiper-pagination-disabled>&{display:none!important}}.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:var(--swiper-pagination-bottom,8px);left:0;top:var(--swiper-pagination-top,auto);width:100%}.swiper-pagination-bullets-dynamic{font-size:0;overflow:hidden;.swiper-pagination-bullet{position:relative;transform:scale(.33)}.swiper-pagination-bullet-active,.swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullet-active-next-next{transform:scale(.33)}}.swiper-pagination-bullet{background:var(--swiper-pagination-bullet-inactive-color,#000);border-radius:var(--swiper-pagination-bullet-border-radius,50%);display:inline-block;height:var(--swiper-pagination-bullet-height,var(--swiper-pagination-bullet-size,8px));opacity:var(--swiper-pagination-bullet-inactive-opacity,.2);width:var(--swiper-pagination-bullet-width,var(--swiper-pagination-bullet-size,8px));button&{appearance:none;border:none;box-shadow:none;margin:0;padding:0}.swiper-pagination-clickable &{cursor:pointer}&:only-child{display:none!important}}.swiper-pagination-bullet-active{background:var(--swiper-pagination-color,var(--swiper-theme-color));opacity:var(--swiper-pagination-bullet-opacity,1)}.swiper-pagination-vertical.swiper-pagination-bullets,.swiper-vertical>.swiper-pagination-bullets{left:var(--swiper-pagination-left,auto);right:var(--swiper-pagination-right,8px);top:50%;transform:translate3d(0,-50%,0);.swiper-pagination-bullet{display:block;margin:var(--swiper-pagination-bullet-vertical-gap,6px) 0}&.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px;.swiper-pagination-bullet{display:inline-block;transition:transform .2s,top .2s}}}.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-horizontal.swiper-pagination-bullets{.swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap,4px)}&.swiper-pagination-bullets-dynamic{left:50%;transform:translateX(-50%);white-space:nowrap;.swiper-pagination-bullet{transition:transform .2s,left .2s}}}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:transform .2s,right .2s}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color,inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color,#00000040);position:absolute;.swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color,var(--swiper-theme-color));height:100%;left:0;position:absolute;top:0;transform:scale(0);transform-origin:left top;width:100%}.swiper-rtl & .swiper-pagination-progressbar-fill{transform-origin:right top}&.swiper-pagination-horizontal,&.swiper-pagination-vertical.swiper-pagination-progressbar-opposite,.swiper-horizontal>&,.swiper-vertical>&.swiper-pagination-progressbar-opposite{height:var(--swiper-pagination-progressbar-size,4px);left:0;top:0;width:100%}&.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite,&.swiper-pagination-vertical,.swiper-horizontal>&.swiper-pagination-progressbar-opposite,.swiper-vertical>&{height:100%;left:0;top:0;width:var(--swiper-pagination-progressbar-size,4px)}}.swiper-pagination-lock{display:none}.swiper-scrollbar{background:var(--swiper-scrollbar-bg-color,#0000001a);border-radius:var(--swiper-scrollbar-border-radius,10px);position:relative;touch-action:none;&.swiper-scrollbar-disabled,.swiper-scrollbar-disabled>&{display:none!important}&.swiper-scrollbar-horizontal,.swiper-horizontal>&{bottom:var(--swiper-scrollbar-bottom,4px);height:var(--swiper-scrollbar-size,4px);left:var(--swiper-scrollbar-sides-offset,1%);position:absolute;top:var(--swiper-scrollbar-top,auto);width:calc(100% - var(--swiper-scrollbar-sides-offset, 1%)*2);z-index:50}&.swiper-scrollbar-vertical,.swiper-vertical>&{height:calc(100% - var(--swiper-scrollbar-sides-offset, 1%)*2);left:var(--swiper-scrollbar-left,auto);position:absolute;right:var(--swiper-scrollbar-right,4px);top:var(--swiper-scrollbar-sides-offset,1%);width:var(--swiper-scrollbar-size,4px);z-index:50}}.swiper-scrollbar-drag{background:var(--swiper-scrollbar-drag-bg-color,#00000080);border-radius:var(--swiper-scrollbar-border-radius,10px);height:100%;left:0;position:relative;top:0;width:100%}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}.swiper-zoom-container{align-items:center;display:flex;height:100%;justify-content:center;text-align:center;width:100%;>canvas,>img,>svg{max-height:100%;max-width:100%;object-fit:contain}}.swiper-slide-zoomed{cursor:move;touch-action:none}.swiper .swiper-notification{left:0;opacity:0;pointer-events:none;position:absolute;top:0;z-index:-1000}.swiper-free-mode>.swiper-wrapper{margin:0 auto;transition-timing-function:ease-out}.swiper-grid>.swiper-wrapper{flex-wrap:wrap}.swiper-grid-column>.swiper-wrapper{flex-direction:column;flex-wrap:wrap}.swiper-fade{&.swiper-free-mode{.swiper-slide{transition-timing-function:ease-out}}.swiper-slide{pointer-events:none;transition-property:opacity;.swiper-slide{pointer-events:none}}.swiper-slide-active{pointer-events:auto;& .swiper-slide-active{pointer-events:auto}}}.swiper.swiper-cube{overflow:visible}.swiper-cube{.swiper-slide{backface-visibility:hidden;height:100%;pointer-events:none;transform-origin:0 0;visibility:hidden;width:100%;z-index:1;.swiper-slide{pointer-events:none}}&.swiper-rtl .swiper-slide{transform-origin:100% 0}.swiper-slide-active{&,& .swiper-slide-active{pointer-events:auto}}.swiper-slide-active,.swiper-slide-next,.swiper-slide-prev{pointer-events:auto;visibility:visible}.swiper-cube-shadow{bottom:0;height:100%;left:0;opacity:.6;position:absolute;width:100%;z-index:0;&:before{background:#000;bottom:0;content:"";filter:blur(50px);left:0;position:absolute;right:0;top:0}}}.swiper-cube{.swiper-slide-next+.swiper-slide{pointer-events:auto;visibility:visible}}.swiper-cube{.swiper-slide-shadow-cube.swiper-slide-shadow-bottom,.swiper-slide-shadow-cube.swiper-slide-shadow-left,.swiper-slide-shadow-cube.swiper-slide-shadow-right,.swiper-slide-shadow-cube.swiper-slide-shadow-top{backface-visibility:hidden;z-index:0}}.swiper.swiper-flip{overflow:visible}.swiper-flip{.swiper-slide{backface-visibility:hidden;pointer-events:none;z-index:1;.swiper-slide{pointer-events:none}}.swiper-slide-active{&,& .swiper-slide-active{pointer-events:auto}}}.swiper-flip{.swiper-slide-shadow-flip.swiper-slide-shadow-bottom,.swiper-slide-shadow-flip.swiper-slide-shadow-left,.swiper-slide-shadow-flip.swiper-slide-shadow-right,.swiper-slide-shadow-flip.swiper-slide-shadow-top{backface-visibility:hidden;z-index:0}}.swiper-creative{.swiper-slide{backface-visibility:hidden;overflow:hidden;transition-property:transform,opacity,height}}.swiper.swiper-cards{overflow:visible}.swiper-cards{.swiper-slide{backface-visibility:hidden;overflow:hidden;transform-origin:center bottom}}';
2321
2324
  const BREAKPOINTS = [
2322
2325
  { infix: "", minWidth: null },
2323
2326
  { infix: "-sm", minWidth: 560 },
@@ -2720,6 +2723,49 @@ ${bpCss}
2720
2723
  .ci-canvas--clean .ci-block__empty {
2721
2724
  display: none !important;
2722
2725
  }
2726
+
2727
+ /* Official Swiper.js Bundle Styles */
2728
+ ${SWIPER_BUNDLE_CSS}
2729
+
2730
+ .ci-swiper {
2731
+ width: 100%;
2732
+ border-radius: 6px;
2733
+ overflow: hidden;
2734
+ background: #0f172a;
2735
+ user-select: none;
2736
+ }
2737
+ .ci-swiper .swiper-slide {
2738
+ height: auto;
2739
+ overflow: hidden;
2740
+ user-select: none;
2741
+ }
2742
+ .ci-swiper .swiper-slide img {
2743
+ -webkit-user-drag: none;
2744
+ user-select: none;
2745
+ }
2746
+ .ci-swiper .swiper-button-prev,
2747
+ .ci-swiper .swiper-button-next {
2748
+ width: 34px;
2749
+ height: 34px;
2750
+ border-radius: 50%;
2751
+ background: rgba(255, 255, 255, 0.88);
2752
+ color: #0f172a;
2753
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
2754
+ }
2755
+ .ci-swiper .swiper-button-prev::after,
2756
+ .ci-swiper .swiper-button-next::after {
2757
+ font-size: 14px;
2758
+ font-weight: 800;
2759
+ }
2760
+ .ci-swiper .swiper-pagination-bullet {
2761
+ background: rgba(255, 255, 255, 0.7);
2762
+ opacity: 1;
2763
+ }
2764
+ .ci-swiper .swiper-pagination-bullet-active {
2765
+ background: #38bdf8;
2766
+ width: 18px;
2767
+ border-radius: 4px;
2768
+ }
2723
2769
  `;
2724
2770
  }
2725
2771
  const STYLE_TAG_ID = "strapi-ci-canvas-styles";
@@ -6979,25 +7025,6 @@ const WidgetPreview = ({
6979
7025
  const galleryKind = options?.kind || (options?.type === "grid" ? "gridGallery" : "swiper");
6980
7026
  const swiperSettings = options?.settings || {};
6981
7027
  const autoplayConfig = swiperSettings?.autoplay;
6982
- const isAutoplayActive = id === "gallery" && galleryKind === "swiper" && Boolean(autoplayConfig) && galleryImages.length > 1;
6983
- React.useEffect(() => {
6984
- if (!isAutoplayActive) return;
6985
- const delay = typeof autoplayConfig === "object" && Number(autoplayConfig.delay) >= 500 ? Number(autoplayConfig.delay) : 4e3;
6986
- const reverse = typeof autoplayConfig === "object" && Boolean(autoplayConfig.reverseDirection);
6987
- const stopOnLast = typeof autoplayConfig === "object" && Boolean(autoplayConfig.stopOnLastSlide);
6988
- const timer = setInterval(() => {
6989
- setGalleryIndex((prev) => {
6990
- if (stopOnLast && !reverse && prev >= galleryImages.length - 1) {
6991
- return prev;
6992
- }
6993
- if (reverse) {
6994
- return (prev - 1 + galleryImages.length) % galleryImages.length;
6995
- }
6996
- return (prev + 1) % galleryImages.length;
6997
- });
6998
- }, delay);
6999
- return () => clearInterval(timer);
7000
- }, [isAutoplayActive, autoplayConfig, galleryImages.length]);
7001
7028
  if (id === "HtmlEditor") {
7002
7029
  const html = typeof data === "string" ? data : data?.content || `<p>${t("widgets.htmlEditor.placeholder")}</p>`;
7003
7030
  const explicitBg = options?.backgroundColor || options?.styleOptions?.backgroundColor || "transparent";
@@ -7458,13 +7485,28 @@ const WidgetPreview = ({
7458
7485
  const spaceBetween = Math.max(0, Number(swiperSettings?.spaceBetween) ?? 12);
7459
7486
  const showNav = swiperSettings?.navigation !== false;
7460
7487
  const showPagination = swiperSettings?.pagination !== false;
7461
- const grabCursor = Boolean(swiperSettings?.grabCursor);
7462
- const safeIdx = images.length > 0 ? galleryIndex % images.length : 0;
7463
- const visibleSlides = Array.from({ length: slidesPerView }, (_, offset) => {
7464
- const itemIndex = (safeIdx + offset) % images.length;
7465
- return { item: images[itemIndex], index: itemIndex };
7466
- });
7488
+ const grabCursor = Boolean(swiperSettings?.grabCursor ?? true);
7489
+ const isLoop = Boolean(swiperSettings?.loop) && images.length > slidesPerView;
7490
+ const isMousewheel = Boolean(swiperSettings?.mousewheel);
7491
+ images.length > 0 ? galleryIndex % images.length : 0;
7467
7492
  const slideAspectRatio = imgProcess === "fit" && customW > 0 && customH > 0 ? `${customW} / ${customH}` : slidesPerView > 1 ? "4 / 3" : "16 / 9";
7493
+ const resolvedAutoplay = Boolean(autoplayConfig ?? options?.autoplay) ? {
7494
+ delay: typeof autoplayConfig === "object" && Number(autoplayConfig.delay) >= 500 ? Number(autoplayConfig.delay) : 4e3,
7495
+ disableOnInteraction: typeof autoplayConfig === "object" ? Boolean(autoplayConfig.disableOnInteraction) : false,
7496
+ stopOnLastSlide: typeof autoplayConfig === "object" ? Boolean(autoplayConfig.stopOnLastSlide) : false,
7497
+ reverseDirection: typeof autoplayConfig === "object" ? Boolean(autoplayConfig.reverseDirection) : false
7498
+ } : false;
7499
+ const swiperKey = [
7500
+ effect,
7501
+ slidesPerView,
7502
+ spaceBetween,
7503
+ isLoop ? "loop" : "noloop",
7504
+ showNav ? "nav" : "nonav",
7505
+ showPagination ? "pag" : "nopag",
7506
+ isMousewheel ? "mw" : "nomw",
7507
+ grabCursor ? "grab" : "nograb",
7508
+ resolvedAutoplay ? `ap-${resolvedAutoplay.delay}-${resolvedAutoplay.reverseDirection}` : "noap"
7509
+ ].join("|");
7468
7510
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7469
7511
  /* @__PURE__ */ jsxRuntime.jsxs(
7470
7512
  "div",
@@ -7474,25 +7516,38 @@ const WidgetPreview = ({
7474
7516
  width: "100%",
7475
7517
  borderRadius: 6,
7476
7518
  overflow: "hidden",
7477
- background: "#0f172a",
7478
- cursor: grabCursor ? "grab" : isPopupEnabled ? "zoom-in" : "default"
7519
+ background: "#0f172a"
7479
7520
  },
7480
7521
  children: [
7481
7522
  /* @__PURE__ */ jsxRuntime.jsx(
7482
- "div",
7523
+ react.Swiper,
7483
7524
  {
7484
- style: {
7485
- display: "grid",
7486
- gridTemplateColumns: `repeat(${slidesPerView}, minmax(0, 1fr))`,
7487
- gap: spaceBetween,
7488
- width: "100%",
7489
- padding: slidesPerView > 1 && spaceBetween > 0 ? 4 : 0,
7490
- boxSizing: "border-box"
7491
- },
7492
- children: visibleSlides.map(({ item, index: index2 }) => {
7525
+ className: "ci-swiper",
7526
+ modules: [
7527
+ modules.Navigation,
7528
+ modules.Pagination,
7529
+ modules.Autoplay,
7530
+ modules.Mousewheel,
7531
+ modules.EffectFade,
7532
+ modules.EffectCube,
7533
+ modules.EffectCoverflow,
7534
+ modules.EffectFlip
7535
+ ],
7536
+ effect,
7537
+ slidesPerView,
7538
+ spaceBetween,
7539
+ loop: isLoop,
7540
+ grabCursor,
7541
+ mousewheel: isMousewheel ? { forceToAxis: false } : false,
7542
+ navigation: showNav && images.length > 1,
7543
+ pagination: showPagination && images.length > 1 ? { clickable: true } : false,
7544
+ autoplay: images.length > 1 ? resolvedAutoplay : false,
7545
+ onSlideChange: (s) => setGalleryIndex(s.realIndex ?? s.activeIndex ?? 0),
7546
+ style: { width: "100%" },
7547
+ children: images.map((item, index2) => {
7493
7548
  const rawSlideUrl = item?.target_url || item?.url || "";
7494
7549
  const slideUrl = buildSharpImageUrl(rawSlideUrl, imageSettings);
7495
- return /* @__PURE__ */ jsxRuntime.jsx(
7550
+ return /* @__PURE__ */ jsxRuntime.jsx(react.SwiperSlide, { children: /* @__PURE__ */ jsxRuntime.jsxs(
7496
7551
  "div",
7497
7552
  {
7498
7553
  onClick: (e) => {
@@ -7507,27 +7562,59 @@ const WidgetPreview = ({
7507
7562
  aspectRatio: slideAspectRatio,
7508
7563
  overflow: "hidden",
7509
7564
  borderRadius: slidesPerView > 1 ? 4 : 0,
7510
- background: "#1e293b"
7565
+ background: "#1e293b",
7566
+ cursor: grabCursor ? "grab" : isPopupEnabled ? "zoom-in" : "default"
7511
7567
  },
7512
- children: slideUrl && /* @__PURE__ */ jsxRuntime.jsx(
7513
- "img",
7514
- {
7515
- src: slideUrl,
7516
- alt: item?.caption || t("widgets.gallery.label"),
7517
- style: {
7518
- width: "100%",
7519
- height: "100%",
7520
- objectFit: imgObjectFit,
7521
- display: "block",
7522
- transition: "opacity 0.25s ease, transform 0.25s ease"
7568
+ children: [
7569
+ slideUrl && /* @__PURE__ */ jsxRuntime.jsx(
7570
+ "img",
7571
+ {
7572
+ src: slideUrl,
7573
+ alt: item?.caption || t("widgets.gallery.label"),
7574
+ draggable: false,
7575
+ style: {
7576
+ width: "100%",
7577
+ height: "100%",
7578
+ objectFit: imgObjectFit,
7579
+ display: "block",
7580
+ userSelect: "none"
7581
+ }
7523
7582
  }
7524
- }
7525
- )
7526
- },
7527
- `${index2}-${offsetKey(index2)}`
7528
- );
7583
+ ),
7584
+ item?.caption && /* @__PURE__ */ jsxRuntime.jsxs(
7585
+ "div",
7586
+ {
7587
+ style: {
7588
+ position: "absolute",
7589
+ left: 8,
7590
+ right: 8,
7591
+ bottom: showPagination ? 26 : 8,
7592
+ display: "flex",
7593
+ alignItems: "center",
7594
+ justifyContent: "space-between",
7595
+ color: "#fff",
7596
+ background: "rgba(15, 23, 42, 0.68)",
7597
+ padding: "4px 8px",
7598
+ borderRadius: 4,
7599
+ fontSize: 11,
7600
+ pointerEvents: "none"
7601
+ },
7602
+ children: [
7603
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.caption }),
7604
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 600 }, children: [
7605
+ index2 + 1,
7606
+ " / ",
7607
+ images.length
7608
+ ] })
7609
+ ]
7610
+ }
7611
+ )
7612
+ ]
7613
+ }
7614
+ ) }, `${index2}-${rawSlideUrl}`);
7529
7615
  })
7530
- }
7616
+ },
7617
+ swiperKey
7531
7618
  ),
7532
7619
  /* @__PURE__ */ jsxRuntime.jsx(
7533
7620
  "div",
@@ -7536,6 +7623,7 @@ const WidgetPreview = ({
7536
7623
  position: "absolute",
7537
7624
  top: 8,
7538
7625
  left: 8,
7626
+ zIndex: 10,
7539
7627
  display: "flex",
7540
7628
  alignItems: "center",
7541
7629
  gap: 6,
@@ -7560,121 +7648,7 @@ const WidgetPreview = ({
7560
7648
  }
7561
7649
  )
7562
7650
  }
7563
- ),
7564
- /* @__PURE__ */ jsxRuntime.jsxs(
7565
- "div",
7566
- {
7567
- style: {
7568
- position: "absolute",
7569
- left: 10,
7570
- bottom: showPagination ? 22 : 10,
7571
- right: 10,
7572
- display: "flex",
7573
- alignItems: "center",
7574
- justifyContent: "space-between",
7575
- color: "#fff",
7576
- background: "rgba(15, 23, 42, 0.65)",
7577
- padding: "5px 10px",
7578
- borderRadius: 4,
7579
- fontSize: 12,
7580
- pointerEvents: "none"
7581
- },
7582
- children: [
7583
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: images[safeIdx]?.caption || images[safeIdx]?.filename || t("widgets.gallery.label") }),
7584
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 600 }, children: [
7585
- safeIdx + 1,
7586
- " / ",
7587
- images.length
7588
- ] })
7589
- ]
7590
- }
7591
- ),
7592
- showPagination && images.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
7593
- "div",
7594
- {
7595
- style: {
7596
- position: "absolute",
7597
- bottom: 6,
7598
- left: 0,
7599
- right: 0,
7600
- display: "flex",
7601
- alignItems: "center",
7602
- justifyContent: "center",
7603
- gap: 5
7604
- },
7605
- children: images.map((_, dotIdx) => /* @__PURE__ */ jsxRuntime.jsx(
7606
- "button",
7607
- {
7608
- type: "button",
7609
- onClick: (e) => {
7610
- e.stopPropagation();
7611
- setGalleryIndex(dotIdx);
7612
- },
7613
- style: {
7614
- width: dotIdx === safeIdx ? 16 : 6,
7615
- height: 6,
7616
- borderRadius: 3,
7617
- border: "none",
7618
- padding: 0,
7619
- background: dotIdx === safeIdx ? "#38bdf8" : "rgba(255,255,255,0.55)",
7620
- cursor: "pointer",
7621
- transition: "all 0.2s ease"
7622
- }
7623
- },
7624
- dotIdx
7625
- ))
7626
- }
7627
- ),
7628
- showNav && images.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7629
- /* @__PURE__ */ jsxRuntime.jsx(
7630
- "button",
7631
- {
7632
- type: "button",
7633
- onClick: (e) => {
7634
- e.stopPropagation();
7635
- setGalleryIndex((prev) => (prev - 1 + images.length) % images.length);
7636
- },
7637
- style: {
7638
- position: "absolute",
7639
- top: "50%",
7640
- left: 8,
7641
- transform: "translateY(-50%)",
7642
- width: 28,
7643
- height: 28,
7644
- borderRadius: "50%",
7645
- border: "none",
7646
- background: "rgba(255,255,255,0.85)",
7647
- cursor: "pointer",
7648
- fontWeight: 700
7649
- },
7650
- children: "‹"
7651
- }
7652
- ),
7653
- /* @__PURE__ */ jsxRuntime.jsx(
7654
- "button",
7655
- {
7656
- type: "button",
7657
- onClick: (e) => {
7658
- e.stopPropagation();
7659
- setGalleryIndex((prev) => (prev + 1) % images.length);
7660
- },
7661
- style: {
7662
- position: "absolute",
7663
- top: "50%",
7664
- right: 8,
7665
- transform: "translateY(-50%)",
7666
- width: 28,
7667
- height: 28,
7668
- borderRadius: "50%",
7669
- border: "none",
7670
- background: "rgba(255,255,255,0.85)",
7671
- cursor: "pointer",
7672
- fontWeight: 700
7673
- },
7674
- children: "›"
7675
- }
7676
- )
7677
- ] })
7651
+ )
7678
7652
  ]
7679
7653
  }
7680
7654
  ),
@@ -7696,7 +7670,7 @@ const WidgetPreview = ({
7696
7670
  const safeRawThumb = rawThumb && !rawThumb.includes("dQw4w9WgXcQ") ? rawThumb : `https://img.youtube.com/vi/${previewVideoId}/hqdefault.jpg`;
7697
7671
  const thumb = customThumbUrl || safeRawThumb;
7698
7672
  const isPopup = options?.popup !== false;
7699
- const isThumbnailMode = Boolean(customThumbUrl) || options?.kind !== "youtubeCard";
7673
+ const isThumbnailMode = options?.kind !== "youtubeCard";
7700
7674
  const iframeUrl = `https://www.youtube.com/embed/${activeVideoId}?autoplay=1&rel=0&modestbranding=1&playsinline=1`;
7701
7675
  const watchOnYoutubeUrl = `https://www.youtube.com/watch?v=${activeVideoId}`;
7702
7676
  const handleTriggerPlay = (e) => {
@@ -8722,9 +8696,6 @@ const WidgetPreview = ({
8722
8696
  /* @__PURE__ */ jsxRuntime.jsx("strong", { children: id })
8723
8697
  ] });
8724
8698
  };
8725
- function offsetKey(index2) {
8726
- return String(index2);
8727
- }
8728
8699
  function resolveEffectiveResponsiveValue(arr, bpIndex) {
8729
8700
  for (let i = bpIndex; i >= 0; i--) {
8730
8701
  if (arr[i]) return arr[i];