@rpg-engine/long-bow 0.7.99 → 0.8.1
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 +8 -5
- 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 +8 -5
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DPad/JoystickDPad.tsx +7 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +5 -10
|
@@ -12,10 +12,12 @@ interface IDPadOptions {
|
|
|
12
12
|
interface IDPadProps {
|
|
13
13
|
/** Callback fired when a direction is pressed */
|
|
14
14
|
onDirectionPress?: (direction: 'up' | 'down' | 'left' | 'right') => void;
|
|
15
|
+
/** Callback fired when a direction is released */
|
|
16
|
+
onDirectionRelease?: (direction: 'up' | 'down' | 'left' | 'right') => void;
|
|
15
17
|
/** Whether the component is disabled */
|
|
16
18
|
disabled?: boolean;
|
|
17
19
|
/** Additional options for customizing the D-pad */
|
|
18
20
|
options?: IDPadOptions;
|
|
19
21
|
}
|
|
20
|
-
export declare const JoystickDPad: React.MemoExoticComponent<({ onDirectionPress, disabled, options, }: IDPadProps) => JSX.Element>;
|
|
22
|
+
export declare const JoystickDPad: React.MemoExoticComponent<({ onDirectionPress, onDirectionRelease, disabled, options, }: IDPadProps) => JSX.Element>;
|
|
21
23
|
export {};
|
|
@@ -27945,15 +27945,14 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
27945
27945
|
},
|
|
27946
27946
|
isFocused: false
|
|
27947
27947
|
});
|
|
27948
|
-
}, [containerType, isDepotSystem, setContextActions, clearContextActions, isContextMenuDisabled]);
|
|
27949
|
-
React.useEffect(function () {
|
|
27950
|
-
// Reset drag position and focus when item changes
|
|
27951
27948
|
clearDraggingState();
|
|
27952
27949
|
// Clear context actions when component unmounts or dependencies change
|
|
27953
27950
|
return function () {
|
|
27951
|
+
clearDraggingState();
|
|
27952
|
+
clearDetailsState();
|
|
27954
27953
|
clearContextActions();
|
|
27955
27954
|
};
|
|
27956
|
-
}, [containerType, isDepotSystem, setContextActions, clearContextActions, isContextMenuDisabled, updateDraggingState]);
|
|
27955
|
+
}, [containerType, isDepotSystem, setContextActions, clearContextActions, isContextMenuDisabled, clearDraggingState, clearDetailsState, updateDraggingState]);
|
|
27957
27956
|
var resetItem = function resetItem() {
|
|
27958
27957
|
clearDraggingState();
|
|
27959
27958
|
clearDetailsState();
|
|
@@ -29157,6 +29156,7 @@ var DPadContainer = /*#__PURE__*/React.memo( /*#__PURE__*/styled__default.div.wi
|
|
|
29157
29156
|
}));
|
|
29158
29157
|
var JoystickDPad = /*#__PURE__*/React.memo(function (_ref) {
|
|
29159
29158
|
var onDirectionPress = _ref.onDirectionPress,
|
|
29159
|
+
onDirectionRelease = _ref.onDirectionRelease,
|
|
29160
29160
|
_ref$disabled = _ref.disabled,
|
|
29161
29161
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
29162
29162
|
_ref$options = _ref.options,
|
|
@@ -29185,11 +29185,14 @@ var JoystickDPad = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
29185
29185
|
activeDirectionRef.current = null;
|
|
29186
29186
|
}, []);
|
|
29187
29187
|
var clearAllPresses = React.useCallback(function () {
|
|
29188
|
+
if (activeDirectionRef.current && onDirectionRelease) {
|
|
29189
|
+
onDirectionRelease(activeDirectionRef.current);
|
|
29190
|
+
}
|
|
29188
29191
|
clearPressInterval();
|
|
29189
29192
|
setPressedButtons(new Set());
|
|
29190
29193
|
activeDirectionRef.current = null;
|
|
29191
29194
|
isPressedRef.current = false;
|
|
29192
|
-
}, [clearPressInterval]);
|
|
29195
|
+
}, [clearPressInterval, onDirectionRelease]);
|
|
29193
29196
|
var handleDirectionPress = React.useCallback(function (direction) {
|
|
29194
29197
|
if (disabled) return;
|
|
29195
29198
|
// Clear any existing presses first
|