@rpg-engine/long-bow 0.5.68 → 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 +10 -13
- 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 +10 -13
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ImageCarousel/SimpleImageCarousel.tsx +11 -12
|
@@ -16026,39 +16026,36 @@ 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
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
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
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
16061
|
}, [autoCycle, autoCycleDelay, images == null ? void 0 : images.length]);
|