@ship-it-ui/ui 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -12
- package/dist/index.d.ts +14 -12
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -3268,6 +3268,7 @@ var Carousel = (0, import_react52.forwardRef)(function Carousel2({
|
|
|
3268
3268
|
const internalScrollRef = (0, import_react52.useRef)(false);
|
|
3269
3269
|
const goToInProgressRef = (0, import_react52.useRef)(false);
|
|
3270
3270
|
const wrapInFlightRef = (0, import_react52.useRef)(null);
|
|
3271
|
+
const rebaseConsumeRef = (0, import_react52.useRef)(null);
|
|
3271
3272
|
const activeIdx = active ?? 0;
|
|
3272
3273
|
const domIndexFor = (0, import_react52.useCallback)((real) => isLooping ? real + 1 : real, [isLooping]);
|
|
3273
3274
|
const goTo = (0, import_react52.useCallback)(
|
|
@@ -3283,6 +3284,7 @@ var Carousel = (0, import_react52.forwardRef)(function Carousel2({
|
|
|
3283
3284
|
const rebaseSlide = node.children[rebaseTarget];
|
|
3284
3285
|
if (rebaseSlide) {
|
|
3285
3286
|
internalScrollRef.current = true;
|
|
3287
|
+
rebaseConsumeRef.current = rebaseTarget;
|
|
3286
3288
|
rebaseSlide.scrollIntoView({
|
|
3287
3289
|
behavior: "instant",
|
|
3288
3290
|
block: "nearest",
|
|
@@ -3322,6 +3324,10 @@ var Carousel = (0, import_react52.forwardRef)(function Carousel2({
|
|
|
3322
3324
|
if (domIdx !== activeIdx) setActive(domIdx);
|
|
3323
3325
|
return;
|
|
3324
3326
|
}
|
|
3327
|
+
if (rebaseConsumeRef.current !== null) {
|
|
3328
|
+
if (domIdx === rebaseConsumeRef.current) return;
|
|
3329
|
+
rebaseConsumeRef.current = null;
|
|
3330
|
+
}
|
|
3325
3331
|
if (domIdx === 0) {
|
|
3326
3332
|
if (goToInProgressRef.current && node.scrollLeft > 1) return;
|
|
3327
3333
|
const realTwin = node.children[N];
|
|
@@ -3356,6 +3362,7 @@ var Carousel = (0, import_react52.forwardRef)(function Carousel2({
|
|
|
3356
3362
|
const onPointerDown = () => {
|
|
3357
3363
|
goToInProgressRef.current = false;
|
|
3358
3364
|
wrapInFlightRef.current = null;
|
|
3365
|
+
rebaseConsumeRef.current = null;
|
|
3359
3366
|
};
|
|
3360
3367
|
node.addEventListener("scroll", onScroll, { passive: true });
|
|
3361
3368
|
node.addEventListener("pointerdown", onPointerDown, { passive: true });
|
|
@@ -5269,7 +5276,7 @@ var ListingDetail = (0, import_react61.forwardRef)(function ListingDetail2({
|
|
|
5269
5276
|
items: photos,
|
|
5270
5277
|
index: galleryIndex,
|
|
5271
5278
|
onIndexChange: setGalleryIndex,
|
|
5272
|
-
loop,
|
|
5279
|
+
loop: Boolean(loop),
|
|
5273
5280
|
title: lightboxTitle,
|
|
5274
5281
|
renderItem: (src, i) => renderPhoto ? renderPhoto(src, i, "lightbox") : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("img", { src, alt: "", className: "max-h-[88vh] max-w-[92vw] object-contain" })
|
|
5275
5282
|
}
|