@rpg-engine/long-bow 0.6.85 → 0.6.86

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.
@@ -4,6 +4,7 @@ interface ISpellInfoWrapperProps {
4
4
  spell: ISpell;
5
5
  children: React.ReactNode;
6
6
  scale?: number;
7
+ holdTouchDuration?: number;
7
8
  }
8
9
  export declare const SpellInfoWrapper: React.FC<ISpellInfoWrapperProps>;
9
10
  export {};
@@ -32704,22 +32704,35 @@ var Container$v = /*#__PURE__*/styled__default.div.withConfig({
32704
32704
  var SpellInfoWrapper = function SpellInfoWrapper(_ref) {
32705
32705
  var children = _ref.children,
32706
32706
  spell = _ref.spell,
32707
- scale = _ref.scale;
32707
+ scale = _ref.scale,
32708
+ _ref$holdTouchDuratio = _ref.holdTouchDuration,
32709
+ holdTouchDuration = _ref$holdTouchDuratio === void 0 ? 500 : _ref$holdTouchDuratio;
32708
32710
  var _useState = React.useState(false),
32709
32711
  isTooltipVisible = _useState[0],
32710
32712
  setIsTooltipVisible = _useState[1];
32711
32713
  var _useState2 = React.useState(false),
32712
32714
  isTooltipMobileVisible = _useState2[0],
32713
32715
  setIsTooltipMobileVisible = _useState2[1];
32716
+ var touchTimeoutRef = React.useRef(null);
32717
+ var handleTouchStart = function handleTouchStart() {
32718
+ touchTimeoutRef.current = setTimeout(function () {
32719
+ setIsTooltipMobileVisible(true);
32720
+ setIsTooltipVisible(false);
32721
+ }, holdTouchDuration);
32722
+ };
32723
+ var handleTouchEnd = function handleTouchEnd() {
32724
+ if (touchTimeoutRef.current) {
32725
+ clearTimeout(touchTimeoutRef.current);
32726
+ touchTimeoutRef.current = null;
32727
+ }
32728
+ };
32714
32729
  return React__default.createElement("div", {
32715
32730
  onMouseEnter: function onMouseEnter() {
32716
32731
  if (!isTooltipMobileVisible) setIsTooltipVisible(true);
32717
32732
  },
32718
32733
  onMouseLeave: setIsTooltipVisible.bind(null, false),
32719
- onTouchEnd: function onTouchEnd() {
32720
- setIsTooltipMobileVisible(true);
32721
- setIsTooltipVisible(false);
32722
- }
32734
+ onTouchStart: handleTouchStart,
32735
+ onTouchEnd: handleTouchEnd
32723
32736
  }, children, isTooltipVisible && !isTooltipMobileVisible && React__default.createElement(MagicTooltip, {
32724
32737
  spell: spell
32725
32738
  }), isTooltipMobileVisible && React__default.createElement(MobileSpellTooltip, {