@rpg-engine/long-bow 0.7.97 → 0.7.99
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 +21 -0
- package/dist/components/InformationCenter/InformationCenter.d.ts +29 -0
- package/dist/components/InformationCenter/InformationCenterCell.d.ts +14 -0
- package/dist/components/InformationCenter/InformationCenterTabView.d.ts +19 -0
- package/dist/components/InformationCenter/InformationCenterTypes.d.ts +79 -0
- package/dist/components/InformationCenter/sections/bestiary/BestiarySection.d.ts +12 -0
- package/dist/components/InformationCenter/sections/bestiary/InformationCenterNPCDetails.d.ts +12 -0
- package/dist/components/InformationCenter/sections/bestiary/InformationCenterNPCTooltip.d.ts +9 -0
- package/dist/components/InformationCenter/sections/faq/FaqSection.d.ts +8 -0
- package/dist/components/InformationCenter/sections/items/InformationCenterItemDetails.d.ts +11 -0
- package/dist/components/InformationCenter/sections/items/InformationCenterItemTooltip.d.ts +7 -0
- package/dist/components/InformationCenter/sections/items/ItemsSection.d.ts +11 -0
- package/dist/components/InformationCenter/sections/tutorials/TutorialsSection.d.ts +8 -0
- package/dist/components/InformationCenter/shared/BaseInformationDetails.d.ts +10 -0
- package/dist/components/shared/BaseTooltip.d.ts +12 -0
- package/dist/components/shared/Collapsible/Collapsible.d.ts +9 -0
- package/dist/components/shared/Portal/Portal.d.ts +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +271 -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 +273 -8
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/mocks/informationCenter.mocks.d.ts +6 -0
- package/dist/stories/Features/craftbook/CraftBook.stories.d.ts +2 -0
- package/dist/stories/UI/info/InformationCenter.stories.d.ts +7 -0
- package/dist/stories/UI/joystick/JoystickDPad.stories.d.ts +6 -0
- package/package.json +1 -1
- package/src/components/CraftBook/CraftBook.tsx +70 -31
- package/src/components/DPad/JoystickDPad.tsx +417 -0
- package/src/components/InformationCenter/InformationCenter.tsx +155 -0
- package/src/components/InformationCenter/InformationCenterCell.tsx +96 -0
- package/src/components/InformationCenter/InformationCenterTabView.tsx +121 -0
- package/src/components/InformationCenter/InformationCenterTypes.ts +87 -0
- package/src/components/InformationCenter/sections/bestiary/BestiarySection.tsx +170 -0
- package/src/components/InformationCenter/sections/bestiary/InformationCenterNPCDetails.tsx +366 -0
- package/src/components/InformationCenter/sections/bestiary/InformationCenterNPCTooltip.tsx +204 -0
- package/src/components/InformationCenter/sections/faq/FaqSection.tsx +71 -0
- package/src/components/InformationCenter/sections/items/InformationCenterItemDetails.tsx +323 -0
- package/src/components/InformationCenter/sections/items/InformationCenterItemTooltip.tsx +88 -0
- package/src/components/InformationCenter/sections/items/ItemsSection.tsx +180 -0
- package/src/components/InformationCenter/sections/tutorials/TutorialsSection.tsx +144 -0
- package/src/components/InformationCenter/shared/BaseInformationDetails.tsx +162 -0
- package/src/components/InternalTabs/InternalTabs.tsx +1 -3
- package/src/components/shared/BaseTooltip.tsx +60 -0
- package/src/components/shared/Collapsible/Collapsible.tsx +70 -0
- package/src/components/shared/Portal/Portal.tsx +19 -0
- package/src/index.tsx +1 -0
- package/src/mocks/informationCenter.mocks.ts +562 -0
- package/src/stories/Features/craftbook/CraftBook.stories.tsx +15 -1
- package/src/stories/UI/info/InformationCenter.stories.tsx +58 -0
- package/src/stories/UI/joystick/JoystickDPad.stories.tsx +52 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, { useState, useEffect, Component, useRef, useCallback, useContext, createContext, useMemo, Fragment } from 'react';
|
|
1
|
+
import React, { useState, useEffect, Component, useRef, useCallback, useContext, createContext, useMemo, memo, Fragment } from 'react';
|
|
2
2
|
import styled, { css, keyframes } from 'styled-components';
|
|
3
3
|
import { BeatLoader } from 'react-spinners';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
5
5
|
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemRarities, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemSubType, isMobile, ItemSlotType, isMobileOrTablet, CharacterClass, QuestStatus, getSPForLevel, getXPForLevel, PeriodOfDay, UserAccountTypes } from '@rpg-engine/shared';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
7
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
8
|
-
import { FaTimes, FaSearch, FaThumbtack, FaChevronLeft, FaChevronRight } from 'react-icons/fa';
|
|
8
|
+
import { FaTimes, FaSearch, FaThumbtack, FaBoxOpen, FaChevronLeft, FaChevronRight } from 'react-icons/fa';
|
|
9
9
|
import { RxMagnifyingGlass, RxCross2 } from 'react-icons/rx';
|
|
10
10
|
import { IoMdContract, IoMdExpand } from 'react-icons/io';
|
|
11
11
|
import Draggable from 'react-draggable';
|
|
@@ -28935,7 +28935,7 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
28935
28935
|
return setSearchTerm(e.target.value);
|
|
28936
28936
|
},
|
|
28937
28937
|
autoFocus: true
|
|
28938
|
-
})), React.createElement(ContentContainer, null, React.createElement(RadioInputScroller, {
|
|
28938
|
+
})), React.createElement(ContentContainer, null, paginatedItems.length > 0 ? React.createElement(RadioInputScroller, {
|
|
28939
28939
|
className: "inputRadioCraftBook"
|
|
28940
28940
|
}, paginatedItems == null ? void 0 : paginatedItems.map(function (item) {
|
|
28941
28941
|
return React.createElement(CraftingRecipeWrapper, {
|
|
@@ -28960,7 +28960,9 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
28960
28960
|
inventory: inventory,
|
|
28961
28961
|
skills: skills
|
|
28962
28962
|
}));
|
|
28963
|
-
}))
|
|
28963
|
+
})) : React.createElement(EmptyState, null, React.createElement(FaBoxOpen, {
|
|
28964
|
+
size: 48
|
|
28965
|
+
}), React.createElement("p", null, "No craftable items found"))), totalPages > 1 && React.createElement(PaginationContainer, null, React.createElement(PaginationButton, {
|
|
28964
28966
|
onClick: function onClick() {
|
|
28965
28967
|
return setCurrentPage(function (prev) {
|
|
28966
28968
|
return Math.max(1, prev - 1);
|
|
@@ -29029,11 +29031,11 @@ var SearchContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
29029
29031
|
var ContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
29030
29032
|
displayName: "CraftBook__ContentContainer",
|
|
29031
29033
|
componentId: "sc-19q95ue-7"
|
|
29032
|
-
})(["flex:1;
|
|
29034
|
+
})(["flex:1;display:flex;flex-direction:column;padding:16px;padding-right:0;padding-bottom:0;width:100%;position:relative;min-height:300px;overflow:hidden;"]);
|
|
29033
29035
|
var RadioInputScroller = /*#__PURE__*/styled.div.withConfig({
|
|
29034
29036
|
displayName: "CraftBook__RadioInputScroller",
|
|
29035
29037
|
componentId: "sc-19q95ue-8"
|
|
29036
|
-
})(["height:100%;overflow-y:
|
|
29038
|
+
})(["height:100%;min-height:300px;overflow-y:auto;overflow-x:hidden;padding:8px 16px;padding-right:24px;width:100%;box-sizing:border-box;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-content:start;@media (max-width:", "){grid-template-columns:1fr;}"], MOBILE_WIDTH);
|
|
29037
29039
|
var CraftingRecipeWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
29038
29040
|
displayName: "CraftBook__CraftingRecipeWrapper",
|
|
29039
29041
|
componentId: "sc-19q95ue-9"
|
|
@@ -29070,6 +29072,269 @@ var PageInfo = /*#__PURE__*/styled.div.withConfig({
|
|
|
29070
29072
|
displayName: "CraftBook__PageInfo",
|
|
29071
29073
|
componentId: "sc-19q95ue-14"
|
|
29072
29074
|
})(["color:", ";font-size:0.8rem;font-family:'Press Start 2P',cursive;"], uiColors.lightGray);
|
|
29075
|
+
var EmptyState = /*#__PURE__*/styled.div.withConfig({
|
|
29076
|
+
displayName: "CraftBook__EmptyState",
|
|
29077
|
+
componentId: "sc-19q95ue-15"
|
|
29078
|
+
})(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:", ";width:100%;padding:2rem;svg{font-size:3rem;margin-bottom:1rem;opacity:0.7;}p{font-family:'Press Start 2P',cursive;font-size:0.9rem;margin:0;}"], uiColors.lightGray);
|
|
29079
|
+
|
|
29080
|
+
// Memoize the styled components since they don't depend on props that change frequently
|
|
29081
|
+
var DPadButton = /*#__PURE__*/memo( /*#__PURE__*/styled.div.withConfig({
|
|
29082
|
+
displayName: "JoystickDPad__DPadButton",
|
|
29083
|
+
componentId: "sc-q1e3gk-0"
|
|
29084
|
+
})(["position:absolute;background:", ";box-shadow:", ";cursor:", ";user-select:none;transition:all 0.08s cubic-bezier(0.4,0,0.2,1);touch-action:none;-webkit-tap-highlight-color:transparent;transform-origin:center center;&:hover:not(:active){@media (hover:hover){filter:", ";}}&::after{content:'';position:absolute;width:0;height:0;border:", "px solid transparent;pointer-events:none;opacity:", ";transition:all 0.08s cubic-bezier(0.4,0,0.2,1);}&.up,&.down{width:", "px;height:", "px;left:50%;transform:translateX(-50%) scale(", ");}&.left,&.right{width:", "px;height:", "px;top:50%;transform:translateY(-50%) scale(", ");}&.up{top:0;border-radius:5px 5px 0 0;&::after{border-bottom-color:#2a2a2a;top:45%;left:50%;transform:translate(-50%,-50%);}}&.down{bottom:0;border-radius:0 0 5px 5px;&::after{border-top-color:#2a2a2a;bottom:45%;left:50%;transform:translate(-50%,50%);}}&.left{left:0;border-radius:5px 0 0 5px;&::after{border-right-color:#2a2a2a;left:45%;top:50%;transform:translate(-50%,-50%);}}&.right{right:0;border-radius:0 5px 5px 0;&::after{border-left-color:#2a2a2a;right:45%;top:50%;transform:translate(50%,-50%);}}"], function (props) {
|
|
29085
|
+
return props.isPressed ? '#363636' : '#424242';
|
|
29086
|
+
}, function (props) {
|
|
29087
|
+
return props.isPressed ? 'inset 0 0 12px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.3)' : 'inset 0 0 5px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2)';
|
|
29088
|
+
}, function (props) {
|
|
29089
|
+
return props.disabled ? 'not-allowed' : 'pointer';
|
|
29090
|
+
}, function (props) {
|
|
29091
|
+
return !props.disabled && !props.isPressed ? 'brightness(1.1)' : 'none';
|
|
29092
|
+
}, function (props) {
|
|
29093
|
+
var _props$size;
|
|
29094
|
+
return ((_props$size = props.size) != null ? _props$size : 100) * 0.05;
|
|
29095
|
+
}, function (props) {
|
|
29096
|
+
return props.isPressed ? 0.7 : 1;
|
|
29097
|
+
}, function (props) {
|
|
29098
|
+
var _props$size2;
|
|
29099
|
+
return ((_props$size2 = props.size) != null ? _props$size2 : 100) * 0.3;
|
|
29100
|
+
}, function (props) {
|
|
29101
|
+
var _props$size3;
|
|
29102
|
+
return ((_props$size3 = props.size) != null ? _props$size3 : 100) * 0.4;
|
|
29103
|
+
}, function (props) {
|
|
29104
|
+
return props.isPressed ? 0.95 : 1;
|
|
29105
|
+
}, function (props) {
|
|
29106
|
+
var _props$size4;
|
|
29107
|
+
return ((_props$size4 = props.size) != null ? _props$size4 : 100) * 0.4;
|
|
29108
|
+
}, function (props) {
|
|
29109
|
+
var _props$size5;
|
|
29110
|
+
return ((_props$size5 = props.size) != null ? _props$size5 : 100) * 0.3;
|
|
29111
|
+
}, function (props) {
|
|
29112
|
+
return props.isPressed ? 0.95 : 1;
|
|
29113
|
+
}));
|
|
29114
|
+
var DPadCenter = /*#__PURE__*/memo( /*#__PURE__*/styled.div.withConfig({
|
|
29115
|
+
displayName: "JoystickDPad__DPadCenter",
|
|
29116
|
+
componentId: "sc-q1e3gk-1"
|
|
29117
|
+
})(["position:absolute;width:", "px;height:", "px;background:#424242;top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:inset 0 0 8px rgba(0,0,0,0.6);border-radius:50%;user-select:none;cursor:", ";touch-action:none;-webkit-tap-highlight-color:transparent;&::after{content:'';position:absolute;width:", "px;height:", "px;background:#2a2a2a;border-radius:50%;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none;box-shadow:inset 0 0 2px rgba(0,0,0,0.8);}"], function (props) {
|
|
29118
|
+
var _props$size6;
|
|
29119
|
+
return ((_props$size6 = props.size) != null ? _props$size6 : 100) * 0.3;
|
|
29120
|
+
}, function (props) {
|
|
29121
|
+
var _props$size7;
|
|
29122
|
+
return ((_props$size7 = props.size) != null ? _props$size7 : 100) * 0.3;
|
|
29123
|
+
}, function (props) {
|
|
29124
|
+
return props.disabled ? 'not-allowed' : 'default';
|
|
29125
|
+
}, function (props) {
|
|
29126
|
+
var _props$size8;
|
|
29127
|
+
return ((_props$size8 = props.size) != null ? _props$size8 : 100) * 0.08;
|
|
29128
|
+
}, function (props) {
|
|
29129
|
+
var _props$size9;
|
|
29130
|
+
return ((_props$size9 = props.size) != null ? _props$size9 : 100) * 0.08;
|
|
29131
|
+
}));
|
|
29132
|
+
var DPadContainer = /*#__PURE__*/memo( /*#__PURE__*/styled.div.withConfig({
|
|
29133
|
+
displayName: "JoystickDPad__DPadContainer",
|
|
29134
|
+
componentId: "sc-q1e3gk-2"
|
|
29135
|
+
})(["width:", "px;height:", "px;position:relative;background:", ";border-radius:50%;box-shadow:", ";opacity:", ";user-select:none;cursor:", ";transition:opacity 0.2s ease;touch-action:none;-webkit-tap-highlight-color:transparent;"], function (props) {
|
|
29136
|
+
var _props$size10;
|
|
29137
|
+
return (_props$size10 = props.size) != null ? _props$size10 : 100;
|
|
29138
|
+
}, function (props) {
|
|
29139
|
+
var _props$size11;
|
|
29140
|
+
return (_props$size11 = props.size) != null ? _props$size11 : 100;
|
|
29141
|
+
}, function (props) {
|
|
29142
|
+
return props.showBackground ? '#b8b8b8' : 'transparent';
|
|
29143
|
+
}, function (props) {
|
|
29144
|
+
return props.showBackground ? 'inset 0 0 10px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2)' : 'none';
|
|
29145
|
+
}, function (props) {
|
|
29146
|
+
var _props$opacity;
|
|
29147
|
+
return props.disabled ? 0.5 : (_props$opacity = props.opacity) != null ? _props$opacity : 1;
|
|
29148
|
+
}, function (props) {
|
|
29149
|
+
return props.disabled ? 'not-allowed' : 'default';
|
|
29150
|
+
}));
|
|
29151
|
+
var JoystickDPad = /*#__PURE__*/memo(function (_ref) {
|
|
29152
|
+
var onDirectionPress = _ref.onDirectionPress,
|
|
29153
|
+
_ref$disabled = _ref.disabled,
|
|
29154
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
29155
|
+
_ref$options = _ref.options,
|
|
29156
|
+
options = _ref$options === void 0 ? {} : _ref$options;
|
|
29157
|
+
var _options$opacity = options.opacity,
|
|
29158
|
+
opacity = _options$opacity === void 0 ? 1 : _options$opacity,
|
|
29159
|
+
_options$showBackgrou = options.showBackground,
|
|
29160
|
+
showBackground = _options$showBackgrou === void 0 ? false : _options$showBackgrou,
|
|
29161
|
+
_options$size = options.size,
|
|
29162
|
+
size = _options$size === void 0 ? 100 : _options$size,
|
|
29163
|
+
_options$pressInterva = options.pressInterval,
|
|
29164
|
+
pressInterval = _options$pressInterva === void 0 ? 500 : _options$pressInterva;
|
|
29165
|
+
// Use refs for values that don't need to trigger re-renders
|
|
29166
|
+
var _useState = useState(new Set()),
|
|
29167
|
+
pressedButtons = _useState[0],
|
|
29168
|
+
setPressedButtons = _useState[1];
|
|
29169
|
+
var intervalRef = useRef(null);
|
|
29170
|
+
var activeDirectionRef = useRef(null);
|
|
29171
|
+
var touchStartRef = useRef(null);
|
|
29172
|
+
var isPressedRef = useRef(false);
|
|
29173
|
+
var clearPressInterval = useCallback(function () {
|
|
29174
|
+
if (intervalRef.current !== null) {
|
|
29175
|
+
window.clearInterval(intervalRef.current);
|
|
29176
|
+
intervalRef.current = null;
|
|
29177
|
+
}
|
|
29178
|
+
activeDirectionRef.current = null;
|
|
29179
|
+
}, []);
|
|
29180
|
+
var clearAllPresses = useCallback(function () {
|
|
29181
|
+
clearPressInterval();
|
|
29182
|
+
setPressedButtons(new Set());
|
|
29183
|
+
activeDirectionRef.current = null;
|
|
29184
|
+
isPressedRef.current = false;
|
|
29185
|
+
}, [clearPressInterval]);
|
|
29186
|
+
var handleDirectionPress = useCallback(function (direction) {
|
|
29187
|
+
if (disabled) return;
|
|
29188
|
+
// Clear any existing presses first
|
|
29189
|
+
clearAllPresses();
|
|
29190
|
+
// Set new direction
|
|
29191
|
+
activeDirectionRef.current = direction;
|
|
29192
|
+
isPressedRef.current = true;
|
|
29193
|
+
setPressedButtons(new Set([direction]));
|
|
29194
|
+
onDirectionPress == null ? void 0 : onDirectionPress(direction);
|
|
29195
|
+
intervalRef.current = window.setInterval(function () {
|
|
29196
|
+
if (activeDirectionRef.current === direction) {
|
|
29197
|
+
onDirectionPress == null ? void 0 : onDirectionPress(direction);
|
|
29198
|
+
} else {
|
|
29199
|
+
clearPressInterval();
|
|
29200
|
+
}
|
|
29201
|
+
}, pressInterval);
|
|
29202
|
+
}, [disabled, onDirectionPress, pressInterval, clearPressInterval, clearAllPresses]);
|
|
29203
|
+
var handleDirectionRelease = useCallback(function (direction) {
|
|
29204
|
+
if (activeDirectionRef.current === direction) {
|
|
29205
|
+
clearAllPresses();
|
|
29206
|
+
}
|
|
29207
|
+
}, [clearAllPresses]);
|
|
29208
|
+
var handleTouchStart = useCallback(function (e, direction) {
|
|
29209
|
+
var touch = e.touches[0];
|
|
29210
|
+
if (touch) {
|
|
29211
|
+
touchStartRef.current = {
|
|
29212
|
+
x: touch.clientX,
|
|
29213
|
+
y: touch.clientY
|
|
29214
|
+
};
|
|
29215
|
+
handleDirectionPress(direction);
|
|
29216
|
+
}
|
|
29217
|
+
}, [handleDirectionPress]);
|
|
29218
|
+
var handleTouchMove = useCallback(function (e) {
|
|
29219
|
+
var touch = e.touches[0];
|
|
29220
|
+
if (!touch || !touchStartRef.current) return;
|
|
29221
|
+
var _touchStartRef$curren = touchStartRef.current,
|
|
29222
|
+
startX = _touchStartRef$curren.x,
|
|
29223
|
+
startY = _touchStartRef$curren.y;
|
|
29224
|
+
var deltaX = touch.clientX - startX;
|
|
29225
|
+
var deltaY = touch.clientY - startY;
|
|
29226
|
+
// Calculate angle and distance
|
|
29227
|
+
var distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
29228
|
+
var angle = Math.atan2(deltaY, deltaX) * (180 / Math.PI);
|
|
29229
|
+
// Only trigger if we've moved enough
|
|
29230
|
+
var threshold = size * 0.15; // Adaptive threshold based on d-pad size
|
|
29231
|
+
if (distance < threshold) return;
|
|
29232
|
+
var newDirection = null;
|
|
29233
|
+
// Determine direction based on angle
|
|
29234
|
+
if (angle > -45 && angle <= 45) newDirection = 'right';else if (angle > 45 && angle <= 135) newDirection = 'down';else if (angle > 135 || angle <= -135) newDirection = 'left';else if (angle > -135 && angle <= -45) newDirection = 'up';
|
|
29235
|
+
if (newDirection && newDirection !== activeDirectionRef.current) {
|
|
29236
|
+
handleDirectionPress(newDirection);
|
|
29237
|
+
// Update touch start to current position to prevent jitter
|
|
29238
|
+
touchStartRef.current = {
|
|
29239
|
+
x: touch.clientX,
|
|
29240
|
+
y: touch.clientY
|
|
29241
|
+
};
|
|
29242
|
+
}
|
|
29243
|
+
}, [handleDirectionPress, size]);
|
|
29244
|
+
// Add a new cleanup function for touch events
|
|
29245
|
+
var cleanupTouchEvents = useCallback(function () {
|
|
29246
|
+
touchStartRef.current = null;
|
|
29247
|
+
if (activeDirectionRef.current) {
|
|
29248
|
+
handleDirectionRelease(activeDirectionRef.current);
|
|
29249
|
+
}
|
|
29250
|
+
}, [handleDirectionRelease]);
|
|
29251
|
+
// Enhance the touch end handler
|
|
29252
|
+
var handleTouchEnd = useCallback(function () {
|
|
29253
|
+
cleanupTouchEvents();
|
|
29254
|
+
}, [cleanupTouchEvents]);
|
|
29255
|
+
// Add touch cancel handler
|
|
29256
|
+
var handleTouchCancel = useCallback(function () {
|
|
29257
|
+
cleanupTouchEvents();
|
|
29258
|
+
}, [cleanupTouchEvents]);
|
|
29259
|
+
// Enhance cleanup effect
|
|
29260
|
+
useEffect(function () {
|
|
29261
|
+
if (disabled) {
|
|
29262
|
+
clearAllPresses();
|
|
29263
|
+
}
|
|
29264
|
+
var handleBlur = function handleBlur() {
|
|
29265
|
+
clearAllPresses();
|
|
29266
|
+
};
|
|
29267
|
+
var handleVisibilityChange = function handleVisibilityChange() {
|
|
29268
|
+
if (document.hidden) {
|
|
29269
|
+
clearAllPresses();
|
|
29270
|
+
}
|
|
29271
|
+
};
|
|
29272
|
+
var handlePointerUp = function handlePointerUp() {
|
|
29273
|
+
// Global pointer up as fallback for stuck buttons
|
|
29274
|
+
if (isPressedRef.current) {
|
|
29275
|
+
clearAllPresses();
|
|
29276
|
+
}
|
|
29277
|
+
};
|
|
29278
|
+
window.addEventListener('blur', handleBlur);
|
|
29279
|
+
window.addEventListener('pointerup', handlePointerUp);
|
|
29280
|
+
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
29281
|
+
return function () {
|
|
29282
|
+
clearAllPresses();
|
|
29283
|
+
window.removeEventListener('blur', handleBlur);
|
|
29284
|
+
window.removeEventListener('pointerup', handlePointerUp);
|
|
29285
|
+
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
29286
|
+
};
|
|
29287
|
+
}, [disabled, clearAllPresses]);
|
|
29288
|
+
// Memoize the preventDefault handler
|
|
29289
|
+
var preventDefault = useCallback(function (e) {
|
|
29290
|
+
e.preventDefault();
|
|
29291
|
+
e.stopPropagation();
|
|
29292
|
+
}, []);
|
|
29293
|
+
// Memoize button props to prevent unnecessary re-renders
|
|
29294
|
+
var buttonProps = useCallback(function (direction) {
|
|
29295
|
+
return {
|
|
29296
|
+
onMouseDown: function onMouseDown() {
|
|
29297
|
+
return handleDirectionPress(direction);
|
|
29298
|
+
},
|
|
29299
|
+
onMouseUp: function onMouseUp() {
|
|
29300
|
+
return handleDirectionRelease(direction);
|
|
29301
|
+
},
|
|
29302
|
+
onMouseLeave: function onMouseLeave() {
|
|
29303
|
+
return handleDirectionRelease(direction);
|
|
29304
|
+
},
|
|
29305
|
+
onTouchStart: function onTouchStart(e) {
|
|
29306
|
+
return handleTouchStart(e, direction);
|
|
29307
|
+
},
|
|
29308
|
+
onTouchMove: handleTouchMove,
|
|
29309
|
+
onTouchEnd: handleTouchEnd,
|
|
29310
|
+
onContextMenu: preventDefault,
|
|
29311
|
+
size: size,
|
|
29312
|
+
isPressed: pressedButtons.has(direction),
|
|
29313
|
+
disabled: disabled
|
|
29314
|
+
};
|
|
29315
|
+
}, [handleDirectionPress, handleDirectionRelease, handleTouchStart, handleTouchMove, handleTouchEnd, preventDefault, size, pressedButtons, disabled]);
|
|
29316
|
+
return React.createElement(DPadContainer, {
|
|
29317
|
+
opacity: opacity,
|
|
29318
|
+
showBackground: showBackground,
|
|
29319
|
+
size: size,
|
|
29320
|
+
disabled: disabled,
|
|
29321
|
+
onContextMenu: preventDefault,
|
|
29322
|
+
onTouchCancel: handleTouchCancel
|
|
29323
|
+
}, React.createElement(DPadButton, Object.assign({
|
|
29324
|
+
className: "up"
|
|
29325
|
+
}, buttonProps('up'))), React.createElement(DPadButton, Object.assign({
|
|
29326
|
+
className: "right"
|
|
29327
|
+
}, buttonProps('right'))), React.createElement(DPadButton, Object.assign({
|
|
29328
|
+
className: "down"
|
|
29329
|
+
}, buttonProps('down'))), React.createElement(DPadButton, Object.assign({
|
|
29330
|
+
className: "left"
|
|
29331
|
+
}, buttonProps('left'))), React.createElement(DPadCenter, {
|
|
29332
|
+
size: size,
|
|
29333
|
+
disabled: disabled,
|
|
29334
|
+
onContextMenu: preventDefault
|
|
29335
|
+
}));
|
|
29336
|
+
});
|
|
29337
|
+
JoystickDPad.displayName = 'JoystickDPad';
|
|
29073
29338
|
|
|
29074
29339
|
var DropdownSelectorContainer = function DropdownSelectorContainer(_ref) {
|
|
29075
29340
|
var title = _ref.title,
|
|
@@ -30450,7 +30715,7 @@ var TabButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
30450
30715
|
var ContentWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
30451
30716
|
displayName: "InternalTabs__ContentWrapper",
|
|
30452
30717
|
componentId: "sc-ldufv0-3"
|
|
30453
|
-
})(["
|
|
30718
|
+
})([""]);
|
|
30454
30719
|
|
|
30455
30720
|
var SlotsContainer = function SlotsContainer(_ref) {
|
|
30456
30721
|
var children = _ref.children,
|
|
@@ -34302,5 +34567,5 @@ var LessonContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
34302
34567
|
componentId: "sc-7tgzv2-6"
|
|
34303
34568
|
})(["display:flex;flex-direction:column;justify-content:space-between;min-height:200px;p{font-size:0.7rem !important;}"]);
|
|
34304
34569
|
|
|
34305
|
-
export { ActionButtons, AsyncDropdown, Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, ChatRevamp, CheckButton, CheckItem, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, EquipmentSlotSpriteByType, ErrorBoundary, FriendList, HistoryDialog, ImageCarousel, ImgSide, Input, InputRadio, InternalTabs, ItemContainer$1 as ItemContainer, ItemQuantitySelectorModal, ItemSelector, ItemSlot, Leaderboard, ListMenu, Marketplace, MarketplaceRows, MultitabType, NPCDialog, NPCDialogType, NPCMultiDialog, PartyCreate, PartyDashboard, PartyInvite, PartyManager, PartyManagerRow, PartyRow, PlayersRow, ProgressBar, PropertySelect, QuantitySelectorModal, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, SelectArrow, Shortcuts, SimpleImageCarousel, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas, Stepper, TabBody, Table, TableCell, TableHeader, TableRow, TabsContainer, TextArea, TimeWidget, Tooltip, TradingMenu, Truncate, TutorialStepper, UserActionLink, _RPGUI, formatQuestStatus, formatQuestText, getMockedPlayersRowsLeader, getMockedPlayersRowsNotLeader, getQuestStatusColor, mockedPartyManager, mockedPartyRows, mockedPlayersRows, mockedPlayersRows2, useEventListener };
|
|
34570
|
+
export { ActionButtons, AsyncDropdown, Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, ChatRevamp, CheckButton, CheckItem, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, EquipmentSlotSpriteByType, ErrorBoundary, FriendList, HistoryDialog, ImageCarousel, ImgSide, Input, InputRadio, InternalTabs, ItemContainer$1 as ItemContainer, ItemQuantitySelectorModal, ItemSelector, ItemSlot, JoystickDPad, Leaderboard, ListMenu, Marketplace, MarketplaceRows, MultitabType, NPCDialog, NPCDialogType, NPCMultiDialog, PartyCreate, PartyDashboard, PartyInvite, PartyManager, PartyManagerRow, PartyRow, PlayersRow, ProgressBar, PropertySelect, QuantitySelectorModal, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, SelectArrow, Shortcuts, SimpleImageCarousel, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas, Stepper, TabBody, Table, TableCell, TableHeader, TableRow, TabsContainer, TextArea, TimeWidget, Tooltip, TradingMenu, Truncate, TutorialStepper, UserActionLink, _RPGUI, formatQuestStatus, formatQuestText, getMockedPlayersRowsLeader, getMockedPlayersRowsNotLeader, getQuestStatusColor, mockedPartyManager, mockedPartyRows, mockedPlayersRows, mockedPlayersRows2, useEventListener };
|
|
34306
34571
|
//# sourceMappingURL=long-bow.esm.js.map
|