@rpg-engine/long-bow 0.8.71 → 0.8.73
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/Store/CartView.d.ts +7 -6
- package/dist/components/Store/Store.d.ts +2 -2
- package/dist/components/Store/StoreCharacterSkinRow.d.ts +3 -3
- package/dist/components/Store/StoreItemDetails.d.ts +3 -3
- package/dist/components/Store/StoreItemRow.d.ts +4 -3
- package/dist/components/Store/hooks/useStoreCart.d.ts +5 -3
- package/dist/components/Store/hooks/useStoreMetadata.d.ts +3 -3
- package/dist/components/Store/sections/StoreItemsSection.d.ts +3 -3
- package/dist/hooks/useCharacterSkinNavigation.d.ts +7 -0
- package/dist/hooks/usePackFiltering.d.ts +7 -0
- package/dist/hooks/useQuantityControl.d.ts +10 -0
- package/dist/hooks/useStoreFiltering.d.ts +11 -0
- package/dist/long-bow.cjs.development.js +264 -112
- 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 +265 -113
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Store/CartView.tsx +9 -6
- package/src/components/Store/Store.tsx +13 -21
- package/src/components/Store/StoreCharacterSkinRow.tsx +64 -46
- package/src/components/Store/StoreItemDetails.tsx +4 -4
- package/src/components/Store/StoreItemRow.tsx +64 -56
- package/src/components/Store/hooks/useStoreCart.ts +14 -9
- package/src/components/Store/hooks/useStoreMetadata.ts +5 -5
- package/src/components/Store/sections/StoreItemsSection.tsx +78 -27
- package/src/components/Store/sections/StorePacksSection.tsx +5 -10
- package/src/hooks/useCharacterSkinNavigation.ts +34 -0
- package/src/hooks/usePackFiltering.ts +20 -0
- package/src/hooks/useQuantityControl.ts +41 -0
- package/src/hooks/useStoreFiltering.ts +51 -0
- package/src/mocks/dailyTasks.mocks.ts +6 -6
- package/src/stories/Features/store/Store.stories.tsx +59 -72
|
@@ -57634,7 +57634,7 @@ var useStoreMetadata = function useStoreMetadata() {
|
|
|
57634
57634
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
57635
57635
|
while (1) switch (_context.prev = _context.next) {
|
|
57636
57636
|
case 0:
|
|
57637
|
-
if (!(!item.metadataType || item.metadataType
|
|
57637
|
+
if (!(!item.metadataType || item.metadataType !== shared.MetadataType.CharacterSkin)) {
|
|
57638
57638
|
_context.next = 2;
|
|
57639
57639
|
break;
|
|
57640
57640
|
}
|
|
@@ -57714,7 +57714,7 @@ var useStoreCart = function useStoreCart() {
|
|
|
57714
57714
|
});
|
|
57715
57715
|
return _context.abrupt("return");
|
|
57716
57716
|
case 3:
|
|
57717
|
-
if (!(item.metadataType
|
|
57717
|
+
if (!(item.metadataType === shared.MetadataType.CharacterSkin)) {
|
|
57718
57718
|
_context.next = 12;
|
|
57719
57719
|
break;
|
|
57720
57720
|
}
|
|
@@ -57830,7 +57830,11 @@ var useStoreCart = function useStoreCart() {
|
|
|
57830
57830
|
};
|
|
57831
57831
|
// Helper functions
|
|
57832
57832
|
function getPurchaseType(item) {
|
|
57833
|
-
//
|
|
57833
|
+
// Use the type from IProductBlueprint if available, otherwise infer
|
|
57834
|
+
if (item.type) {
|
|
57835
|
+
return item.type;
|
|
57836
|
+
}
|
|
57837
|
+
// Fallback logic for backward compatibility
|
|
57834
57838
|
if (item.key.startsWith('pack_')) {
|
|
57835
57839
|
return shared.PurchaseType.Pack;
|
|
57836
57840
|
} else {
|
|
@@ -57962,25 +57966,13 @@ var EmptyMessage$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
57962
57966
|
componentId: "sc-xhh2um-8"
|
|
57963
57967
|
})(["text-align:center;color:#9ca3af;padding:2rem;flex:1;display:flex;align-items:center;justify-content:center;"]);
|
|
57964
57968
|
|
|
57965
|
-
var
|
|
57966
|
-
var _item$metadataConfig, _item$metadataConfig2, _item$metadataConfig3, _item$requiredAccount;
|
|
57967
|
-
var item = _ref.item,
|
|
57968
|
-
atlasJSON = _ref.atlasJSON,
|
|
57969
|
-
atlasIMG = _ref.atlasIMG,
|
|
57970
|
-
onAddToCart = _ref.onAddToCart,
|
|
57971
|
-
userAccountType = _ref.userAccountType;
|
|
57969
|
+
var useCharacterSkinNavigation = function useCharacterSkinNavigation(availableCharacters, itemKey) {
|
|
57972
57970
|
var _useState = React.useState(0),
|
|
57973
57971
|
currentIndex = _useState[0],
|
|
57974
57972
|
setCurrentIndex = _useState[1];
|
|
57975
|
-
// Get available characters from metadata
|
|
57976
|
-
var availableCharacters = item.metadataType === shared.MetadataType.CharacterSkin && ((_item$metadataConfig = item.metadataConfig) == null ? void 0 : _item$metadataConfig.availableCharacters) || [];
|
|
57977
|
-
// Get the active character entity atlas info
|
|
57978
|
-
var entityAtlasJSON = (_item$metadataConfig2 = item.metadataConfig) == null ? void 0 : _item$metadataConfig2.atlasJSON;
|
|
57979
|
-
var entityAtlasIMG = (_item$metadataConfig3 = item.metadataConfig) == null ? void 0 : _item$metadataConfig3.atlasIMG;
|
|
57980
|
-
// Effect to reset currentIndex when switching items
|
|
57981
57973
|
React.useEffect(function () {
|
|
57982
57974
|
setCurrentIndex(0);
|
|
57983
|
-
}, [
|
|
57975
|
+
}, [itemKey]);
|
|
57984
57976
|
var handlePreviousSkin = function handlePreviousSkin() {
|
|
57985
57977
|
setCurrentIndex(function (prevIndex) {
|
|
57986
57978
|
return prevIndex === 0 ? availableCharacters.length - 1 : prevIndex - 1;
|
|
@@ -57991,6 +57983,31 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
57991
57983
|
return prevIndex === availableCharacters.length - 1 ? 0 : prevIndex + 1;
|
|
57992
57984
|
});
|
|
57993
57985
|
};
|
|
57986
|
+
var currentCharacter = availableCharacters[currentIndex];
|
|
57987
|
+
return {
|
|
57988
|
+
currentIndex: currentIndex,
|
|
57989
|
+
currentCharacter: currentCharacter,
|
|
57990
|
+
handlePreviousSkin: handlePreviousSkin,
|
|
57991
|
+
handleNextSkin: handleNextSkin
|
|
57992
|
+
};
|
|
57993
|
+
};
|
|
57994
|
+
|
|
57995
|
+
var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
57996
|
+
var _item$metadataConfig, _item$metadataConfig2, _item$metadataConfig3, _item$requiredAccount, _item$store;
|
|
57997
|
+
var item = _ref.item,
|
|
57998
|
+
atlasJSON = _ref.atlasJSON,
|
|
57999
|
+
atlasIMG = _ref.atlasIMG,
|
|
58000
|
+
onAddToCart = _ref.onAddToCart,
|
|
58001
|
+
userAccountType = _ref.userAccountType;
|
|
58002
|
+
// Get available characters from metadata
|
|
58003
|
+
var availableCharacters = item.metadataType === shared.MetadataType.CharacterSkin && ((_item$metadataConfig = item.metadataConfig) == null ? void 0 : _item$metadataConfig.availableCharacters) || [];
|
|
58004
|
+
// Get the active character entity atlas info
|
|
58005
|
+
var entityAtlasJSON = (_item$metadataConfig2 = item.metadataConfig) == null ? void 0 : _item$metadataConfig2.atlasJSON;
|
|
58006
|
+
var entityAtlasIMG = (_item$metadataConfig3 = item.metadataConfig) == null ? void 0 : _item$metadataConfig3.atlasIMG;
|
|
58007
|
+
var _useCharacterSkinNavi = useCharacterSkinNavigation(availableCharacters, item.key),
|
|
58008
|
+
currentCharacter = _useCharacterSkinNavi.currentCharacter,
|
|
58009
|
+
handlePreviousSkin = _useCharacterSkinNavi.handlePreviousSkin,
|
|
58010
|
+
handleNextSkin = _useCharacterSkinNavi.handleNextSkin;
|
|
57994
58011
|
var hasRequiredAccount = !((_item$requiredAccount = item.requiredAccountType) != null && _item$requiredAccount.length) || item.requiredAccountType.includes(userAccountType);
|
|
57995
58012
|
var handleAddToCart = function handleAddToCart() {
|
|
57996
58013
|
if (!hasRequiredAccount) return;
|
|
@@ -58007,8 +58024,9 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
58007
58024
|
var getSpriteKey = function getSpriteKey(textureKey) {
|
|
58008
58025
|
return textureKey + '/down/standing/0.png';
|
|
58009
58026
|
};
|
|
58010
|
-
|
|
58011
|
-
|
|
58027
|
+
return React__default.createElement(ItemWrapper, {
|
|
58028
|
+
"$isHighlighted": ((_item$store = item.store) == null ? void 0 : _item$store.isHighlighted) || false
|
|
58029
|
+
}, React__default.createElement(ItemIconContainer$2, null, entityAtlasJSON && entityAtlasIMG && currentCharacter ? React__default.createElement(SpriteFromAtlas, {
|
|
58012
58030
|
atlasJSON: entityAtlasJSON,
|
|
58013
58031
|
atlasIMG: entityAtlasIMG,
|
|
58014
58032
|
spriteKey: getSpriteKey(currentCharacter.textureKey),
|
|
@@ -58016,7 +58034,7 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
58016
58034
|
height: 32,
|
|
58017
58035
|
imgScale: 2,
|
|
58018
58036
|
centered: true
|
|
58019
|
-
}) : React__default.createElement(SpriteFromAtlas, {
|
|
58037
|
+
}) : item.texturePath ? React__default.createElement(SpriteFromAtlas, {
|
|
58020
58038
|
atlasJSON: atlasJSON,
|
|
58021
58039
|
atlasIMG: atlasIMG,
|
|
58022
58040
|
spriteKey: item.texturePath,
|
|
@@ -58024,7 +58042,7 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
58024
58042
|
height: 32,
|
|
58025
58043
|
imgScale: 2,
|
|
58026
58044
|
centered: true
|
|
58027
|
-
})), React__default.createElement(ItemDetails$1, null, React__default.createElement(Header$8, null, React__default.createElement(ItemName$1, null, item.name)), availableCharacters.length > 0 && currentCharacter && React__default.createElement(SelectedSkinNav, null, React__default.createElement(SelectedSkin, null, "Selected:"), React__default.createElement(SkinNavArrow, {
|
|
58045
|
+
}) : React__default.createElement(DefaultIcon, null, "\uD83D\uDC64")), React__default.createElement(ItemDetails$1, null, React__default.createElement(Header$8, null, React__default.createElement(ItemName$1, null, item.name)), availableCharacters.length > 0 && currentCharacter && React__default.createElement(SelectedSkinNav, null, React__default.createElement(SelectedSkin, null, "Selected:"), React__default.createElement(SkinNavArrow, {
|
|
58028
58046
|
direction: "left",
|
|
58029
58047
|
onPointerDown: handlePreviousSkin,
|
|
58030
58048
|
size: 24
|
|
@@ -58042,7 +58060,11 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
58042
58060
|
var ItemWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
58043
58061
|
displayName: "StoreCharacterSkinRow__ItemWrapper",
|
|
58044
58062
|
componentId: "sc-81xqsx-0"
|
|
58045
|
-
})(["display:flex;align-items:center;gap:
|
|
58063
|
+
})(["display:flex;align-items:center;gap:0.75rem;padding:0.5rem 1rem;border-bottom:1px solid rgba(255,255,255,0.1);background:", ";border-left:", ";&:last-child{border-bottom:none;}"], function (props) {
|
|
58064
|
+
return props.$isHighlighted ? 'rgba(255, 215, 0, 0.1)' : 'transparent';
|
|
58065
|
+
}, function (props) {
|
|
58066
|
+
return props.$isHighlighted ? '3px solid #ffd700' : '3px solid transparent';
|
|
58067
|
+
});
|
|
58046
58068
|
var ItemIconContainer$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58047
58069
|
displayName: "StoreCharacterSkinRow__ItemIconContainer",
|
|
58048
58070
|
componentId: "sc-81xqsx-1"
|
|
@@ -58050,23 +58072,23 @@ var ItemIconContainer$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
58050
58072
|
var ItemDetails$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58051
58073
|
displayName: "StoreCharacterSkinRow__ItemDetails",
|
|
58052
58074
|
componentId: "sc-81xqsx-2"
|
|
58053
|
-
})(["flex:1;display:flex;flex-direction:column;gap:0.
|
|
58075
|
+
})(["flex:1;display:flex;flex-direction:column;gap:0.25rem;"]);
|
|
58054
58076
|
var ItemName$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58055
58077
|
displayName: "StoreCharacterSkinRow__ItemName",
|
|
58056
58078
|
componentId: "sc-81xqsx-3"
|
|
58057
|
-
})(["font-family:'Press Start 2P',cursive;font-size:0.
|
|
58079
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.75rem;color:#ffffff;"]);
|
|
58058
58080
|
var SelectedSkin = /*#__PURE__*/styled__default.div.withConfig({
|
|
58059
58081
|
displayName: "StoreCharacterSkinRow__SelectedSkin",
|
|
58060
58082
|
componentId: "sc-81xqsx-4"
|
|
58061
|
-
})(["font-family:'Press Start 2P',cursive;font-size:0.
|
|
58083
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.5rem;color:#fef08a;"]);
|
|
58062
58084
|
var ItemPrice = /*#__PURE__*/styled__default.div.withConfig({
|
|
58063
58085
|
displayName: "StoreCharacterSkinRow__ItemPrice",
|
|
58064
58086
|
componentId: "sc-81xqsx-5"
|
|
58065
|
-
})(["font-family:'Press Start 2P',cursive;font-size:0.
|
|
58087
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.625rem;color:#fef08a;"]);
|
|
58066
58088
|
var Controls = /*#__PURE__*/styled__default.div.withConfig({
|
|
58067
58089
|
displayName: "StoreCharacterSkinRow__Controls",
|
|
58068
58090
|
componentId: "sc-81xqsx-6"
|
|
58069
|
-
})(["display:flex;align-items:center;gap:
|
|
58091
|
+
})(["display:flex;align-items:center;gap:0.5rem;min-width:fit-content;"]);
|
|
58070
58092
|
// Styled arrow override for inline nav arrows
|
|
58071
58093
|
var SkinNavArrow = /*#__PURE__*/styled__default(SelectArrow).withConfig({
|
|
58072
58094
|
displayName: "StoreCharacterSkinRow__SkinNavArrow",
|
|
@@ -58080,40 +58102,77 @@ var SelectedSkinNav = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
58080
58102
|
displayName: "StoreCharacterSkinRow__SelectedSkinNav",
|
|
58081
58103
|
componentId: "sc-81xqsx-9"
|
|
58082
58104
|
})(["display:flex;align-items:center;gap:0.5rem;"]);
|
|
58105
|
+
var DefaultIcon = /*#__PURE__*/styled__default.div.withConfig({
|
|
58106
|
+
displayName: "StoreCharacterSkinRow__DefaultIcon",
|
|
58107
|
+
componentId: "sc-81xqsx-10"
|
|
58108
|
+
})(["font-size:1.5rem;display:flex;align-items:center;justify-content:center;width:32px;height:32px;"]);
|
|
58083
58109
|
|
|
58084
|
-
var
|
|
58085
|
-
|
|
58086
|
-
|
|
58087
|
-
|
|
58088
|
-
|
|
58089
|
-
|
|
58090
|
-
|
|
58091
|
-
|
|
58092
|
-
|
|
58093
|
-
|
|
58110
|
+
var useQuantityControl = function useQuantityControl(initialQuantity, min, max) {
|
|
58111
|
+
if (initialQuantity === void 0) {
|
|
58112
|
+
initialQuantity = 1;
|
|
58113
|
+
}
|
|
58114
|
+
if (min === void 0) {
|
|
58115
|
+
min = 1;
|
|
58116
|
+
}
|
|
58117
|
+
if (max === void 0) {
|
|
58118
|
+
max = 99;
|
|
58119
|
+
}
|
|
58120
|
+
var _useState = React.useState(initialQuantity),
|
|
58094
58121
|
quantity = _useState[0],
|
|
58095
58122
|
setQuantity = _useState[1];
|
|
58096
|
-
var _useState2 = React.useState(''),
|
|
58097
|
-
textInputValue = _useState2[0],
|
|
58098
|
-
setTextInputValue = _useState2[1];
|
|
58099
58123
|
var handleQuantityChange = function handleQuantityChange(e) {
|
|
58100
|
-
var value = parseInt(e.target.value) ||
|
|
58101
|
-
setQuantity(Math.min(Math.max(
|
|
58124
|
+
var value = parseInt(e.target.value) || min;
|
|
58125
|
+
setQuantity(Math.min(Math.max(min, value), max));
|
|
58102
58126
|
};
|
|
58103
58127
|
var handleBlur = function handleBlur() {
|
|
58104
|
-
if (quantity <
|
|
58105
|
-
if (quantity >
|
|
58128
|
+
if (quantity < min) setQuantity(min);
|
|
58129
|
+
if (quantity > max) setQuantity(max);
|
|
58106
58130
|
};
|
|
58107
58131
|
var incrementQuantity = function incrementQuantity() {
|
|
58108
58132
|
setQuantity(function (prev) {
|
|
58109
|
-
return Math.min(prev + 1,
|
|
58133
|
+
return Math.min(prev + 1, max);
|
|
58110
58134
|
});
|
|
58111
58135
|
};
|
|
58112
58136
|
var decrementQuantity = function decrementQuantity() {
|
|
58113
58137
|
setQuantity(function (prev) {
|
|
58114
|
-
return Math.max(
|
|
58138
|
+
return Math.max(min, prev - 1);
|
|
58115
58139
|
});
|
|
58116
58140
|
};
|
|
58141
|
+
var resetQuantity = function resetQuantity() {
|
|
58142
|
+
setQuantity(initialQuantity);
|
|
58143
|
+
};
|
|
58144
|
+
return {
|
|
58145
|
+
quantity: quantity,
|
|
58146
|
+
setQuantity: setQuantity,
|
|
58147
|
+
handleQuantityChange: handleQuantityChange,
|
|
58148
|
+
handleBlur: handleBlur,
|
|
58149
|
+
incrementQuantity: incrementQuantity,
|
|
58150
|
+
decrementQuantity: decrementQuantity,
|
|
58151
|
+
resetQuantity: resetQuantity
|
|
58152
|
+
};
|
|
58153
|
+
};
|
|
58154
|
+
|
|
58155
|
+
var StoreItemRow = function StoreItemRow(_ref) {
|
|
58156
|
+
var _item$requiredAccount, _item$store;
|
|
58157
|
+
var item = _ref.item,
|
|
58158
|
+
atlasJSON = _ref.atlasJSON,
|
|
58159
|
+
atlasIMG = _ref.atlasIMG,
|
|
58160
|
+
onAddToCart = _ref.onAddToCart,
|
|
58161
|
+
userAccountType = _ref.userAccountType,
|
|
58162
|
+
_ref$showTextInput = _ref.showTextInput,
|
|
58163
|
+
showTextInput = _ref$showTextInput === void 0 ? false : _ref$showTextInput,
|
|
58164
|
+
_ref$textInputPlaceho = _ref.textInputPlaceholder,
|
|
58165
|
+
textInputPlaceholder = _ref$textInputPlaceho === void 0 ? item.inputPlaceholder : _ref$textInputPlaceho;
|
|
58166
|
+
var _useState = React.useState(''),
|
|
58167
|
+
textInputValue = _useState[0],
|
|
58168
|
+
setTextInputValue = _useState[1];
|
|
58169
|
+
var _useQuantityControl = useQuantityControl(),
|
|
58170
|
+
quantity = _useQuantityControl.quantity,
|
|
58171
|
+
handleQuantityChange = _useQuantityControl.handleQuantityChange,
|
|
58172
|
+
handleBlur = _useQuantityControl.handleBlur,
|
|
58173
|
+
incrementQuantity = _useQuantityControl.incrementQuantity,
|
|
58174
|
+
decrementQuantity = _useQuantityControl.decrementQuantity,
|
|
58175
|
+
resetQuantity = _useQuantityControl.resetQuantity;
|
|
58117
58176
|
var hasRequiredAccount = !((_item$requiredAccount = item.requiredAccountType) != null && _item$requiredAccount.length) || item.requiredAccountType.includes(userAccountType);
|
|
58118
58177
|
var handleAddToCartInternal = function handleAddToCartInternal() {
|
|
58119
58178
|
if (!hasRequiredAccount) return;
|
|
@@ -58124,10 +58183,12 @@ var StoreItemRow = function StoreItemRow(_ref) {
|
|
|
58124
58183
|
setTextInputValue('');
|
|
58125
58184
|
} else {
|
|
58126
58185
|
onAddToCart(item, quantity);
|
|
58127
|
-
|
|
58186
|
+
resetQuantity();
|
|
58128
58187
|
}
|
|
58129
58188
|
};
|
|
58130
|
-
return React__default.createElement(ItemWrapper$1,
|
|
58189
|
+
return React__default.createElement(ItemWrapper$1, {
|
|
58190
|
+
"$isHighlighted": ((_item$store = item.store) == null ? void 0 : _item$store.isHighlighted) || false
|
|
58191
|
+
}, React__default.createElement(ItemIconContainer$3, null, React__default.createElement(SpriteFromAtlas, {
|
|
58131
58192
|
atlasJSON: atlasJSON,
|
|
58132
58193
|
atlasIMG: atlasIMG,
|
|
58133
58194
|
spriteKey: item.texturePath,
|
|
@@ -58135,10 +58196,10 @@ var StoreItemRow = function StoreItemRow(_ref) {
|
|
|
58135
58196
|
height: 32,
|
|
58136
58197
|
imgScale: 2,
|
|
58137
58198
|
centered: true
|
|
58138
|
-
})), React__default.createElement(ItemDetails$2, null, React__default.createElement(ItemName$2, null, item.name), React__default.createElement(ItemPrice$1, null, "$", item.price)), React__default.createElement(Controls$1, null, showTextInput ? React__default.createElement(TextInput, {
|
|
58199
|
+
})), React__default.createElement(ItemDetails$2, null, React__default.createElement(ItemName$2, null, item.name), React__default.createElement(ItemPrice$1, null, "$", item.price), React__default.createElement(ItemDescription, null, item.description)), React__default.createElement(Controls$1, null, showTextInput ? React__default.createElement(TextInput, {
|
|
58139
58200
|
type: "text",
|
|
58140
58201
|
value: textInputValue,
|
|
58141
|
-
placeholder:
|
|
58202
|
+
placeholder: textInputPlaceholder,
|
|
58142
58203
|
onChange: function onChange(e) {
|
|
58143
58204
|
return setTextInputValue(e.target.value);
|
|
58144
58205
|
},
|
|
@@ -58169,7 +58230,11 @@ var StoreItemRow = function StoreItemRow(_ref) {
|
|
|
58169
58230
|
var ItemWrapper$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58170
58231
|
displayName: "StoreItemRow__ItemWrapper",
|
|
58171
58232
|
componentId: "sc-ptotuo-0"
|
|
58172
|
-
})(["display:flex;align-items:center;gap:
|
|
58233
|
+
})(["display:flex;align-items:center;gap:0.75rem;padding:0.5rem 1rem;border-bottom:1px solid rgba(255,255,255,0.1);background:", ";border-left:", ";&:last-child{border-bottom:none;}"], function (props) {
|
|
58234
|
+
return props.$isHighlighted ? 'rgba(255, 215, 0, 0.1)' : 'transparent';
|
|
58235
|
+
}, function (props) {
|
|
58236
|
+
return props.$isHighlighted ? '3px solid #ffd700' : '3px solid transparent';
|
|
58237
|
+
});
|
|
58173
58238
|
var ItemIconContainer$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58174
58239
|
displayName: "StoreItemRow__ItemIconContainer",
|
|
58175
58240
|
componentId: "sc-ptotuo-1"
|
|
@@ -58177,32 +58242,80 @@ var ItemIconContainer$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
58177
58242
|
var ItemDetails$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58178
58243
|
displayName: "StoreItemRow__ItemDetails",
|
|
58179
58244
|
componentId: "sc-ptotuo-2"
|
|
58180
|
-
})(["flex:1;display:flex;flex-direction:column;gap:0.
|
|
58245
|
+
})(["flex:1;display:flex;flex-direction:column;gap:0.25rem;"]);
|
|
58181
58246
|
var ItemName$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58182
58247
|
displayName: "StoreItemRow__ItemName",
|
|
58183
58248
|
componentId: "sc-ptotuo-3"
|
|
58184
|
-
})(["font-family:'Press Start 2P',cursive;font-size:0.
|
|
58249
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.75rem;color:#ffffff;"]);
|
|
58185
58250
|
var ItemPrice$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58186
58251
|
displayName: "StoreItemRow__ItemPrice",
|
|
58187
58252
|
componentId: "sc-ptotuo-4"
|
|
58188
|
-
})(["font-family:'Press Start 2P',cursive;font-size:0.
|
|
58253
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.625rem;color:#fef08a;"]);
|
|
58254
|
+
var ItemDescription = /*#__PURE__*/styled__default.div.withConfig({
|
|
58255
|
+
displayName: "StoreItemRow__ItemDescription",
|
|
58256
|
+
componentId: "sc-ptotuo-5"
|
|
58257
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.625rem;color:rgba(255,255,255,0.7);line-height:1.4;"]);
|
|
58189
58258
|
var Controls$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58190
58259
|
displayName: "StoreItemRow__Controls",
|
|
58191
|
-
componentId: "sc-ptotuo-
|
|
58192
|
-
})(["display:flex;align-items:center;gap:
|
|
58260
|
+
componentId: "sc-ptotuo-6"
|
|
58261
|
+
})(["display:flex;align-items:center;gap:0.5rem;min-width:fit-content;"]);
|
|
58193
58262
|
var ArrowsContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
58194
58263
|
displayName: "StoreItemRow__ArrowsContainer",
|
|
58195
|
-
componentId: "sc-ptotuo-
|
|
58264
|
+
componentId: "sc-ptotuo-7"
|
|
58196
58265
|
})(["position:relative;display:flex;align-items:center;width:120px;height:42px;justify-content:space-between;"]);
|
|
58197
58266
|
var QuantityInput = /*#__PURE__*/styled__default.input.withConfig({
|
|
58198
58267
|
displayName: "StoreItemRow__QuantityInput",
|
|
58199
|
-
componentId: "sc-ptotuo-
|
|
58268
|
+
componentId: "sc-ptotuo-8"
|
|
58200
58269
|
})(["width:40px;text-align:center;margin:0 auto;font-size:0.875rem;background:rgba(0,0,0,0.2);color:#ffffff;border:none;padding:0.25rem;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}"]);
|
|
58201
58270
|
var TextInput = /*#__PURE__*/styled__default.input.withConfig({
|
|
58202
58271
|
displayName: "StoreItemRow__TextInput",
|
|
58203
|
-
componentId: "sc-ptotuo-
|
|
58272
|
+
componentId: "sc-ptotuo-9"
|
|
58204
58273
|
})(["width:120px;text-align:center;margin:0 auto;font-size:0.875rem;background:rgba(0,0,0,0.2);color:#ffffff;border:none;padding:0.25rem;"]);
|
|
58205
58274
|
|
|
58275
|
+
var useStoreFiltering = function useStoreFiltering(items) {
|
|
58276
|
+
var _useState = React.useState(''),
|
|
58277
|
+
searchQuery = _useState[0],
|
|
58278
|
+
setSearchQuery = _useState[1];
|
|
58279
|
+
var _useState2 = React.useState('all'),
|
|
58280
|
+
selectedCategory = _useState2[0],
|
|
58281
|
+
setSelectedCategory = _useState2[1];
|
|
58282
|
+
var categoryOptions = React.useMemo(function () {
|
|
58283
|
+
var uniqueCategories = Array.from(new Set(items.map(function (item) {
|
|
58284
|
+
return item.itemType;
|
|
58285
|
+
})));
|
|
58286
|
+
var allCategories = ['all'].concat(uniqueCategories);
|
|
58287
|
+
return allCategories.map(function (category, index) {
|
|
58288
|
+
return {
|
|
58289
|
+
id: index,
|
|
58290
|
+
value: category,
|
|
58291
|
+
option: category === 'all' ? 'All' : category
|
|
58292
|
+
};
|
|
58293
|
+
});
|
|
58294
|
+
}, [items]);
|
|
58295
|
+
var filteredItems = React.useMemo(function () {
|
|
58296
|
+
return items.filter(function (item) {
|
|
58297
|
+
var matchesSearch = item.name.toLowerCase().includes(searchQuery.toLowerCase());
|
|
58298
|
+
var matchesCategory = selectedCategory === 'all' || item.itemType === selectedCategory;
|
|
58299
|
+
return matchesSearch && matchesCategory;
|
|
58300
|
+
}).sort(function (a, b) {
|
|
58301
|
+
var _a$store, _b$store;
|
|
58302
|
+
var aHighlighted = ((_a$store = a.store) == null ? void 0 : _a$store.isHighlighted) || false;
|
|
58303
|
+
var bHighlighted = ((_b$store = b.store) == null ? void 0 : _b$store.isHighlighted) || false;
|
|
58304
|
+
if (aHighlighted && !bHighlighted) return -1;
|
|
58305
|
+
if (!aHighlighted && bHighlighted) return 1;
|
|
58306
|
+
return 0;
|
|
58307
|
+
});
|
|
58308
|
+
}, [items, searchQuery, selectedCategory]);
|
|
58309
|
+
return {
|
|
58310
|
+
searchQuery: searchQuery,
|
|
58311
|
+
setSearchQuery: setSearchQuery,
|
|
58312
|
+
selectedCategory: selectedCategory,
|
|
58313
|
+
setSelectedCategory: setSelectedCategory,
|
|
58314
|
+
categoryOptions: categoryOptions,
|
|
58315
|
+
filteredItems: filteredItems
|
|
58316
|
+
};
|
|
58317
|
+
};
|
|
58318
|
+
|
|
58206
58319
|
var StoreItemsSection = function StoreItemsSection(_ref) {
|
|
58207
58320
|
var items = _ref.items,
|
|
58208
58321
|
onAddToCart = _ref.onAddToCart,
|
|
@@ -58211,17 +58324,17 @@ var StoreItemsSection = function StoreItemsSection(_ref) {
|
|
|
58211
58324
|
userAccountType = _ref.userAccountType,
|
|
58212
58325
|
_ref$textInputItemKey = _ref.textInputItemKeys,
|
|
58213
58326
|
textInputItemKeys = _ref$textInputItemKey === void 0 ? [] : _ref$textInputItemKey;
|
|
58214
|
-
var
|
|
58215
|
-
searchQuery =
|
|
58216
|
-
setSearchQuery =
|
|
58217
|
-
|
|
58218
|
-
|
|
58219
|
-
|
|
58327
|
+
var _useStoreFiltering = useStoreFiltering(items),
|
|
58328
|
+
searchQuery = _useStoreFiltering.searchQuery,
|
|
58329
|
+
setSearchQuery = _useStoreFiltering.setSearchQuery,
|
|
58330
|
+
setSelectedCategory = _useStoreFiltering.setSelectedCategory,
|
|
58331
|
+
categoryOptions = _useStoreFiltering.categoryOptions,
|
|
58332
|
+
filteredItems = _useStoreFiltering.filteredItems;
|
|
58220
58333
|
var renderStoreItem = function renderStoreItem(item) {
|
|
58221
58334
|
// Prefer a specialized character skin row when needed
|
|
58222
58335
|
if (item.metadataType === shared.MetadataType.CharacterSkin) {
|
|
58223
58336
|
return React__default.createElement(StoreCharacterSkinRow, {
|
|
58224
|
-
key: item.
|
|
58337
|
+
key: item.key,
|
|
58225
58338
|
item: item,
|
|
58226
58339
|
atlasJSON: atlasJSON,
|
|
58227
58340
|
atlasIMG: atlasIMG,
|
|
@@ -58230,9 +58343,9 @@ var StoreItemsSection = function StoreItemsSection(_ref) {
|
|
|
58230
58343
|
});
|
|
58231
58344
|
}
|
|
58232
58345
|
// Render text input row when configured for this item key
|
|
58233
|
-
if (textInputItemKeys.includes(item.key)
|
|
58346
|
+
if (textInputItemKeys.includes(item.key)) {
|
|
58234
58347
|
return React__default.createElement(StoreItemRow, {
|
|
58235
|
-
key: item.
|
|
58348
|
+
key: item.key,
|
|
58236
58349
|
item: item,
|
|
58237
58350
|
atlasJSON: atlasJSON,
|
|
58238
58351
|
atlasIMG: atlasIMG,
|
|
@@ -58243,7 +58356,7 @@ var StoreItemsSection = function StoreItemsSection(_ref) {
|
|
|
58243
58356
|
}
|
|
58244
58357
|
// Fallback to standard arrow-based row
|
|
58245
58358
|
return React__default.createElement(StoreItemRow, {
|
|
58246
|
-
key: item.
|
|
58359
|
+
key: item.key,
|
|
58247
58360
|
item: item,
|
|
58248
58361
|
atlasJSON: atlasJSON,
|
|
58249
58362
|
atlasIMG: atlasIMG,
|
|
@@ -58251,19 +58364,40 @@ var StoreItemsSection = function StoreItemsSection(_ref) {
|
|
|
58251
58364
|
userAccountType: userAccountType || shared.UserAccountTypes.Free
|
|
58252
58365
|
});
|
|
58253
58366
|
};
|
|
58254
|
-
return React__default.createElement(
|
|
58367
|
+
return React__default.createElement(StoreContainer, null, React__default.createElement(SearchHeader$1, null, React__default.createElement(SearchBarContainer, null, React__default.createElement(SearchBar, {
|
|
58368
|
+
value: searchQuery,
|
|
58369
|
+
onChange: setSearchQuery,
|
|
58370
|
+
placeholder: "Search items..."
|
|
58371
|
+
})), React__default.createElement(DropdownContainer$1, null, React__default.createElement(Dropdown, {
|
|
58372
|
+
options: categoryOptions,
|
|
58373
|
+
onChange: function onChange(value) {
|
|
58374
|
+
return setSelectedCategory(value);
|
|
58375
|
+
},
|
|
58376
|
+
width: "100%"
|
|
58377
|
+
}))), React__default.createElement(ScrollableContent, {
|
|
58255
58378
|
items: filteredItems,
|
|
58256
58379
|
renderItem: renderStoreItem,
|
|
58257
|
-
emptyMessage: "No items
|
|
58258
|
-
searchOptions: {
|
|
58259
|
-
value: searchQuery,
|
|
58260
|
-
onChange: setSearchQuery,
|
|
58261
|
-
placeholder: 'Search items...'
|
|
58262
|
-
},
|
|
58380
|
+
emptyMessage: "No items match your filters.",
|
|
58263
58381
|
layout: "list",
|
|
58264
|
-
maxHeight: "
|
|
58265
|
-
});
|
|
58382
|
+
maxHeight: "350px"
|
|
58383
|
+
}));
|
|
58266
58384
|
};
|
|
58385
|
+
var StoreContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
58386
|
+
displayName: "StoreItemsSection__StoreContainer",
|
|
58387
|
+
componentId: "sc-l6f466-0"
|
|
58388
|
+
})(["display:flex;flex-direction:column;height:100%;gap:0.5rem;"]);
|
|
58389
|
+
var SearchHeader$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58390
|
+
displayName: "StoreItemsSection__SearchHeader",
|
|
58391
|
+
componentId: "sc-l6f466-1"
|
|
58392
|
+
})(["display:flex;gap:0.5rem;align-items:center;padding-top:0.25rem;"]);
|
|
58393
|
+
var SearchBarContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
58394
|
+
displayName: "StoreItemsSection__SearchBarContainer",
|
|
58395
|
+
componentId: "sc-l6f466-2"
|
|
58396
|
+
})(["flex:0.75;"]);
|
|
58397
|
+
var DropdownContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58398
|
+
displayName: "StoreItemsSection__DropdownContainer",
|
|
58399
|
+
componentId: "sc-l6f466-3"
|
|
58400
|
+
})(["flex:0.25;min-width:140px;"]);
|
|
58267
58401
|
|
|
58268
58402
|
var ShoppingCardHorizontal = function ShoppingCardHorizontal(_ref) {
|
|
58269
58403
|
var title = _ref.title,
|
|
@@ -58328,13 +58462,30 @@ var CardFooter = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
58328
58462
|
componentId: "sc-ngkh06-6"
|
|
58329
58463
|
})(["margin-top:auto;padding-top:8px;border-top:1px solid rgba(255,255,255,0.1);"]);
|
|
58330
58464
|
|
|
58465
|
+
var usePackFiltering = function usePackFiltering(packs) {
|
|
58466
|
+
var _useState = React.useState(''),
|
|
58467
|
+
searchQuery = _useState[0],
|
|
58468
|
+
setSearchQuery = _useState[1];
|
|
58469
|
+
var filteredPacks = React.useMemo(function () {
|
|
58470
|
+
return packs.filter(function (pack) {
|
|
58471
|
+
return pack.title.toLowerCase().includes(searchQuery.toLowerCase());
|
|
58472
|
+
});
|
|
58473
|
+
}, [packs, searchQuery]);
|
|
58474
|
+
return {
|
|
58475
|
+
searchQuery: searchQuery,
|
|
58476
|
+
setSearchQuery: setSearchQuery,
|
|
58477
|
+
filteredPacks: filteredPacks
|
|
58478
|
+
};
|
|
58479
|
+
};
|
|
58480
|
+
|
|
58331
58481
|
var StorePacksSection = function StorePacksSection(_ref) {
|
|
58332
58482
|
var packs = _ref.packs,
|
|
58333
58483
|
onAddToCart = _ref.onAddToCart,
|
|
58334
58484
|
onSelectPack = _ref.onSelectPack;
|
|
58335
|
-
var
|
|
58336
|
-
searchQuery =
|
|
58337
|
-
setSearchQuery =
|
|
58485
|
+
var _usePackFiltering = usePackFiltering(packs),
|
|
58486
|
+
searchQuery = _usePackFiltering.searchQuery,
|
|
58487
|
+
setSearchQuery = _usePackFiltering.setSearchQuery,
|
|
58488
|
+
filteredPacks = _usePackFiltering.filteredPacks;
|
|
58338
58489
|
var renderPackFooter = React.useCallback(function (pack) {
|
|
58339
58490
|
return React__default.createElement(FooterContainer, null, React__default.createElement(Price, null, "$", pack.priceUSD), React__default.createElement(CTAButton, {
|
|
58340
58491
|
icon: React__default.createElement(fa.FaCartPlus, null),
|
|
@@ -58357,11 +58508,6 @@ var StorePacksSection = function StorePacksSection(_ref) {
|
|
|
58357
58508
|
}
|
|
58358
58509
|
});
|
|
58359
58510
|
}, [onSelectPack, renderPackFooter]);
|
|
58360
|
-
var filteredPacks = React.useMemo(function () {
|
|
58361
|
-
return packs.filter(function (pack) {
|
|
58362
|
-
return pack.title.toLowerCase().includes(searchQuery.toLowerCase());
|
|
58363
|
-
});
|
|
58364
|
-
}, [packs, searchQuery]);
|
|
58365
58511
|
return React__default.createElement(ScrollableContent, {
|
|
58366
58512
|
items: filteredPacks,
|
|
58367
58513
|
renderItem: renderPack,
|
|
@@ -58460,7 +58606,7 @@ var Store = function Store(_ref) {
|
|
|
58460
58606
|
packs = _ref$packs === void 0 ? [] : _ref$packs,
|
|
58461
58607
|
atlasJSON = _ref.atlasJSON,
|
|
58462
58608
|
atlasIMG = _ref.atlasIMG,
|
|
58463
|
-
|
|
58609
|
+
_onPurchase2 = _ref.onPurchase,
|
|
58464
58610
|
onShowHistory = _ref.onShowHistory,
|
|
58465
58611
|
userAccountType = _ref.userAccountType,
|
|
58466
58612
|
_ref$loading = _ref.loading,
|
|
@@ -58505,29 +58651,35 @@ var Store = function Store(_ref) {
|
|
|
58505
58651
|
setCurrentMetadataItem = _useState4[1];
|
|
58506
58652
|
var handleAddPackToCart = function handleAddPackToCart(pack) {
|
|
58507
58653
|
var packItem = {
|
|
58508
|
-
_id: pack.key,
|
|
58509
58654
|
key: pack.key,
|
|
58510
58655
|
name: pack.title,
|
|
58656
|
+
description: pack.description || '',
|
|
58511
58657
|
price: pack.priceUSD,
|
|
58658
|
+
currency: shared.PaymentCurrency.USD,
|
|
58512
58659
|
texturePath: pack.image["default"] || pack.image.src,
|
|
58513
|
-
|
|
58514
|
-
|
|
58515
|
-
|
|
58516
|
-
|
|
58517
|
-
|
|
58518
|
-
|
|
58519
|
-
|
|
58660
|
+
type: shared.PurchaseType.Pack,
|
|
58661
|
+
onPurchase: function () {
|
|
58662
|
+
var _onPurchase = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
58663
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
58664
|
+
while (1) switch (_context.prev = _context.next) {
|
|
58665
|
+
case 0:
|
|
58666
|
+
case "end":
|
|
58667
|
+
return _context.stop();
|
|
58668
|
+
}
|
|
58669
|
+
}, _callee);
|
|
58670
|
+
}));
|
|
58671
|
+
function onPurchase() {
|
|
58672
|
+
return _onPurchase.apply(this, arguments);
|
|
58673
|
+
}
|
|
58674
|
+
return onPurchase;
|
|
58675
|
+
}(),
|
|
58676
|
+
itemType: shared.ItemType.Consumable,
|
|
58677
|
+
itemSubType: shared.ItemSubType.Other,
|
|
58520
58678
|
rarity: shared.ItemRarities.Common,
|
|
58521
|
-
|
|
58522
|
-
isEquipable: false,
|
|
58679
|
+
weight: 0,
|
|
58523
58680
|
isStackable: false,
|
|
58524
|
-
isTwoHanded: false,
|
|
58525
|
-
hasUseWith: false,
|
|
58526
58681
|
maxStackSize: 1,
|
|
58527
|
-
isUsable: false
|
|
58528
|
-
isStorable: true,
|
|
58529
|
-
isSolid: false,
|
|
58530
|
-
isItemContainer: false
|
|
58682
|
+
isUsable: false
|
|
58531
58683
|
};
|
|
58532
58684
|
handleAddToCart(packItem, 1);
|
|
58533
58685
|
};
|
|
@@ -58633,22 +58785,22 @@ var Store = function Store(_ref) {
|
|
|
58633
58785
|
onRemoveFromCart: handleRemoveFromCart,
|
|
58634
58786
|
onClose: closeCart,
|
|
58635
58787
|
onPurchase: function () {
|
|
58636
|
-
var
|
|
58637
|
-
return _regeneratorRuntime().wrap(function
|
|
58638
|
-
while (1) switch (
|
|
58788
|
+
var _onPurchase3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
58789
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
58790
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
58639
58791
|
case 0:
|
|
58640
|
-
|
|
58641
|
-
return handleCartPurchase(
|
|
58792
|
+
_context2.next = 2;
|
|
58793
|
+
return handleCartPurchase(_onPurchase2);
|
|
58642
58794
|
case 2:
|
|
58643
|
-
return
|
|
58795
|
+
return _context2.abrupt("return", true);
|
|
58644
58796
|
case 3:
|
|
58645
58797
|
case "end":
|
|
58646
|
-
return
|
|
58798
|
+
return _context2.stop();
|
|
58647
58799
|
}
|
|
58648
|
-
},
|
|
58800
|
+
}, _callee2);
|
|
58649
58801
|
}));
|
|
58650
58802
|
function onPurchase() {
|
|
58651
|
-
return
|
|
58803
|
+
return _onPurchase3.apply(this, arguments);
|
|
58652
58804
|
}
|
|
58653
58805
|
return onPurchase;
|
|
58654
58806
|
}(),
|