ublo-lib 1.48.8 → 1.48.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infinite-carousel.d.ts","sourceRoot":"","sources":["../../../../src/common/components/infinite-carousel/infinite-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"infinite-carousel.d.ts","sourceRoot":"","sources":["../../../../src/common/components/infinite-carousel/infinite-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,KAAK,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;AAEzC,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE;QACP,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,SAAS,EACT,QAAQ,EACR,OAAiB,EACjB,OAAY,EACZ,WAAW,GACZ,EAAE,KAAK,2CAiUP"}
|
|
@@ -8,7 +8,6 @@ import ChevronRightIcon from "dt-design-system/es/icons/chevron-right";
|
|
|
8
8
|
import ScrollbarSize from "../scrollbar-size";
|
|
9
9
|
import useWindowSizes from "../../hooks/use-window-sizes";
|
|
10
10
|
import css from "./infinite-carousel.module.css";
|
|
11
|
-
const MOBILE_BREAKPOINT = 580;
|
|
12
11
|
export default function InfiniteCarousel({ className, children, variant = "wheel", options = {}, cloneNumber, }) {
|
|
13
12
|
const { cmsMode } = useUbloContext();
|
|
14
13
|
const zoneRef = React.useRef(null);
|
|
@@ -21,7 +20,7 @@ export default function InfiniteCarousel({ className, children, variant = "wheel
|
|
|
21
20
|
const [isTransitioning, setIsTransitioning] = React.useState(false);
|
|
22
21
|
const { width: windowWidth } = useWindowSizes();
|
|
23
22
|
const isEditing = cmsMode === "editing";
|
|
24
|
-
const { wheel_items_gap = 100,
|
|
23
|
+
const { wheel_items_gap = 100, scale_gap_breakpoint = 580, scale_items_gap_desktop = 20, scale_items_gap_mobile = 10, hide_wheel_items = false, scale_number = 0.75, rotate_number = 25, translateY_number = 80, transition_duration = 500, } = options;
|
|
25
24
|
const cloneCount = React.useMemo(() => {
|
|
26
25
|
if (cloneNumber !== undefined)
|
|
27
26
|
return cloneNumber;
|
|
@@ -170,11 +169,9 @@ export default function InfiniteCarousel({ className, children, variant = "wheel
|
|
|
170
169
|
let scale = scale_number;
|
|
171
170
|
let opacity = 1;
|
|
172
171
|
let translateX = 0;
|
|
173
|
-
const gap =
|
|
174
|
-
?
|
|
175
|
-
:
|
|
176
|
-
? scale_items_gap_mobile
|
|
177
|
-
: scale_items_gap_desktop;
|
|
172
|
+
const gap = windowWidth < scale_gap_breakpoint
|
|
173
|
+
? scale_items_gap_mobile
|
|
174
|
+
: scale_items_gap_desktop;
|
|
178
175
|
if (offset === 0) {
|
|
179
176
|
translateX = 0;
|
|
180
177
|
scale = 1;
|