@rpg-engine/long-bow 0.7.99 → 0.8.0
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/components/DPad/JoystickDPad.d.ts +3 -1
- package/dist/long-bow.cjs.development.js +5 -1
- 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 +5 -1
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DPad/JoystickDPad.tsx +7 -1
package/dist/long-bow.esm.js
CHANGED
|
@@ -29150,6 +29150,7 @@ var DPadContainer = /*#__PURE__*/memo( /*#__PURE__*/styled.div.withConfig({
|
|
|
29150
29150
|
}));
|
|
29151
29151
|
var JoystickDPad = /*#__PURE__*/memo(function (_ref) {
|
|
29152
29152
|
var onDirectionPress = _ref.onDirectionPress,
|
|
29153
|
+
onDirectionRelease = _ref.onDirectionRelease,
|
|
29153
29154
|
_ref$disabled = _ref.disabled,
|
|
29154
29155
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
29155
29156
|
_ref$options = _ref.options,
|
|
@@ -29178,11 +29179,14 @@ var JoystickDPad = /*#__PURE__*/memo(function (_ref) {
|
|
|
29178
29179
|
activeDirectionRef.current = null;
|
|
29179
29180
|
}, []);
|
|
29180
29181
|
var clearAllPresses = useCallback(function () {
|
|
29182
|
+
if (activeDirectionRef.current && onDirectionRelease) {
|
|
29183
|
+
onDirectionRelease(activeDirectionRef.current);
|
|
29184
|
+
}
|
|
29181
29185
|
clearPressInterval();
|
|
29182
29186
|
setPressedButtons(new Set());
|
|
29183
29187
|
activeDirectionRef.current = null;
|
|
29184
29188
|
isPressedRef.current = false;
|
|
29185
|
-
}, [clearPressInterval]);
|
|
29189
|
+
}, [clearPressInterval, onDirectionRelease]);
|
|
29186
29190
|
var handleDirectionPress = useCallback(function (direction) {
|
|
29187
29191
|
if (disabled) return;
|
|
29188
29192
|
// Clear any existing presses first
|