@cntrl-site/components 0.1.6-14 → 0.1.6-19

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.
@@ -174,10 +174,15 @@ export declare const ControlImageRevealSliderComponent: {
174
174
  value: boolean;
175
175
  };
176
176
  } | {
177
- if: {
177
+ if: ({
178
178
  name: string;
179
179
  value: string;
180
- }[];
180
+ isNotEqual?: undefined;
181
+ } | {
182
+ name: string;
183
+ value: null;
184
+ isNotEqual: boolean;
185
+ })[];
181
186
  then: {
182
187
  name: string;
183
188
  value: boolean;
@@ -1 +1 @@
1
- .ControlSlider-module__wrapper___sHEkd{position:relative;width:100%;height:100%}.ControlSlider-module__slider___R3i9-{width:100%;height:100%}.ControlSlider-module__sliderItems___1MgPL{display:flex;overflow:hidden;width:100%;height:100%;transition:transform .3s ease-in-out}.ControlSlider-module__sliderItem___QQSkR{width:100%;height:100%;display:flex;position:relative}.ControlSlider-module__sliderImage___9hRl-{width:100%;height:100%;object-fit:cover}.ControlSlider-module__arrow___05ghY{position:absolute;display:flex;align-items:center;justify-content:center;border:none;background-color:transparent;top:50%;left:calc(var(--is-editor, 0) * -1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -1.3888888889vw);z-index:1;transform:translate(-50%,-50%);padding:0;width:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw);height:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw)}.ControlSlider-module__arrow___05ghY.ControlSlider-module__arrowVertical___tBfVN{left:50%;top:calc(var(--is-editor, 0) * -1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -1.3888888889vw);transform:translate(-50%,-50%)}.ControlSlider-module__nextArrow___-30Yc{left:unset;right:calc(var(--is-editor, 0) * -1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -1.3888888889vw);transform:translate(50%,-50%)}.ControlSlider-module__nextArrow___-30Yc.ControlSlider-module__arrowVertical___tBfVN{left:50%;right:unset;top:unset;bottom:calc(var(--is-editor, 0) * -1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -1.3888888889vw);transform:translate(-50%,50%)}.ControlSlider-module__arrowInner___aEra3{all:unset;cursor:pointer;width:100%;height:100%}.ControlSlider-module__arrowInner___aEra3:hover .ControlSlider-module__arrowIcon___S4ztF path{fill:var(--arrow-hover-color)!important}.ControlSlider-module__arrowImg___2dwJW{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.ControlSlider-module__arrowIcon___S4ztF{width:100%;height:100%}.ControlSlider-module__arrowIcon___S4ztF path{transition:fill .15s ease-in-out}.ControlSlider-module__mirror___brd6U{transform:translate(-50%,-50%) scaleX(-1)!important}.ControlSlider-module__arrowVertical___tBfVN.ControlSlider-module__mirror___brd6U{transform:translate(-50%,-50%) scaleY(-1)!important}.ControlSlider-module__pagination___bicLF{position:absolute;z-index:1;border-radius:50%}.ControlSlider-module__paginationInner___bT-P-{display:flex;gap:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw);padding-top:calc(var(--is-editor, 0) * .6944444444vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * .6944444444vw);padding-bottom:calc(var(--is-editor, 0) * .6944444444vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * .6944444444vw);padding-left:calc(var(--is-editor, 0) * 1.25vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.25vw);padding-right:calc(var(--is-editor, 0) * 1.25vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.25vw);border-radius:calc(var(--is-editor, 0) * 2.3611111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.3611111111vw)}.ControlSlider-module__paginationVertical___zYqKw{flex-direction:column}.ControlSlider-module__paginationItem___nTRbk{all:unset;flex-shrink:0;position:relative;width:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw);height:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw);cursor:pointer}.ControlSlider-module__paginationItem___nTRbk:hover .ControlSlider-module__dot___p1Qun{background-color:var(--pagination-hover-color)!important}.ControlSlider-module__dot___p1Qun{border-radius:50%;scale:.5;transition:background-color .3s ease-in-out,transform .3s ease-in-out;width:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw);height:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw)}.ControlSlider-module__activeDot___LHFaj{transform:scale(2)}.ControlSlider-module__paginationInsideBottom___R3FWn{bottom:0;left:50%;transform:translate(-50%)}.ControlSlider-module__paginationInsideTop___V-qb-{left:50%;transform:translate(-50%);top:0}.ControlSlider-module__paginationOutsideBottom___14w8D{left:50%;transform:translate(-50%);bottom:calc(var(--is-editor, 0) * -2.4305555556vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -2.4305555556vw)}.ControlSlider-module__paginationOutsideTop___SCLqB{left:50%;transform:translate(-50%);top:calc(var(--is-editor, 0) * -2.4305555556vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -2.4305555556vw)}.ControlSlider-module__paginationInsideLeft___yOBRZ{top:50%;transform:translateY(-50%);left:calc(var(--is-editor, 0) * -2.4305555556vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -2.4305555556vw)}.ControlSlider-module__paginationInsideRight___Rtt3o{top:50%;transform:translateY(-50%);right:calc(var(--is-editor, 0) * -2.4305555556vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -2.4305555556vw)}.ControlSlider-module__paginationOutsideLeft___lahaw{top:50%;transform:translateY(-50%);left:calc(var(--is-editor, 0) * -5.4861111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -5.4861111111vw)}.ControlSlider-module__paginationOutsideRight___EtuQa{top:50%;transform:translateY(-50%);right:calc(var(--is-editor, 0) * -5.4861111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -5.4861111111vw)}.ControlSlider-module__imgWrapper___UjEgB,.ControlSlider-module__wrapperInner___DLAWV{width:100%;height:100%}.ControlSlider-module__captionBlock___dJ6-j{pointer-events:none;position:absolute;top:0;z-index:1;left:0;right:0;bottom:0}.ControlSlider-module__captionTextWrapper___HFlpf{position:relative;width:100%;height:100%}.ControlSlider-module__captionText___uGBVc{pointer-events:none;max-width:100%;transition-property:opacity;transition-timing-function:ease-in-out;position:absolute;display:inline-block;white-space:pre-wrap;overflow-wrap:break-word;opacity:0}.ControlSlider-module__captionText___uGBVc.ControlSlider-module__active___WZK4G{opacity:1}.ControlSlider-module__withPointerEvents___t-18M{pointer-events:auto}.ControlSlider-module__absolute___KxmYB{position:absolute}.ControlSlider-module__topLeftAlignment___zjnGM{top:0;left:0}.ControlSlider-module__topCenterAlignment___gD1xW{top:0;left:50%;transform:translate(-50%)}.ControlSlider-module__topRightAlignment___NMapS{top:0;right:0}.ControlSlider-module__middleLeftAlignment___OnUrY{top:50%;transform:translateY(-50%);left:0}.ControlSlider-module__middleCenterAlignment___Tdkl0{top:50%;transform:translate(-50%,-50%);left:50%}.ControlSlider-module__middleRightAlignment___wEbfX{top:50%;transform:translateY(-50%);right:0}.ControlSlider-module__bottomLeftAlignment___cTP2-{bottom:0;left:0}.ControlSlider-module__bottomCenterAlignment___c54fB{bottom:0;left:50%;transform:translate(-50%)}.ControlSlider-module__bottomRightAlignment___kEwrz{bottom:0;right:0}.ControlSlider-module__clickOverlay___DZA28{position:absolute;top:0;left:0;width:100%;height:100%;cursor:pointer}.ControlSlider-module__contain___pLyq7{object-fit:contain}.ControlSlider-module__cover___KdDat{object-fit:cover}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}.RichTextRenderer-module__link___BWeZ2{color:inherit;cursor:pointer;pointer-events:auto;transition:color .2s ease}.RichTextRenderer-module__link___BWeZ2:hover{color:var(--link-hover-color)}.SvgImage-module__svg___q3xE-{width:100%;height:100%;color:transparent;display:inline-block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:var(--fill);transition:background-color .2s;-webkit-mask:var(--svg) no-repeat center/contain;mask:var(--svg) no-repeat center/contain}.SvgImage-module__svg___q3xE-:hover{background-color:var(--hover-fill)}.SvgImage-module__img___VsTm-{width:100%;height:100%;object-fit:contain}.ImageRevealSlider-module__imageRevealSlider___UE5Ob{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden}.ImageRevealSlider-module__image___Qjt-e{width:100%;height:100%;object-fit:cover;position:relative;-webkit-user-select:none;user-select:none;pointer-events:none}.ImageRevealSlider-module__link___N-iLG{width:100%;height:100%;display:block;cursor:pointer}.LightBox-module__heroImage___sTxNF{width:100%;height:100%;cursor:pointer;object-fit:cover}.LightBox-module__background___rm9ml{position:fixed;z-index:9997;top:0;left:0;right:0;bottom:0;width:100%;height:100%}.LightBox-module__editor___4ACaY{width:var(--cntrl-article-width)!important;margin-left:auto;margin-right:auto}.LightBox-module__contentStyle___Bgnsq{position:fixed;z-index:9999;top:0;left:0;right:0;bottom:0;overflow:auto;background:transparent;box-sizing:border-box}.LightBox-module__imageStyle___tLIlB{position:relative;display:block;cursor:pointer;background-color:transparent;max-width:100%;max-height:100%;width:auto;height:auto}.LightBox-module__imgWrapper___LuFUp{position:relative;display:flex;width:100%;height:100%;overflow:hidden;box-sizing:border-box}.LightBox-module__contain___8-yaS{object-fit:contain;max-width:100%;max-height:100%}.LightBox-module__cover___hNvOG{width:100%;height:100%;object-fit:cover}.LightBox-module__caption___b6L2I{z-index:9999;position:absolute;display:flex}.LightBox-module__captionTextInner___rCGNH{position:relative}.LightBox-module__lightboxSplide___XFuWC.splide,.LightBox-module__lightboxSplide___XFuWC .splide__track{height:100%}.LightBox-module__arrow___iz38X{position:absolute;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;background-color:transparent;top:50%;z-index:1;transform:translate(-50%,-50%);padding:0;left:calc(var(--is-editor, 0) * 1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.3888888889vw);width:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw);height:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw)}.LightBox-module__arrow___iz38X.LightBox-module__arrowVertical___Zfz81{left:50%;top:calc(var(--is-editor, 0) * 1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.3888888889vw);transform:translate(-50%,-50%)}.LightBox-module__nextArrow___zkAQN{left:unset;right:calc(var(--is-editor, 0) * 1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.3888888889vw);transform:translate(50%,-50%)}.LightBox-module__nextArrow___zkAQN.LightBox-module__arrowVertical___Zfz81{left:50%;right:unset;top:unset;bottom:calc(var(--is-editor, 0) * 1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.3888888889vw);transform:translate(-50%,50%)}.LightBox-module__arrowInner___p48sW{all:unset;cursor:pointer;width:100%;height:100%}.LightBox-module__arrowInner___p48sW:hover .LightBox-module__arrowIcon___3VaFf path{fill:var(--arrow-hover-color)!important}.LightBox-module__arrowImg___pNV88{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.LightBox-module__mirror___pjeXc{transform:translate(-50%,-50%) scaleX(-1)!important}.LightBox-module__arrowVertical___Zfz81.LightBox-module__mirror___pjeXc{transform:translate(-50%,-50%) scaleY(-1)!important}.LightBox-module__thumbsContainerVertical___wttk5{flex-direction:column;display:flex}.LightBox-module__thumbsContainer___osSma{display:flex;align-items:center;justify-content:center;pointer-events:auto}.LightBox-module__thumbsAlignStart___MO6tY{align-items:flex-start}.LightBox-module__thumbsAlignCenter___Q4sUx{align-items:center}.LightBox-module__thumbsAlignEnd___p4y9R{align-items:flex-end}.LightBox-module__thumbItem___HvnF3{all:unset;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;transition:transform .1s ease,opacity .1s ease}.LightBox-module__thumbItem___HvnF3:hover{opacity:var(--thumb-hover)!important}.LightBox-module__closeButton___g2khP{all:unset;cursor:pointer;position:absolute;width:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw);height:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw)}@keyframes LightBox-module__lbFadeIn___P8mx0{0%{opacity:0}to{opacity:1}}.LightBox-module__fadeIn___0m5GW{animation-name:LightBox-module__lbFadeIn___P8mx0}@keyframes LightBox-module__lbSlideInLeft___ygsXZ{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes LightBox-module__lbSlideInRight___w2YKV{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes LightBox-module__lbSlideInTop___W7CSQ{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes LightBox-module__lbSlideInBottom___7kiT2{0%{transform:translateY(100%)}to{transform:translateY(0)}}.LightBox-module__slideInLeft___gPYwC{animation-name:LightBox-module__lbSlideInLeft___ygsXZ}.LightBox-module__slideInRight___S-pPp{animation-name:LightBox-module__lbSlideInRight___w2YKV}.LightBox-module__slideInTop___DFdAj{animation-name:LightBox-module__lbSlideInTop___W7CSQ}.LightBox-module__slideInBottom___m27kZ{animation-name:LightBox-module__lbSlideInBottom___7kiT2}@keyframes LightBox-module__lbFadeOut___MhEeN{0%{opacity:1}to{opacity:0}}.LightBox-module__fadeOut___55qBR{animation-name:LightBox-module__lbFadeOut___MhEeN!important}@keyframes LightBox-module__lbSlideOutLeft___xM4sO{0%{transform:translate(0)}to{transform:translate(-100%)}}@keyframes LightBox-module__lbSlideOutRight___Jppgj{0%{transform:translate(0)}to{transform:translate(100%)}}@keyframes LightBox-module__lbSlideOutTop___pvscE{0%{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes LightBox-module__lbSlideOutBottom___oFjPG{0%{transform:translateY(0)}to{transform:translateY(100%)}}.LightBox-module__slideOutLeft___NvU7P{animation-name:LightBox-module__lbSlideOutLeft___xM4sO!important}.LightBox-module__slideOutRight___SK7eC{animation-name:LightBox-module__lbSlideOutRight___Jppgj!important}.LightBox-module__slideOutTop___Vgg0z{animation-name:LightBox-module__lbSlideOutTop___pvscE!important}.LightBox-module__slideOutBottom___nJ0Ef{animation-name:LightBox-module__lbSlideOutBottom___oFjPG!important}.LightBox-module__lightboxSplide___XFuWC.splide--fade .LightBox-module__scaleSlide___vZriG{opacity:0!important;transform:var(--position-transform, none) scale(.9)!important;transition:opacity var(--splide-speed, .5s) ease,transform var(--splide-speed, .5s) ease!important}.LightBox-module__lightboxSplide___XFuWC.splide--fade .splide__slide.is-active .LightBox-module__scaleSlide___vZriG{opacity:1!important;transform:var(--position-transform, none) scale(1)!important}.LightBox-module__lightboxSplide___XFuWC.splide--fade .splide__slide:not(.is-active) .LightBox-module__scaleSlide___vZriG{opacity:0!important;transform:var(--position-transform, none) scale(1.1)!important}
1
+ .ControlSlider-module__wrapper___sHEkd{position:relative;width:100%;height:100%}.ControlSlider-module__slider___R3i9-{width:100%;height:100%}.ControlSlider-module__sliderItems___1MgPL{display:flex;overflow:hidden;width:100%;height:100%;transition:transform .3s ease-in-out}.ControlSlider-module__sliderItem___QQSkR{width:100%;height:100%;display:flex;position:relative}.ControlSlider-module__sliderImage___9hRl-{width:100%;height:100%;object-fit:cover}.ControlSlider-module__arrow___05ghY{position:absolute;display:flex;align-items:center;justify-content:center;border:none;background-color:transparent;top:50%;left:calc(var(--is-editor, 0) * -1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -1.3888888889vw);z-index:1;transform:translate(-50%,-50%);padding:0;width:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw);height:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw)}.ControlSlider-module__arrow___05ghY.ControlSlider-module__arrowVertical___tBfVN{left:50%;top:calc(var(--is-editor, 0) * -1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -1.3888888889vw);transform:translate(-50%,-50%)}.ControlSlider-module__nextArrow___-30Yc{left:unset;right:calc(var(--is-editor, 0) * -1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -1.3888888889vw);transform:translate(50%,-50%)}.ControlSlider-module__nextArrow___-30Yc.ControlSlider-module__arrowVertical___tBfVN{left:50%;right:unset;top:unset;bottom:calc(var(--is-editor, 0) * -1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -1.3888888889vw);transform:translate(-50%,50%)}.ControlSlider-module__arrowInner___aEra3{all:unset;cursor:pointer;width:100%;height:100%}.ControlSlider-module__arrowInner___aEra3:hover .ControlSlider-module__arrowIcon___S4ztF path{fill:var(--arrow-hover-color)!important}.ControlSlider-module__arrowImg___2dwJW{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.ControlSlider-module__arrowIcon___S4ztF{width:100%;height:100%}.ControlSlider-module__arrowIcon___S4ztF path{transition:fill .15s ease-in-out}.ControlSlider-module__mirror___brd6U{transform:translate(-50%,-50%) scaleX(-1)!important}.ControlSlider-module__arrowVertical___tBfVN.ControlSlider-module__mirror___brd6U{transform:translate(-50%,-50%) scaleY(-1)!important}.ControlSlider-module__pagination___bicLF{position:absolute;z-index:1;border-radius:50%}.ControlSlider-module__paginationInner___bT-P-{display:flex;gap:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw);padding-top:calc(var(--is-editor, 0) * .6944444444vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * .6944444444vw);padding-bottom:calc(var(--is-editor, 0) * .6944444444vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * .6944444444vw);padding-left:calc(var(--is-editor, 0) * 1.25vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.25vw);padding-right:calc(var(--is-editor, 0) * 1.25vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.25vw);border-radius:calc(var(--is-editor, 0) * 2.3611111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.3611111111vw)}.ControlSlider-module__paginationVertical___zYqKw{flex-direction:column}.ControlSlider-module__paginationItem___nTRbk{all:unset;flex-shrink:0;position:relative;width:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw);height:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw);cursor:pointer}.ControlSlider-module__paginationItem___nTRbk:hover .ControlSlider-module__dot___p1Qun{background-color:var(--pagination-hover-color)!important}.ControlSlider-module__dot___p1Qun{border-radius:50%;scale:.5;transition:background-color .3s ease-in-out,transform .3s ease-in-out;width:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw);height:calc(var(--is-editor, 0) * 1.1111111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.1111111111vw)}.ControlSlider-module__activeDot___LHFaj{transform:scale(2)}.ControlSlider-module__paginationInsideBottom___R3FWn{bottom:0;left:50%;transform:translate(-50%)}.ControlSlider-module__paginationInsideTop___V-qb-{left:50%;transform:translate(-50%);top:0}.ControlSlider-module__paginationOutsideBottom___14w8D{left:50%;transform:translate(-50%);bottom:calc(var(--is-editor, 0) * -2.4305555556vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -2.4305555556vw)}.ControlSlider-module__paginationOutsideTop___SCLqB{left:50%;transform:translate(-50%);top:calc(var(--is-editor, 0) * -2.4305555556vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -2.4305555556vw)}.ControlSlider-module__paginationInsideLeft___yOBRZ{top:50%;transform:translateY(-50%);left:calc(var(--is-editor, 0) * -2.4305555556vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -2.4305555556vw)}.ControlSlider-module__paginationInsideRight___Rtt3o{top:50%;transform:translateY(-50%);right:calc(var(--is-editor, 0) * -2.4305555556vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -2.4305555556vw)}.ControlSlider-module__paginationOutsideLeft___lahaw{top:50%;transform:translateY(-50%);left:calc(var(--is-editor, 0) * -5.4861111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -5.4861111111vw)}.ControlSlider-module__paginationOutsideRight___EtuQa{top:50%;transform:translateY(-50%);right:calc(var(--is-editor, 0) * -5.4861111111vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * -5.4861111111vw)}.ControlSlider-module__imgWrapper___UjEgB,.ControlSlider-module__wrapperInner___DLAWV{width:100%;height:100%}.ControlSlider-module__captionBlock___dJ6-j{pointer-events:none;position:absolute;top:0;z-index:1;left:0;right:0;bottom:0}.ControlSlider-module__captionTextWrapper___HFlpf{position:relative;width:100%;height:100%}.ControlSlider-module__captionText___uGBVc{pointer-events:none;max-width:100%;transition-property:opacity;transition-timing-function:ease-in-out;position:absolute;display:inline-block;white-space:pre-wrap;overflow-wrap:break-word;opacity:0}.ControlSlider-module__captionText___uGBVc.ControlSlider-module__active___WZK4G{opacity:1}.ControlSlider-module__withPointerEvents___t-18M{pointer-events:auto}.ControlSlider-module__absolute___KxmYB{position:absolute}.ControlSlider-module__topLeftAlignment___zjnGM{top:0;left:0}.ControlSlider-module__topCenterAlignment___gD1xW{top:0;left:50%;transform:translate(-50%)}.ControlSlider-module__topRightAlignment___NMapS{top:0;right:0}.ControlSlider-module__middleLeftAlignment___OnUrY{top:50%;transform:translateY(-50%);left:0}.ControlSlider-module__middleCenterAlignment___Tdkl0{top:50%;transform:translate(-50%,-50%);left:50%}.ControlSlider-module__middleRightAlignment___wEbfX{top:50%;transform:translateY(-50%);right:0}.ControlSlider-module__bottomLeftAlignment___cTP2-{bottom:0;left:0}.ControlSlider-module__bottomCenterAlignment___c54fB{bottom:0;left:50%;transform:translate(-50%)}.ControlSlider-module__bottomRightAlignment___kEwrz{bottom:0;right:0}.ControlSlider-module__clickOverlay___DZA28{position:absolute;top:0;left:0;width:100%;height:100%;cursor:pointer}.ControlSlider-module__contain___pLyq7{object-fit:contain}.ControlSlider-module__cover___KdDat{object-fit:cover}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}.RichTextRenderer-module__link___BWeZ2{color:inherit;cursor:pointer;pointer-events:auto;transition:color .2s ease}.RichTextRenderer-module__link___BWeZ2:hover{color:var(--link-hover-color)}.SvgImage-module__svg___q3xE-{width:100%;height:100%;color:transparent;display:inline-block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:var(--fill);transition:background-color .2s;-webkit-mask:var(--svg) no-repeat center/contain;mask:var(--svg) no-repeat center/contain}.SvgImage-module__svg___q3xE-:hover{background-color:var(--hover-fill)}.SvgImage-module__img___VsTm-{width:100%;height:100%;object-fit:contain}.ImageRevealSlider-module__imageRevealSlider___UE5Ob{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden}.ImageRevealSlider-module__image___Qjt-e{display:block;width:100%;height:100%;object-fit:cover;position:relative;-webkit-user-select:none;user-select:none;pointer-events:none}.ImageRevealSlider-module__link___N-iLG{width:100%;height:100%;display:block}.ImageRevealSlider-module__cursor___2U03d{position:absolute;top:0;left:0;pointer-events:none}.LightBox-module__heroImage___sTxNF{width:100%;height:100%;cursor:pointer;object-fit:cover}.LightBox-module__background___rm9ml{position:fixed;z-index:9997;top:0;left:0;right:0;bottom:0;width:100%;height:100%}.LightBox-module__editor___4ACaY{width:var(--cntrl-article-width)!important;margin-left:auto;margin-right:auto}.LightBox-module__contentStyle___Bgnsq{position:fixed;z-index:9999;top:0;left:0;right:0;bottom:0;overflow:auto;background:transparent;box-sizing:border-box}.LightBox-module__imageStyle___tLIlB{position:relative;display:block;cursor:pointer;background-color:transparent;max-width:100%;max-height:100%;width:auto;height:auto}.LightBox-module__imgWrapper___LuFUp{position:relative;display:flex;width:100%;height:100%;overflow:hidden;box-sizing:border-box}.LightBox-module__contain___8-yaS{object-fit:contain;max-width:100%;max-height:100%}.LightBox-module__cover___hNvOG{width:100%;height:100%;object-fit:cover}.LightBox-module__caption___b6L2I{z-index:9999;position:absolute;display:flex}.LightBox-module__captionTextInner___rCGNH{position:relative}.LightBox-module__lightboxSplide___XFuWC.splide,.LightBox-module__lightboxSplide___XFuWC .splide__track{height:100%}.LightBox-module__arrow___iz38X{position:absolute;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;background-color:transparent;top:50%;z-index:1;transform:translate(-50%,-50%);padding:0;left:calc(var(--is-editor, 0) * 1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.3888888889vw);width:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw);height:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw)}.LightBox-module__arrow___iz38X.LightBox-module__arrowVertical___Zfz81{left:50%;top:calc(var(--is-editor, 0) * 1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.3888888889vw);transform:translate(-50%,-50%)}.LightBox-module__nextArrow___zkAQN{left:unset;right:calc(var(--is-editor, 0) * 1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.3888888889vw);transform:translate(50%,-50%)}.LightBox-module__nextArrow___zkAQN.LightBox-module__arrowVertical___Zfz81{left:50%;right:unset;top:unset;bottom:calc(var(--is-editor, 0) * 1.3888888889vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 1.3888888889vw);transform:translate(-50%,50%)}.LightBox-module__arrowInner___p48sW{all:unset;cursor:pointer;width:100%;height:100%}.LightBox-module__arrowInner___p48sW:hover .LightBox-module__arrowIcon___3VaFf path{fill:var(--arrow-hover-color)!important}.LightBox-module__arrowImg___pNV88{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.LightBox-module__mirror___pjeXc{transform:translate(-50%,-50%) scaleX(-1)!important}.LightBox-module__arrowVertical___Zfz81.LightBox-module__mirror___pjeXc{transform:translate(-50%,-50%) scaleY(-1)!important}.LightBox-module__thumbsContainerVertical___wttk5{flex-direction:column;display:flex}.LightBox-module__thumbsContainer___osSma{display:flex;align-items:center;justify-content:center;pointer-events:auto}.LightBox-module__thumbsAlignStart___MO6tY{align-items:flex-start}.LightBox-module__thumbsAlignCenter___Q4sUx{align-items:center}.LightBox-module__thumbsAlignEnd___p4y9R{align-items:flex-end}.LightBox-module__thumbItem___HvnF3{all:unset;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;transition:transform .1s ease,opacity .1s ease}.LightBox-module__thumbItem___HvnF3:hover{opacity:var(--thumb-hover)!important}.LightBox-module__closeButton___g2khP{all:unset;cursor:pointer;position:absolute;width:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw);height:calc(var(--is-editor, 0) * 2.0833333333vw / var(--cntrl-reverse-layout-deviation, 1) + (1 - var(--is-editor, 0)) * 2.0833333333vw)}@keyframes LightBox-module__lbFadeIn___P8mx0{0%{opacity:0}to{opacity:1}}.LightBox-module__fadeIn___0m5GW{animation-name:LightBox-module__lbFadeIn___P8mx0}@keyframes LightBox-module__lbSlideInLeft___ygsXZ{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes LightBox-module__lbSlideInRight___w2YKV{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes LightBox-module__lbSlideInTop___W7CSQ{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes LightBox-module__lbSlideInBottom___7kiT2{0%{transform:translateY(100%)}to{transform:translateY(0)}}.LightBox-module__slideInLeft___gPYwC{animation-name:LightBox-module__lbSlideInLeft___ygsXZ}.LightBox-module__slideInRight___S-pPp{animation-name:LightBox-module__lbSlideInRight___w2YKV}.LightBox-module__slideInTop___DFdAj{animation-name:LightBox-module__lbSlideInTop___W7CSQ}.LightBox-module__slideInBottom___m27kZ{animation-name:LightBox-module__lbSlideInBottom___7kiT2}@keyframes LightBox-module__lbFadeOut___MhEeN{0%{opacity:1}to{opacity:0}}.LightBox-module__fadeOut___55qBR{animation-name:LightBox-module__lbFadeOut___MhEeN!important}@keyframes LightBox-module__lbSlideOutLeft___xM4sO{0%{transform:translate(0)}to{transform:translate(-100%)}}@keyframes LightBox-module__lbSlideOutRight___Jppgj{0%{transform:translate(0)}to{transform:translate(100%)}}@keyframes LightBox-module__lbSlideOutTop___pvscE{0%{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes LightBox-module__lbSlideOutBottom___oFjPG{0%{transform:translateY(0)}to{transform:translateY(100%)}}.LightBox-module__slideOutLeft___NvU7P{animation-name:LightBox-module__lbSlideOutLeft___xM4sO!important}.LightBox-module__slideOutRight___SK7eC{animation-name:LightBox-module__lbSlideOutRight___Jppgj!important}.LightBox-module__slideOutTop___Vgg0z{animation-name:LightBox-module__lbSlideOutTop___pvscE!important}.LightBox-module__slideOutBottom___nJ0Ef{animation-name:LightBox-module__lbSlideOutBottom___oFjPG!important}.LightBox-module__lightboxSplide___XFuWC.splide--fade .LightBox-module__scaleSlide___vZriG{opacity:0!important;transform:var(--position-transform, none) scale(.9)!important;transition:opacity var(--splide-speed, .5s) ease,transform var(--splide-speed, .5s) ease!important}.LightBox-module__lightboxSplide___XFuWC.splide--fade .splide__slide.is-active .LightBox-module__scaleSlide___vZriG{opacity:1!important;transform:var(--position-transform, none) scale(1)!important}.LightBox-module__lightboxSplide___XFuWC.splide--fade .splide__slide:not(.is-active) .LightBox-module__scaleSlide___vZriG{opacity:0!important;transform:var(--position-transform, none) scale(1.1)!important}
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const reactSplide = require("@splidejs/react-splide");
6
6
  const cn = require("classnames");
7
+ const framerMotion = require("framer-motion");
7
8
  const reactDom = require("react-dom");
8
9
  const wrapper = "ControlSlider-module__wrapper___sHEkd";
9
10
  const sliderItem = "ControlSlider-module__sliderItem___QQSkR";
@@ -1040,14 +1041,15 @@ const ControlSliderComponent = {
1040
1041
  const imageRevealSlider = "ImageRevealSlider-module__imageRevealSlider___UE5Ob";
1041
1042
  const image = "ImageRevealSlider-module__image___Qjt-e";
1042
1043
  const link = "ImageRevealSlider-module__link___N-iLG";
1044
+ const cursor = "ImageRevealSlider-module__cursor___2U03d";
1043
1045
  const styles = {
1044
1046
  imageRevealSlider,
1045
1047
  image,
1046
- link
1048
+ link,
1049
+ cursor
1047
1050
  };
1048
1051
  function isMouseOverImage(mouseX, mouseY, placedImages) {
1049
- for (let i = placedImages.length - 1; i >= 0; i--) {
1050
- const img2 = placedImages[i];
1052
+ for (const img2 of placedImages) {
1051
1053
  const imgEl = new Image();
1052
1054
  imgEl.src = img2.url;
1053
1055
  const imgWidth = img2.width ? Number.parseFloat(img2.width) : imgEl.naturalWidth;
@@ -1055,10 +1057,10 @@ function isMouseOverImage(mouseX, mouseY, placedImages) {
1055
1057
  const halfW = imgWidth / 2;
1056
1058
  const halfH = imgHeight / 2;
1057
1059
  if (mouseX >= img2.x - halfW && mouseX <= img2.x + halfW && mouseY >= img2.y - halfH && mouseY <= img2.y + halfH) {
1058
- return { isOverImage: true, hasLink: img2.link.length > 0 };
1060
+ return true;
1059
1061
  }
1060
1062
  }
1061
- return { isOverImage: false, hasLink: false };
1063
+ return false;
1062
1064
  }
1063
1065
  function getImageSize(url) {
1064
1066
  return new Promise((resolve) => {
@@ -1088,17 +1090,103 @@ async function calculateImageWidthHeight(imgUrl, sizeType, customWidth, randomRa
1088
1090
  return { width, height, finalWidth: `${width}px` };
1089
1091
  }
1090
1092
  function ImageRevealSlider({ settings, content, isEditor }) {
1091
- const divRef = React.useRef(null);
1093
+ const [divRef, setDivRef] = React.useState(null);
1092
1094
  const [placedImages, setPlacedImages] = React.useState([]);
1093
1095
  const [counter, setCounter] = React.useState(0);
1094
1096
  const imageIdCounter = React.useRef(0);
1097
+ const defaultImageCount = 1;
1098
+ const lastMousePos = React.useRef({ x: 0, y: 0 });
1099
+ const [isInside, setIsInside] = React.useState(false);
1100
+ const cursorX = framerMotion.useMotionValue(-100);
1101
+ const cursorY = framerMotion.useMotionValue(-100);
1102
+ const defaultScale = 32;
1103
+ const cursorW = framerMotion.useMotionValue(32);
1104
+ const cursorH = framerMotion.useMotionValue(32);
1105
+ const [customCursorImg, setCustomCursorImg] = React.useState("none");
1106
+ React.useEffect(() => {
1107
+ if (!divRef) return;
1108
+ const updateCursorPosition = (clientX, clientY) => {
1109
+ const divRect = divRef.getBoundingClientRect();
1110
+ const newX = clientX - cursorW.get() / 2 - divRect.left;
1111
+ const newY = clientY - cursorH.get() / 2 - divRect.top;
1112
+ cursorX.jump(newX);
1113
+ cursorY.jump(newY);
1114
+ };
1115
+ const mouseMove = (e) => {
1116
+ e.stopPropagation();
1117
+ lastMousePos.current = { x: e.clientX, y: e.clientY };
1118
+ updateCursorPosition(e.clientX, e.clientY);
1119
+ };
1120
+ const handleScroll = () => {
1121
+ if (!isInside) return;
1122
+ updateCursorPosition(lastMousePos.current.x, lastMousePos.current.y);
1123
+ };
1124
+ divRef.addEventListener("mousemove", mouseMove);
1125
+ window.addEventListener("scroll", handleScroll, true);
1126
+ return () => {
1127
+ divRef.removeEventListener("mousemove", mouseMove);
1128
+ window.removeEventListener("scroll", handleScroll, true);
1129
+ };
1130
+ }, [cursorX, cursorY, cursorW, cursorH, divRef, isInside]);
1131
+ React.useEffect(() => {
1132
+ if (!isInside) {
1133
+ setCustomCursorImg("none");
1134
+ cursorW.set(0);
1135
+ cursorH.set(0);
1136
+ }
1137
+ }, [isInside]);
1095
1138
  const { sizeType, imageWidth: customWidth, randomRangeImageWidth: randomRange } = settings.imageSize;
1096
1139
  const { revealPosition, visible, target } = settings.position;
1097
1140
  const { cursorType, defaultCursorScale, defaultCursor, hoverCursorScale, hoverCursor } = settings.cursor;
1098
- const [cursorPos, setCursorPos] = React.useState({ x: 0, y: 0 });
1099
- const [cursorScale, setCursorScale] = React.useState(defaultCursorScale);
1100
- const [isCursorVisible, setIsCursorVisible] = React.useState(false);
1101
- const lastMousePos = React.useRef(null);
1141
+ React.useEffect(() => {
1142
+ const updateCursor = () => {
1143
+ if (cursorType === "system") {
1144
+ setCustomCursorImg("none");
1145
+ cursorW.set(defaultScale);
1146
+ cursorH.set(defaultScale);
1147
+ return;
1148
+ }
1149
+ const elUnderCursor = document.elementFromPoint(cursorX.get() + cursorW.get() / 2, cursorY.get() + cursorH.get() / 2);
1150
+ if (elUnderCursor && elUnderCursor.closest("a.link")) {
1151
+ setCustomCursorImg("none");
1152
+ cursorW.set(defaultScale);
1153
+ cursorH.set(defaultScale);
1154
+ return;
1155
+ }
1156
+ if (target === "area") {
1157
+ setCustomCursorImg(hoverCursor || "none");
1158
+ cursorW.set(defaultScale * hoverCursorScale || 1);
1159
+ cursorH.set(defaultScale * hoverCursorScale || 1);
1160
+ } else if (isMouseOverImage(cursorX.get() + cursorW.get() / 2, cursorY.get() + cursorH.get() / 2, placedImages)) {
1161
+ setCustomCursorImg(hoverCursor || "none");
1162
+ cursorW.set(defaultScale * hoverCursorScale || 1);
1163
+ cursorH.set(defaultScale * hoverCursorScale || 1);
1164
+ } else {
1165
+ setCustomCursorImg(defaultCursor || "none");
1166
+ cursorW.set(defaultScale * defaultCursorScale || 1);
1167
+ cursorH.set(defaultScale * defaultCursorScale || 1);
1168
+ }
1169
+ };
1170
+ const unsubscribeX = cursorX.onChange(updateCursor);
1171
+ const unsubscribeY = cursorY.onChange(updateCursor);
1172
+ updateCursor();
1173
+ return () => {
1174
+ unsubscribeX();
1175
+ unsubscribeY();
1176
+ };
1177
+ }, [
1178
+ cursorType,
1179
+ target,
1180
+ hoverCursor,
1181
+ defaultCursor,
1182
+ hoverCursorScale,
1183
+ defaultCursorScale,
1184
+ cursorX,
1185
+ cursorY,
1186
+ cursorW,
1187
+ cursorH,
1188
+ placedImages
1189
+ ]);
1102
1190
  const createNewImage = async (imgData, containerWidth, containerHeight, position = {}) => {
1103
1191
  const { width, height, finalWidth } = await calculateImageWidthHeight(
1104
1192
  imgData.image.url,
@@ -1127,38 +1215,37 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1127
1215
  };
1128
1216
  };
1129
1217
  const defaultContentUrls = React.useMemo(() => {
1130
- const defaultContentLength = Math.min(content.length, 1);
1218
+ const defaultContentLength = Math.min(content.length, defaultImageCount);
1131
1219
  return content.filter((_, i) => i < defaultContentLength).map((c) => c.image.url).join("-");
1132
1220
  }, [content]);
1133
1221
  React.useEffect(() => {
1134
- if (!divRef.current || content.length === 0) return;
1135
- const rect = divRef.current.getBoundingClientRect();
1222
+ if (!divRef || content.length === 0) return;
1223
+ const rect = divRef.getBoundingClientRect();
1136
1224
  const containerWidth = rect.width;
1137
1225
  const containerHeight = rect.height;
1138
1226
  const defaultPlaced = [];
1139
1227
  const placeImages = async () => {
1140
- for (let i = 0; i < 1 && i < content.length; i++) {
1228
+ for (let i = 0; i < defaultImageCount && i < content.length; i++) {
1141
1229
  const imgData = content[i];
1142
1230
  const newImg = await createNewImage(imgData, containerWidth, containerHeight);
1143
1231
  defaultPlaced.push(newImg);
1144
1232
  }
1145
1233
  setPlacedImages(defaultPlaced);
1146
- setCounter(1 % content.length);
1234
+ setCounter(defaultImageCount % content.length);
1147
1235
  };
1148
1236
  placeImages();
1149
- }, [defaultContentUrls, sizeType, customWidth, randomRange, revealPosition]);
1237
+ }, [defaultContentUrls, sizeType, customWidth, randomRange, revealPosition, divRef]);
1150
1238
  React.useEffect(() => {
1151
1239
  if (visible === "last One") {
1152
1240
  setPlacedImages((prev) => prev.length > 0 ? [prev[prev.length - 1]] : []);
1153
1241
  }
1154
1242
  }, [visible]);
1155
1243
  const handleClick = async (e) => {
1156
- if (!divRef.current) return;
1157
- const rect = divRef.current.getBoundingClientRect();
1244
+ if (!divRef) return;
1245
+ const rect = divRef.getBoundingClientRect();
1158
1246
  const clickX = e.clientX - rect.left;
1159
1247
  const clickY = e.clientY - rect.top;
1160
- const { isOverImage: isOverImage2 } = isMouseOverImage(clickX, clickY, placedImages);
1161
- if (target === "image" && !isOverImage2) return;
1248
+ if (target === "image" && !isMouseOverImage(clickX, clickY, placedImages)) return;
1162
1249
  let x = 0, y = 0;
1163
1250
  if (revealPosition === "on Click") {
1164
1251
  x = clickX;
@@ -1175,57 +1262,20 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1175
1262
  setPlacedImages((prev) => visible === "all" ? [...prev, newImage] : [newImage]);
1176
1263
  setCounter((prev) => prev >= content.length - 1 ? 0 : prev + 1);
1177
1264
  };
1178
- React.useEffect(() => {
1179
- if (!divRef.current) return;
1180
- const handleMouseMove = (e) => {
1181
- if (!divRef.current) return;
1182
- lastMousePos.current = { x: e.clientX, y: e.clientY };
1183
- const rect = divRef.current.getBoundingClientRect();
1184
- const x = e.clientX - rect.left;
1185
- const y = e.clientY - rect.top;
1186
- const insideContainer = e.clientX >= rect.left && e.clientX <= rect.right && e.clientY >= rect.top && e.clientY <= rect.bottom;
1187
- const { isOverImage: isOverImage2 } = isMouseOverImage(x, y, placedImages);
1188
- setCursorPos({ x, y });
1189
- setCursorScale(isOverImage2 || target === "area" ? hoverCursorScale : defaultCursorScale);
1190
- setIsCursorVisible(insideContainer || isOverImage2);
1191
- };
1192
- const handleScroll = () => {
1193
- if (!divRef.current || !lastMousePos.current) return;
1194
- const rect = divRef.current.getBoundingClientRect();
1195
- const { x: clientX, y: clientY } = lastMousePos.current;
1196
- const x = clientX - rect.left;
1197
- const y = clientY - rect.top;
1198
- const insideContainer = clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
1199
- const { isOverImage: isOverImage2 } = isMouseOverImage(x, y, placedImages);
1200
- setCursorPos({ x, y });
1201
- setCursorScale(isOverImage2 || target === "area" ? hoverCursorScale : defaultCursorScale);
1202
- setIsCursorVisible(insideContainer || isOverImage2);
1203
- };
1204
- const handleMouseLeave = () => {
1205
- setIsCursorVisible(false);
1206
- };
1207
- const divEl = divRef.current;
1208
- divEl.addEventListener("mousemove", handleMouseMove);
1209
- divEl.addEventListener("mouseleave", handleMouseLeave);
1210
- window.addEventListener("scroll", handleScroll, { passive: true });
1211
- return () => {
1212
- divEl.removeEventListener("mousemove", handleMouseMove);
1213
- divEl.removeEventListener("mouseleave", handleMouseLeave);
1214
- window.removeEventListener("scroll", handleScroll);
1215
- };
1216
- }, [placedImages, hoverCursorScale, defaultCursorScale]);
1217
- const { isOverImage, hasLink: overImageHasLink } = isMouseOverImage(cursorPos.x, cursorPos.y, placedImages);
1218
1265
  return /* @__PURE__ */ jsxRuntime.jsxs(
1219
1266
  "div",
1220
1267
  {
1221
- ref: divRef,
1268
+ ref: setDivRef,
1222
1269
  onClick: handleClick,
1270
+ onMouseEnter: () => setIsInside(true),
1271
+ onMouseLeave: () => setIsInside(false),
1223
1272
  className: styles.imageRevealSlider,
1224
- style: { cursor: cursorType === "custom" ? !defaultCursor ? "default" : "none" : "default" },
1273
+ style: { cursor: customCursorImg === "none" ? "default" : "none" },
1225
1274
  children: [
1226
1275
  placedImages.map((img2) => /* @__PURE__ */ jsxRuntime.jsx(
1227
1276
  "div",
1228
1277
  {
1278
+ className: styles.wrapper,
1229
1279
  style: {
1230
1280
  top: `${img2.y}px`,
1231
1281
  left: `${img2.x}px`,
@@ -1233,7 +1283,7 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1233
1283
  transform: "translate(-50%, -50%)",
1234
1284
  width: img2.width ?? "auto",
1235
1285
  height: "auto",
1236
- cursor: cursorType === "custom" ? !hoverCursor ? "default" : "none" : "default"
1286
+ cursor: customCursorImg === "none" ? "default" : "none"
1237
1287
  },
1238
1288
  children: target === "area" && img2.link ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: img2.link, target: "_blank", className: styles.link, children: /* @__PURE__ */ jsxRuntime.jsx(
1239
1289
  "img",
@@ -1255,21 +1305,18 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1255
1305
  },
1256
1306
  img2.id
1257
1307
  )),
1258
- cursorType === "custom" && (defaultCursor || hoverCursor) && isCursorVisible && (target === "area" && !overImageHasLink || target !== "area") && /* @__PURE__ */ jsxRuntime.jsx(
1259
- "div",
1308
+ /* @__PURE__ */ jsxRuntime.jsx(
1309
+ framerMotion.motion.div,
1260
1310
  {
1311
+ className: styles.cursor,
1261
1312
  style: {
1262
- position: "absolute",
1263
- top: cursorPos.y,
1264
- left: cursorPos.x,
1265
- width: "40px",
1266
- height: "40px",
1267
- pointerEvents: "none",
1268
- backgroundImage: `url(${isOverImage || target === "area" ? hoverCursor : defaultCursor})`,
1269
- backgroundSize: "contain",
1270
- backgroundRepeat: "no-repeat",
1271
- transform: `translate(-50%, -50%) scale(${cursorScale})`,
1272
- zIndex: 1e3
1313
+ x: cursorX,
1314
+ y: cursorY,
1315
+ width: cursorW.get(),
1316
+ height: cursorH.get(),
1317
+ backgroundImage: `url('${customCursorImg}')`,
1318
+ backgroundSize: "cover",
1319
+ backgroundPosition: "center"
1273
1320
  }
1274
1321
  }
1275
1322
  )
@@ -1476,7 +1523,8 @@ const ControlImageRevealSliderComponent = {
1476
1523
  {
1477
1524
  if: [
1478
1525
  { name: "position.target", value: "image" },
1479
- { name: "cursor.cursorType", value: "custom" }
1526
+ { name: "cursor.cursorType", value: "custom" },
1527
+ { name: "cursor.defaultCursor", value: null, isNotEqual: true }
1480
1528
  ],
1481
1529
  then: {
1482
1530
  name: "properties.cursor.properties.defaultCursorScale.display.visible",
@@ -1494,10 +1542,10 @@ const ControlImageRevealSliderComponent = {
1494
1542
  }
1495
1543
  },
1496
1544
  {
1497
- if: {
1498
- name: "cursor.cursorType",
1499
- value: "custom"
1500
- },
1545
+ if: [
1546
+ { name: "cursor.cursorType", value: "custom" },
1547
+ { name: "cursor.hoverCursor", value: null, isNotEqual: true }
1548
+ ],
1501
1549
  then: {
1502
1550
  name: "properties.cursor.properties.hoverCursorScale.display.visible",
1503
1551
  value: true
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import React, { useState, useEffect, useRef, useMemo, useCallback } from "react";
3
3
  import { Splide, SplideSlide } from "@splidejs/react-splide";
4
4
  import cn from "classnames";
5
+ import { useMotionValue, motion } from "framer-motion";
5
6
  import { createPortal } from "react-dom";
6
7
  const wrapper = "ControlSlider-module__wrapper___sHEkd";
7
8
  const sliderItem = "ControlSlider-module__sliderItem___QQSkR";
@@ -1038,14 +1039,15 @@ const ControlSliderComponent = {
1038
1039
  const imageRevealSlider = "ImageRevealSlider-module__imageRevealSlider___UE5Ob";
1039
1040
  const image = "ImageRevealSlider-module__image___Qjt-e";
1040
1041
  const link = "ImageRevealSlider-module__link___N-iLG";
1042
+ const cursor = "ImageRevealSlider-module__cursor___2U03d";
1041
1043
  const styles = {
1042
1044
  imageRevealSlider,
1043
1045
  image,
1044
- link
1046
+ link,
1047
+ cursor
1045
1048
  };
1046
1049
  function isMouseOverImage(mouseX, mouseY, placedImages) {
1047
- for (let i = placedImages.length - 1; i >= 0; i--) {
1048
- const img2 = placedImages[i];
1050
+ for (const img2 of placedImages) {
1049
1051
  const imgEl = new Image();
1050
1052
  imgEl.src = img2.url;
1051
1053
  const imgWidth = img2.width ? Number.parseFloat(img2.width) : imgEl.naturalWidth;
@@ -1053,10 +1055,10 @@ function isMouseOverImage(mouseX, mouseY, placedImages) {
1053
1055
  const halfW = imgWidth / 2;
1054
1056
  const halfH = imgHeight / 2;
1055
1057
  if (mouseX >= img2.x - halfW && mouseX <= img2.x + halfW && mouseY >= img2.y - halfH && mouseY <= img2.y + halfH) {
1056
- return { isOverImage: true, hasLink: img2.link.length > 0 };
1058
+ return true;
1057
1059
  }
1058
1060
  }
1059
- return { isOverImage: false, hasLink: false };
1061
+ return false;
1060
1062
  }
1061
1063
  function getImageSize(url) {
1062
1064
  return new Promise((resolve) => {
@@ -1086,17 +1088,103 @@ async function calculateImageWidthHeight(imgUrl, sizeType, customWidth, randomRa
1086
1088
  return { width, height, finalWidth: `${width}px` };
1087
1089
  }
1088
1090
  function ImageRevealSlider({ settings, content, isEditor }) {
1089
- const divRef = useRef(null);
1091
+ const [divRef, setDivRef] = useState(null);
1090
1092
  const [placedImages, setPlacedImages] = useState([]);
1091
1093
  const [counter, setCounter] = useState(0);
1092
1094
  const imageIdCounter = useRef(0);
1095
+ const defaultImageCount = 1;
1096
+ const lastMousePos = useRef({ x: 0, y: 0 });
1097
+ const [isInside, setIsInside] = useState(false);
1098
+ const cursorX = useMotionValue(-100);
1099
+ const cursorY = useMotionValue(-100);
1100
+ const defaultScale = 32;
1101
+ const cursorW = useMotionValue(32);
1102
+ const cursorH = useMotionValue(32);
1103
+ const [customCursorImg, setCustomCursorImg] = useState("none");
1104
+ useEffect(() => {
1105
+ if (!divRef) return;
1106
+ const updateCursorPosition = (clientX, clientY) => {
1107
+ const divRect = divRef.getBoundingClientRect();
1108
+ const newX = clientX - cursorW.get() / 2 - divRect.left;
1109
+ const newY = clientY - cursorH.get() / 2 - divRect.top;
1110
+ cursorX.jump(newX);
1111
+ cursorY.jump(newY);
1112
+ };
1113
+ const mouseMove = (e) => {
1114
+ e.stopPropagation();
1115
+ lastMousePos.current = { x: e.clientX, y: e.clientY };
1116
+ updateCursorPosition(e.clientX, e.clientY);
1117
+ };
1118
+ const handleScroll = () => {
1119
+ if (!isInside) return;
1120
+ updateCursorPosition(lastMousePos.current.x, lastMousePos.current.y);
1121
+ };
1122
+ divRef.addEventListener("mousemove", mouseMove);
1123
+ window.addEventListener("scroll", handleScroll, true);
1124
+ return () => {
1125
+ divRef.removeEventListener("mousemove", mouseMove);
1126
+ window.removeEventListener("scroll", handleScroll, true);
1127
+ };
1128
+ }, [cursorX, cursorY, cursorW, cursorH, divRef, isInside]);
1129
+ useEffect(() => {
1130
+ if (!isInside) {
1131
+ setCustomCursorImg("none");
1132
+ cursorW.set(0);
1133
+ cursorH.set(0);
1134
+ }
1135
+ }, [isInside]);
1093
1136
  const { sizeType, imageWidth: customWidth, randomRangeImageWidth: randomRange } = settings.imageSize;
1094
1137
  const { revealPosition, visible, target } = settings.position;
1095
1138
  const { cursorType, defaultCursorScale, defaultCursor, hoverCursorScale, hoverCursor } = settings.cursor;
1096
- const [cursorPos, setCursorPos] = useState({ x: 0, y: 0 });
1097
- const [cursorScale, setCursorScale] = useState(defaultCursorScale);
1098
- const [isCursorVisible, setIsCursorVisible] = useState(false);
1099
- const lastMousePos = useRef(null);
1139
+ useEffect(() => {
1140
+ const updateCursor = () => {
1141
+ if (cursorType === "system") {
1142
+ setCustomCursorImg("none");
1143
+ cursorW.set(defaultScale);
1144
+ cursorH.set(defaultScale);
1145
+ return;
1146
+ }
1147
+ const elUnderCursor = document.elementFromPoint(cursorX.get() + cursorW.get() / 2, cursorY.get() + cursorH.get() / 2);
1148
+ if (elUnderCursor && elUnderCursor.closest("a.link")) {
1149
+ setCustomCursorImg("none");
1150
+ cursorW.set(defaultScale);
1151
+ cursorH.set(defaultScale);
1152
+ return;
1153
+ }
1154
+ if (target === "area") {
1155
+ setCustomCursorImg(hoverCursor || "none");
1156
+ cursorW.set(defaultScale * hoverCursorScale || 1);
1157
+ cursorH.set(defaultScale * hoverCursorScale || 1);
1158
+ } else if (isMouseOverImage(cursorX.get() + cursorW.get() / 2, cursorY.get() + cursorH.get() / 2, placedImages)) {
1159
+ setCustomCursorImg(hoverCursor || "none");
1160
+ cursorW.set(defaultScale * hoverCursorScale || 1);
1161
+ cursorH.set(defaultScale * hoverCursorScale || 1);
1162
+ } else {
1163
+ setCustomCursorImg(defaultCursor || "none");
1164
+ cursorW.set(defaultScale * defaultCursorScale || 1);
1165
+ cursorH.set(defaultScale * defaultCursorScale || 1);
1166
+ }
1167
+ };
1168
+ const unsubscribeX = cursorX.onChange(updateCursor);
1169
+ const unsubscribeY = cursorY.onChange(updateCursor);
1170
+ updateCursor();
1171
+ return () => {
1172
+ unsubscribeX();
1173
+ unsubscribeY();
1174
+ };
1175
+ }, [
1176
+ cursorType,
1177
+ target,
1178
+ hoverCursor,
1179
+ defaultCursor,
1180
+ hoverCursorScale,
1181
+ defaultCursorScale,
1182
+ cursorX,
1183
+ cursorY,
1184
+ cursorW,
1185
+ cursorH,
1186
+ placedImages
1187
+ ]);
1100
1188
  const createNewImage = async (imgData, containerWidth, containerHeight, position = {}) => {
1101
1189
  const { width, height, finalWidth } = await calculateImageWidthHeight(
1102
1190
  imgData.image.url,
@@ -1125,38 +1213,37 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1125
1213
  };
1126
1214
  };
1127
1215
  const defaultContentUrls = useMemo(() => {
1128
- const defaultContentLength = Math.min(content.length, 1);
1216
+ const defaultContentLength = Math.min(content.length, defaultImageCount);
1129
1217
  return content.filter((_, i) => i < defaultContentLength).map((c) => c.image.url).join("-");
1130
1218
  }, [content]);
1131
1219
  useEffect(() => {
1132
- if (!divRef.current || content.length === 0) return;
1133
- const rect = divRef.current.getBoundingClientRect();
1220
+ if (!divRef || content.length === 0) return;
1221
+ const rect = divRef.getBoundingClientRect();
1134
1222
  const containerWidth = rect.width;
1135
1223
  const containerHeight = rect.height;
1136
1224
  const defaultPlaced = [];
1137
1225
  const placeImages = async () => {
1138
- for (let i = 0; i < 1 && i < content.length; i++) {
1226
+ for (let i = 0; i < defaultImageCount && i < content.length; i++) {
1139
1227
  const imgData = content[i];
1140
1228
  const newImg = await createNewImage(imgData, containerWidth, containerHeight);
1141
1229
  defaultPlaced.push(newImg);
1142
1230
  }
1143
1231
  setPlacedImages(defaultPlaced);
1144
- setCounter(1 % content.length);
1232
+ setCounter(defaultImageCount % content.length);
1145
1233
  };
1146
1234
  placeImages();
1147
- }, [defaultContentUrls, sizeType, customWidth, randomRange, revealPosition]);
1235
+ }, [defaultContentUrls, sizeType, customWidth, randomRange, revealPosition, divRef]);
1148
1236
  useEffect(() => {
1149
1237
  if (visible === "last One") {
1150
1238
  setPlacedImages((prev) => prev.length > 0 ? [prev[prev.length - 1]] : []);
1151
1239
  }
1152
1240
  }, [visible]);
1153
1241
  const handleClick = async (e) => {
1154
- if (!divRef.current) return;
1155
- const rect = divRef.current.getBoundingClientRect();
1242
+ if (!divRef) return;
1243
+ const rect = divRef.getBoundingClientRect();
1156
1244
  const clickX = e.clientX - rect.left;
1157
1245
  const clickY = e.clientY - rect.top;
1158
- const { isOverImage: isOverImage2 } = isMouseOverImage(clickX, clickY, placedImages);
1159
- if (target === "image" && !isOverImage2) return;
1246
+ if (target === "image" && !isMouseOverImage(clickX, clickY, placedImages)) return;
1160
1247
  let x = 0, y = 0;
1161
1248
  if (revealPosition === "on Click") {
1162
1249
  x = clickX;
@@ -1173,57 +1260,20 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1173
1260
  setPlacedImages((prev) => visible === "all" ? [...prev, newImage] : [newImage]);
1174
1261
  setCounter((prev) => prev >= content.length - 1 ? 0 : prev + 1);
1175
1262
  };
1176
- useEffect(() => {
1177
- if (!divRef.current) return;
1178
- const handleMouseMove = (e) => {
1179
- if (!divRef.current) return;
1180
- lastMousePos.current = { x: e.clientX, y: e.clientY };
1181
- const rect = divRef.current.getBoundingClientRect();
1182
- const x = e.clientX - rect.left;
1183
- const y = e.clientY - rect.top;
1184
- const insideContainer = e.clientX >= rect.left && e.clientX <= rect.right && e.clientY >= rect.top && e.clientY <= rect.bottom;
1185
- const { isOverImage: isOverImage2 } = isMouseOverImage(x, y, placedImages);
1186
- setCursorPos({ x, y });
1187
- setCursorScale(isOverImage2 || target === "area" ? hoverCursorScale : defaultCursorScale);
1188
- setIsCursorVisible(insideContainer || isOverImage2);
1189
- };
1190
- const handleScroll = () => {
1191
- if (!divRef.current || !lastMousePos.current) return;
1192
- const rect = divRef.current.getBoundingClientRect();
1193
- const { x: clientX, y: clientY } = lastMousePos.current;
1194
- const x = clientX - rect.left;
1195
- const y = clientY - rect.top;
1196
- const insideContainer = clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
1197
- const { isOverImage: isOverImage2 } = isMouseOverImage(x, y, placedImages);
1198
- setCursorPos({ x, y });
1199
- setCursorScale(isOverImage2 || target === "area" ? hoverCursorScale : defaultCursorScale);
1200
- setIsCursorVisible(insideContainer || isOverImage2);
1201
- };
1202
- const handleMouseLeave = () => {
1203
- setIsCursorVisible(false);
1204
- };
1205
- const divEl = divRef.current;
1206
- divEl.addEventListener("mousemove", handleMouseMove);
1207
- divEl.addEventListener("mouseleave", handleMouseLeave);
1208
- window.addEventListener("scroll", handleScroll, { passive: true });
1209
- return () => {
1210
- divEl.removeEventListener("mousemove", handleMouseMove);
1211
- divEl.removeEventListener("mouseleave", handleMouseLeave);
1212
- window.removeEventListener("scroll", handleScroll);
1213
- };
1214
- }, [placedImages, hoverCursorScale, defaultCursorScale]);
1215
- const { isOverImage, hasLink: overImageHasLink } = isMouseOverImage(cursorPos.x, cursorPos.y, placedImages);
1216
1263
  return /* @__PURE__ */ jsxs(
1217
1264
  "div",
1218
1265
  {
1219
- ref: divRef,
1266
+ ref: setDivRef,
1220
1267
  onClick: handleClick,
1268
+ onMouseEnter: () => setIsInside(true),
1269
+ onMouseLeave: () => setIsInside(false),
1221
1270
  className: styles.imageRevealSlider,
1222
- style: { cursor: cursorType === "custom" ? !defaultCursor ? "default" : "none" : "default" },
1271
+ style: { cursor: customCursorImg === "none" ? "default" : "none" },
1223
1272
  children: [
1224
1273
  placedImages.map((img2) => /* @__PURE__ */ jsx(
1225
1274
  "div",
1226
1275
  {
1276
+ className: styles.wrapper,
1227
1277
  style: {
1228
1278
  top: `${img2.y}px`,
1229
1279
  left: `${img2.x}px`,
@@ -1231,7 +1281,7 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1231
1281
  transform: "translate(-50%, -50%)",
1232
1282
  width: img2.width ?? "auto",
1233
1283
  height: "auto",
1234
- cursor: cursorType === "custom" ? !hoverCursor ? "default" : "none" : "default"
1284
+ cursor: customCursorImg === "none" ? "default" : "none"
1235
1285
  },
1236
1286
  children: target === "area" && img2.link ? /* @__PURE__ */ jsx("a", { href: img2.link, target: "_blank", className: styles.link, children: /* @__PURE__ */ jsx(
1237
1287
  "img",
@@ -1253,21 +1303,18 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1253
1303
  },
1254
1304
  img2.id
1255
1305
  )),
1256
- cursorType === "custom" && (defaultCursor || hoverCursor) && isCursorVisible && (target === "area" && !overImageHasLink || target !== "area") && /* @__PURE__ */ jsx(
1257
- "div",
1306
+ /* @__PURE__ */ jsx(
1307
+ motion.div,
1258
1308
  {
1309
+ className: styles.cursor,
1259
1310
  style: {
1260
- position: "absolute",
1261
- top: cursorPos.y,
1262
- left: cursorPos.x,
1263
- width: "40px",
1264
- height: "40px",
1265
- pointerEvents: "none",
1266
- backgroundImage: `url(${isOverImage || target === "area" ? hoverCursor : defaultCursor})`,
1267
- backgroundSize: "contain",
1268
- backgroundRepeat: "no-repeat",
1269
- transform: `translate(-50%, -50%) scale(${cursorScale})`,
1270
- zIndex: 1e3
1311
+ x: cursorX,
1312
+ y: cursorY,
1313
+ width: cursorW.get(),
1314
+ height: cursorH.get(),
1315
+ backgroundImage: `url('${customCursorImg}')`,
1316
+ backgroundSize: "cover",
1317
+ backgroundPosition: "center"
1271
1318
  }
1272
1319
  }
1273
1320
  )
@@ -1474,7 +1521,8 @@ const ControlImageRevealSliderComponent = {
1474
1521
  {
1475
1522
  if: [
1476
1523
  { name: "position.target", value: "image" },
1477
- { name: "cursor.cursorType", value: "custom" }
1524
+ { name: "cursor.cursorType", value: "custom" },
1525
+ { name: "cursor.defaultCursor", value: null, isNotEqual: true }
1478
1526
  ],
1479
1527
  then: {
1480
1528
  name: "properties.cursor.properties.defaultCursorScale.display.visible",
@@ -1492,10 +1540,10 @@ const ControlImageRevealSliderComponent = {
1492
1540
  }
1493
1541
  },
1494
1542
  {
1495
- if: {
1496
- name: "cursor.cursorType",
1497
- value: "custom"
1498
- },
1543
+ if: [
1544
+ { name: "cursor.cursorType", value: "custom" },
1545
+ { name: "cursor.hoverCursor", value: null, isNotEqual: true }
1546
+ ],
1499
1547
  then: {
1500
1548
  name: "properties.cursor.properties.hoverCursorScale.display.visible",
1501
1549
  value: true
@@ -4,8 +4,8 @@ export type Component = {
4
4
  id: string;
5
5
  name: string;
6
6
  defaultSize?: {
7
- width?: number;
8
- height?: number;
7
+ width?: string | number;
8
+ height?: string | number;
9
9
  };
10
10
  schema: any;
11
11
  preview?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/components",
3
- "version": "0.1.6-14",
3
+ "version": "0.1.6-19",
4
4
  "description": "Custom components for control editor and public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -47,6 +47,7 @@
47
47
  "@antfu/eslint-config": "^3.16.0",
48
48
  "@splidejs/react-splide": "^0.7.12",
49
49
  "classnames": "^2.5.1",
50
+ "framer-motion": "^12.23.27",
50
51
  "ts-node": "^10.9.1"
51
52
  },
52
53
  "devDependencies": {