@rpg-engine/long-bow 0.5.67 → 0.5.70
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/long-bow.cjs.development.js +16 -19
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +16 -19
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ImageCarousel/SimpleImageCarousel.tsx +17 -18
|
@@ -16026,43 +16026,40 @@ var SimpleImageCarousel = function SimpleImageCarousel(_ref) {
|
|
|
16026
16026
|
var _useState = React.useState(0),
|
|
16027
16027
|
currentImage = _useState[0],
|
|
16028
16028
|
setCurrentImage = _useState[1];
|
|
16029
|
-
var
|
|
16030
|
-
autoCycleId = _useState2[0],
|
|
16031
|
-
setAutoCycleId = _useState2[1];
|
|
16029
|
+
var autoCycleId = React.useRef(null);
|
|
16032
16030
|
var handleLeftClick = function handleLeftClick() {
|
|
16033
16031
|
setCurrentImage(function (prevImage) {
|
|
16034
|
-
return (prevImage - 1 + images.length) % images.length;
|
|
16032
|
+
return (prevImage - 1 + (images == null ? void 0 : images.length)) % (images == null ? void 0 : images.length);
|
|
16035
16033
|
});
|
|
16036
|
-
if (stopAutoCyclingOnInteraction && autoCycleId) {
|
|
16037
|
-
clearInterval(autoCycleId);
|
|
16038
|
-
|
|
16034
|
+
if (stopAutoCyclingOnInteraction && autoCycleId.current) {
|
|
16035
|
+
clearInterval(autoCycleId.current);
|
|
16036
|
+
autoCycleId.current = null;
|
|
16039
16037
|
}
|
|
16040
16038
|
};
|
|
16041
16039
|
var handleRightClick = function handleRightClick() {
|
|
16042
16040
|
setCurrentImage(function (prevImage) {
|
|
16043
|
-
return (prevImage + 1) % images.length;
|
|
16041
|
+
return (prevImage + 1) % (images == null ? void 0 : images.length);
|
|
16044
16042
|
});
|
|
16045
|
-
if (stopAutoCyclingOnInteraction && autoCycleId) {
|
|
16046
|
-
clearInterval(autoCycleId);
|
|
16047
|
-
|
|
16043
|
+
if (stopAutoCyclingOnInteraction && autoCycleId.current) {
|
|
16044
|
+
clearInterval(autoCycleId.current);
|
|
16045
|
+
autoCycleId.current = null;
|
|
16048
16046
|
}
|
|
16049
16047
|
};
|
|
16050
16048
|
React.useEffect(function () {
|
|
16051
16049
|
if (autoCycle) {
|
|
16052
|
-
|
|
16050
|
+
autoCycleId.current = setInterval(function () {
|
|
16053
16051
|
setCurrentImage(function (prevImage) {
|
|
16054
|
-
return (prevImage + 1) % images.length;
|
|
16052
|
+
return (prevImage + 1) % (images == null ? void 0 : images.length);
|
|
16055
16053
|
});
|
|
16056
16054
|
}, autoCycleDelay);
|
|
16057
|
-
setAutoCycleId(id);
|
|
16058
16055
|
}
|
|
16059
16056
|
return function () {
|
|
16060
|
-
if (autoCycleId) {
|
|
16061
|
-
clearInterval(autoCycleId);
|
|
16057
|
+
if (autoCycleId.current) {
|
|
16058
|
+
clearInterval(autoCycleId.current);
|
|
16062
16059
|
}
|
|
16063
16060
|
};
|
|
16064
|
-
}, [autoCycle, autoCycleDelay, images.length]);
|
|
16065
|
-
var hasMoreThanOneImage = images.length > 1;
|
|
16061
|
+
}, [autoCycle, autoCycleDelay, images == null ? void 0 : images.length]);
|
|
16062
|
+
var hasMoreThanOneImage = (images == null ? void 0 : images.length) > 1;
|
|
16066
16063
|
return React__default.createElement(ImageContainer, {
|
|
16067
16064
|
style: styles
|
|
16068
16065
|
}, hasMoreThanOneImage && React__default.createElement(CustomLeftArrow, {
|
|
@@ -16073,7 +16070,7 @@ var SimpleImageCarousel = function SimpleImageCarousel(_ref) {
|
|
|
16073
16070
|
onPointerDown: handleRightClick
|
|
16074
16071
|
}), React__default.createElement(Carousel, null, React__default.createElement(FadeInCarouselImg, {
|
|
16075
16072
|
key: currentImage,
|
|
16076
|
-
src: images[currentImage],
|
|
16073
|
+
src: images == null ? void 0 : images[currentImage],
|
|
16077
16074
|
alt: "Image " + currentImage
|
|
16078
16075
|
})));
|
|
16079
16076
|
};
|