@rpg-engine/long-bow 0.8.69 → 0.8.71
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/Store.d.ts +6 -0
- package/dist/components/Store/StoreItemRow.d.ts +1 -0
- package/dist/components/Store/sections/StoreItemsSection.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +158 -132
- 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 +158 -132
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Store/CartView.tsx +11 -0
- package/src/components/Store/Store.tsx +32 -8
- package/src/components/Store/StoreCharacterSkinRow.tsx +37 -125
- package/src/components/Store/StoreItemRow.tsx +33 -3
- package/src/components/Store/__test__/MetadataCollector.spec.tsx +2 -1
- package/src/components/Store/__test__/useStoreMetadata.spec.tsx +10 -10
- package/src/components/Store/sections/StoreItemsSection.tsx +18 -3
- package/src/stories/Features/store/Store.stories.tsx +4 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -57512,7 +57512,7 @@ var CartView = function CartView(_ref2) {
|
|
|
57512
57512
|
return React.createElement(Container$K, null, React.createElement(Header$7, null, React.createElement(Title$e, null, "Shopping Cart"), React.createElement(CloseButton$9, {
|
|
57513
57513
|
onPointerDown: onClose
|
|
57514
57514
|
}, React.createElement(FaTimes, null))), React.createElement(CartItems, null, cartItems.length === 0 ? React.createElement(EmptyCart, null, "Your cart is empty") : cartItems.map(function (cartItem) {
|
|
57515
|
-
var _cartItem$metadata;
|
|
57515
|
+
var _cartItem$metadata, _cartItem$metadata2;
|
|
57516
57516
|
console.log('Item metadataType: , texturePath:', cartItem.item.metadataType, cartItem.item.texturePath);
|
|
57517
57517
|
var getSpriteKey = function getSpriteKey(textureKey) {
|
|
57518
57518
|
return textureKey + '/down/standing/0.png';
|
|
@@ -57527,7 +57527,7 @@ var CartView = function CartView(_ref2) {
|
|
|
57527
57527
|
height: 32,
|
|
57528
57528
|
imgScale: 2,
|
|
57529
57529
|
centered: true
|
|
57530
|
-
})), React.createElement(ItemDetails, null, React.createElement(ItemName, null, cartItem.item.name), React.createElement(ItemInfo$1, null, React.createElement("span", null, "$", formatPrice(cartItem.item.price)), React.createElement("span", null, "\xD7"), React.createElement("span", null, cartItem.quantity), React.createElement("span", null, "="), React.createElement("span", null, "$", formatPrice(cartItem.item.price * cartItem.quantity))), cartItem.metadata && cartItem.item.metadataType && React.createElement(MetadataDisplay, {
|
|
57530
|
+
})), React.createElement(ItemDetails, null, React.createElement(ItemName, null, cartItem.item.name), ((_cartItem$metadata2 = cartItem.metadata) == null ? void 0 : _cartItem$metadata2.inputValue) && React.createElement(CartMeta, null, cartItem.metadata.inputValue), React.createElement(ItemInfo$1, null, React.createElement("span", null, "$", formatPrice(cartItem.item.price)), React.createElement("span", null, "\xD7"), React.createElement("span", null, cartItem.quantity), React.createElement("span", null, "="), React.createElement("span", null, "$", formatPrice(cartItem.item.price * cartItem.quantity))), cartItem.metadata && cartItem.item.metadataType && React.createElement(MetadataDisplay, {
|
|
57531
57531
|
type: cartItem.item.metadataType,
|
|
57532
57532
|
metadata: cartItem.metadata
|
|
57533
57533
|
})), React.createElement(CTAButton, {
|
|
@@ -57617,6 +57617,10 @@ var MetadataValue = /*#__PURE__*/styled.div.withConfig({
|
|
|
57617
57617
|
displayName: "CartView__MetadataValue",
|
|
57618
57618
|
componentId: "sc-ydtyl1-17"
|
|
57619
57619
|
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
57620
|
+
var CartMeta = /*#__PURE__*/styled.div.withConfig({
|
|
57621
|
+
displayName: "CartView__CartMeta",
|
|
57622
|
+
componentId: "sc-ydtyl1-18"
|
|
57623
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.75rem;color:#ffffff;opacity:0.8;margin-top:0.25rem;"]);
|
|
57620
57624
|
|
|
57621
57625
|
var useStoreMetadata = function useStoreMetadata() {
|
|
57622
57626
|
var _useState = useState(false),
|
|
@@ -57962,12 +57966,9 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
57962
57966
|
atlasIMG = _ref.atlasIMG,
|
|
57963
57967
|
onAddToCart = _ref.onAddToCart,
|
|
57964
57968
|
userAccountType = _ref.userAccountType;
|
|
57965
|
-
var _useState = useState(
|
|
57966
|
-
|
|
57967
|
-
|
|
57968
|
-
var _useState2 = useState(0),
|
|
57969
|
-
currentIndex = _useState2[0],
|
|
57970
|
-
setCurrentIndex = _useState2[1];
|
|
57969
|
+
var _useState = useState(0),
|
|
57970
|
+
currentIndex = _useState[0],
|
|
57971
|
+
setCurrentIndex = _useState[1];
|
|
57971
57972
|
// Get available characters from metadata
|
|
57972
57973
|
var availableCharacters = item.metadataType === MetadataType.CharacterSkin && ((_item$metadataConfig = item.metadataConfig) == null ? void 0 : _item$metadataConfig.availableCharacters) || [];
|
|
57973
57974
|
// Get the active character entity atlas info
|
|
@@ -57977,24 +57978,6 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
57977
57978
|
useEffect(function () {
|
|
57978
57979
|
setCurrentIndex(0);
|
|
57979
57980
|
}, [item._id]);
|
|
57980
|
-
var handleQuantityChange = function handleQuantityChange(e) {
|
|
57981
|
-
var value = parseInt(e.target.value) || 1;
|
|
57982
|
-
setQuantity(Math.min(Math.max(1, value), 99));
|
|
57983
|
-
};
|
|
57984
|
-
var handleBlur = function handleBlur() {
|
|
57985
|
-
if (quantity < 1) setQuantity(1);
|
|
57986
|
-
if (quantity > 99) setQuantity(99);
|
|
57987
|
-
};
|
|
57988
|
-
var incrementQuantity = function incrementQuantity() {
|
|
57989
|
-
setQuantity(function (prev) {
|
|
57990
|
-
return Math.min(prev + 1, 99);
|
|
57991
|
-
});
|
|
57992
|
-
};
|
|
57993
|
-
var decrementQuantity = function decrementQuantity() {
|
|
57994
|
-
setQuantity(function (prev) {
|
|
57995
|
-
return Math.max(1, prev - 1);
|
|
57996
|
-
});
|
|
57997
|
-
};
|
|
57998
57981
|
var handlePreviousSkin = function handlePreviousSkin() {
|
|
57999
57982
|
setCurrentIndex(function (prevIndex) {
|
|
58000
57983
|
return prevIndex === 0 ? availableCharacters.length - 1 : prevIndex - 1;
|
|
@@ -58008,26 +57991,21 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
58008
57991
|
var hasRequiredAccount = !((_item$requiredAccount = item.requiredAccountType) != null && _item$requiredAccount.length) || item.requiredAccountType.includes(userAccountType);
|
|
58009
57992
|
var handleAddToCart = function handleAddToCart() {
|
|
58010
57993
|
if (!hasRequiredAccount) return;
|
|
58011
|
-
//
|
|
57994
|
+
// Always use a quantity of 1
|
|
58012
57995
|
if (availableCharacters.length > 0 && currentCharacter) {
|
|
58013
|
-
onAddToCart(item,
|
|
57996
|
+
onAddToCart(item, 1, {
|
|
58014
57997
|
selectedSkinName: currentCharacter.name,
|
|
58015
57998
|
selectedSkinTextureKey: currentCharacter.textureKey
|
|
58016
57999
|
});
|
|
58017
58000
|
} else {
|
|
58018
|
-
onAddToCart(item,
|
|
58001
|
+
onAddToCart(item, 1);
|
|
58019
58002
|
}
|
|
58020
|
-
setQuantity(1); // Reset quantity after adding to cart
|
|
58021
58003
|
};
|
|
58022
58004
|
var getSpriteKey = function getSpriteKey(textureKey) {
|
|
58023
58005
|
return textureKey + '/down/standing/0.png';
|
|
58024
58006
|
};
|
|
58025
58007
|
var currentCharacter = availableCharacters[currentIndex];
|
|
58026
|
-
return React.createElement(ItemWrapper, null, React.createElement(ItemIconContainer$2, null,
|
|
58027
|
-
direction: "left",
|
|
58028
|
-
onPointerDown: handlePreviousSkin,
|
|
58029
|
-
size: 24
|
|
58030
|
-
}), React.createElement(SpriteContainer$5, null, React.createElement(ErrorBoundary, null, React.createElement(SpriteFromAtlas, {
|
|
58008
|
+
return React.createElement(ItemWrapper, null, React.createElement(ItemIconContainer$2, null, entityAtlasJSON && entityAtlasIMG && currentCharacter ? React.createElement(SpriteFromAtlas, {
|
|
58031
58009
|
atlasJSON: entityAtlasJSON,
|
|
58032
58010
|
atlasIMG: entityAtlasIMG,
|
|
58033
58011
|
spriteKey: getSpriteKey(currentCharacter.textureKey),
|
|
@@ -58035,11 +58013,7 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
58035
58013
|
height: 32,
|
|
58036
58014
|
imgScale: 2,
|
|
58037
58015
|
centered: true
|
|
58038
|
-
})
|
|
58039
|
-
direction: "right",
|
|
58040
|
-
onPointerDown: handleNextSkin,
|
|
58041
|
-
size: 24
|
|
58042
|
-
})) : React.createElement(SpriteFromAtlas, {
|
|
58016
|
+
}) : React.createElement(SpriteFromAtlas, {
|
|
58043
58017
|
atlasJSON: atlasJSON,
|
|
58044
58018
|
atlasIMG: atlasIMG,
|
|
58045
58019
|
spriteKey: item.texturePath,
|
|
@@ -58047,23 +58021,15 @@ var StoreCharacterSkinRow = function StoreCharacterSkinRow(_ref) {
|
|
|
58047
58021
|
height: 32,
|
|
58048
58022
|
imgScale: 2,
|
|
58049
58023
|
centered: true
|
|
58050
|
-
})), React.createElement(ItemDetails$1, null, React.createElement(ItemName$1, null, item.name), availableCharacters.length > 0 && currentCharacter && React.createElement(
|
|
58024
|
+
})), React.createElement(ItemDetails$1, null, React.createElement(Header$8, null, React.createElement(ItemName$1, null, item.name)), availableCharacters.length > 0 && currentCharacter && React.createElement(SelectedSkinNav, null, React.createElement(SelectedSkin, null, "Selected:"), React.createElement(SkinNavArrow, {
|
|
58051
58025
|
direction: "left",
|
|
58052
|
-
onPointerDown:
|
|
58026
|
+
onPointerDown: handlePreviousSkin,
|
|
58053
58027
|
size: 24
|
|
58054
|
-
}), React.createElement(
|
|
58055
|
-
type: "number",
|
|
58056
|
-
value: quantity,
|
|
58057
|
-
onChange: handleQuantityChange,
|
|
58058
|
-
onBlur: handleBlur,
|
|
58059
|
-
min: 1,
|
|
58060
|
-
max: 99,
|
|
58061
|
-
className: "rpgui-input"
|
|
58062
|
-
}), React.createElement(SelectArrow, {
|
|
58028
|
+
}), React.createElement(SelectedSkin, null, currentCharacter.name), React.createElement(SkinNavArrow, {
|
|
58063
58029
|
direction: "right",
|
|
58064
|
-
onPointerDown:
|
|
58030
|
+
onPointerDown: handleNextSkin,
|
|
58065
58031
|
size: 24
|
|
58066
|
-
})), React.createElement(CTAButton, {
|
|
58032
|
+
})), React.createElement(ItemPrice, null, "$", item.price)), React.createElement(Controls, null, React.createElement(CTAButton, {
|
|
58067
58033
|
icon: React.createElement(FaCartPlus, null),
|
|
58068
58034
|
label: "Add",
|
|
58069
58035
|
onClick: handleAddToCart,
|
|
@@ -58077,47 +58043,40 @@ var ItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
58077
58043
|
var ItemIconContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
58078
58044
|
displayName: "StoreCharacterSkinRow__ItemIconContainer",
|
|
58079
58045
|
componentId: "sc-81xqsx-1"
|
|
58080
|
-
})(["
|
|
58081
|
-
var CharacterSkinPreviewContainer = /*#__PURE__*/styled.div.withConfig({
|
|
58082
|
-
displayName: "StoreCharacterSkinRow__CharacterSkinPreviewContainer",
|
|
58083
|
-
componentId: "sc-81xqsx-2"
|
|
58084
|
-
})(["position:relative;display:flex;align-items:center;width:140px;height:42px;justify-content:space-between;"]);
|
|
58085
|
-
var SpriteContainer$5 = /*#__PURE__*/styled.div.withConfig({
|
|
58086
|
-
displayName: "StoreCharacterSkinRow__SpriteContainer",
|
|
58087
|
-
componentId: "sc-81xqsx-3"
|
|
58088
|
-
})(["display:flex;align-items:center;justify-content:center;position:absolute;left:50%;transform:translateX(-50%);"]);
|
|
58089
|
-
var NavArrow = /*#__PURE__*/styled(SelectArrow).withConfig({
|
|
58090
|
-
displayName: "StoreCharacterSkinRow__NavArrow",
|
|
58091
|
-
componentId: "sc-81xqsx-4"
|
|
58092
|
-
})(["z-index:2;"]);
|
|
58046
|
+
})(["width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;padding:4px;"]);
|
|
58093
58047
|
var ItemDetails$1 = /*#__PURE__*/styled.div.withConfig({
|
|
58094
58048
|
displayName: "StoreCharacterSkinRow__ItemDetails",
|
|
58095
|
-
componentId: "sc-81xqsx-
|
|
58049
|
+
componentId: "sc-81xqsx-2"
|
|
58096
58050
|
})(["flex:1;display:flex;flex-direction:column;gap:0.5rem;"]);
|
|
58097
58051
|
var ItemName$1 = /*#__PURE__*/styled.div.withConfig({
|
|
58098
58052
|
displayName: "StoreCharacterSkinRow__ItemName",
|
|
58099
|
-
componentId: "sc-81xqsx-
|
|
58053
|
+
componentId: "sc-81xqsx-3"
|
|
58100
58054
|
})(["font-family:'Press Start 2P',cursive;font-size:0.875rem;color:#ffffff;"]);
|
|
58101
58055
|
var SelectedSkin = /*#__PURE__*/styled.div.withConfig({
|
|
58102
58056
|
displayName: "StoreCharacterSkinRow__SelectedSkin",
|
|
58103
|
-
componentId: "sc-81xqsx-
|
|
58057
|
+
componentId: "sc-81xqsx-4"
|
|
58104
58058
|
})(["font-family:'Press Start 2P',cursive;font-size:0.65rem;color:#fef08a;"]);
|
|
58105
58059
|
var ItemPrice = /*#__PURE__*/styled.div.withConfig({
|
|
58106
58060
|
displayName: "StoreCharacterSkinRow__ItemPrice",
|
|
58107
|
-
componentId: "sc-81xqsx-
|
|
58061
|
+
componentId: "sc-81xqsx-5"
|
|
58108
58062
|
})(["font-family:'Press Start 2P',cursive;font-size:0.75rem;color:#fef08a;"]);
|
|
58109
58063
|
var Controls = /*#__PURE__*/styled.div.withConfig({
|
|
58110
58064
|
displayName: "StoreCharacterSkinRow__Controls",
|
|
58111
|
-
componentId: "sc-81xqsx-
|
|
58065
|
+
componentId: "sc-81xqsx-6"
|
|
58112
58066
|
})(["display:flex;align-items:center;gap:1rem;min-width:fit-content;"]);
|
|
58113
|
-
|
|
58114
|
-
|
|
58115
|
-
|
|
58116
|
-
|
|
58117
|
-
|
|
58118
|
-
|
|
58119
|
-
|
|
58120
|
-
|
|
58067
|
+
// Styled arrow override for inline nav arrows
|
|
58068
|
+
var SkinNavArrow = /*#__PURE__*/styled(SelectArrow).withConfig({
|
|
58069
|
+
displayName: "StoreCharacterSkinRow__SkinNavArrow",
|
|
58070
|
+
componentId: "sc-81xqsx-7"
|
|
58071
|
+
})(["position:static;"]);
|
|
58072
|
+
var Header$8 = /*#__PURE__*/styled.div.withConfig({
|
|
58073
|
+
displayName: "StoreCharacterSkinRow__Header",
|
|
58074
|
+
componentId: "sc-81xqsx-8"
|
|
58075
|
+
})(["display:flex;align-items:center;gap:0.5rem;"]);
|
|
58076
|
+
var SelectedSkinNav = /*#__PURE__*/styled.div.withConfig({
|
|
58077
|
+
displayName: "StoreCharacterSkinRow__SelectedSkinNav",
|
|
58078
|
+
componentId: "sc-81xqsx-9"
|
|
58079
|
+
})(["display:flex;align-items:center;gap:0.5rem;"]);
|
|
58121
58080
|
|
|
58122
58081
|
var StoreItemRow = function StoreItemRow(_ref) {
|
|
58123
58082
|
var _item$requiredAccount;
|
|
@@ -58125,10 +58084,15 @@ var StoreItemRow = function StoreItemRow(_ref) {
|
|
|
58125
58084
|
atlasJSON = _ref.atlasJSON,
|
|
58126
58085
|
atlasIMG = _ref.atlasIMG,
|
|
58127
58086
|
onAddToCart = _ref.onAddToCart,
|
|
58128
|
-
userAccountType = _ref.userAccountType
|
|
58087
|
+
userAccountType = _ref.userAccountType,
|
|
58088
|
+
_ref$showTextInput = _ref.showTextInput,
|
|
58089
|
+
showTextInput = _ref$showTextInput === void 0 ? false : _ref$showTextInput;
|
|
58129
58090
|
var _useState = useState(1),
|
|
58130
58091
|
quantity = _useState[0],
|
|
58131
58092
|
setQuantity = _useState[1];
|
|
58093
|
+
var _useState2 = useState(''),
|
|
58094
|
+
textInputValue = _useState2[0],
|
|
58095
|
+
setTextInputValue = _useState2[1];
|
|
58132
58096
|
var handleQuantityChange = function handleQuantityChange(e) {
|
|
58133
58097
|
var value = parseInt(e.target.value) || 1;
|
|
58134
58098
|
setQuantity(Math.min(Math.max(1, value), 99));
|
|
@@ -58148,10 +58112,17 @@ var StoreItemRow = function StoreItemRow(_ref) {
|
|
|
58148
58112
|
});
|
|
58149
58113
|
};
|
|
58150
58114
|
var hasRequiredAccount = !((_item$requiredAccount = item.requiredAccountType) != null && _item$requiredAccount.length) || item.requiredAccountType.includes(userAccountType);
|
|
58151
|
-
var
|
|
58115
|
+
var handleAddToCartInternal = function handleAddToCartInternal() {
|
|
58152
58116
|
if (!hasRequiredAccount) return;
|
|
58153
|
-
|
|
58154
|
-
|
|
58117
|
+
if (showTextInput) {
|
|
58118
|
+
onAddToCart(item, 1, {
|
|
58119
|
+
inputValue: textInputValue
|
|
58120
|
+
});
|
|
58121
|
+
setTextInputValue('');
|
|
58122
|
+
} else {
|
|
58123
|
+
onAddToCart(item, quantity);
|
|
58124
|
+
setQuantity(1);
|
|
58125
|
+
}
|
|
58155
58126
|
};
|
|
58156
58127
|
return React.createElement(ItemWrapper$1, null, React.createElement(ItemIconContainer$3, null, React.createElement(SpriteFromAtlas, {
|
|
58157
58128
|
atlasJSON: atlasJSON,
|
|
@@ -58161,11 +58132,19 @@ var StoreItemRow = function StoreItemRow(_ref) {
|
|
|
58161
58132
|
height: 32,
|
|
58162
58133
|
imgScale: 2,
|
|
58163
58134
|
centered: true
|
|
58164
|
-
})), React.createElement(ItemDetails$2, null, React.createElement(ItemName$2, null, item.name), React.createElement(ItemPrice$1, null, "$", item.price)), React.createElement(Controls$1, null,
|
|
58135
|
+
})), React.createElement(ItemDetails$2, null, React.createElement(ItemName$2, null, item.name), React.createElement(ItemPrice$1, null, "$", item.price)), React.createElement(Controls$1, null, showTextInput ? React.createElement(TextInput, {
|
|
58136
|
+
type: "text",
|
|
58137
|
+
value: textInputValue,
|
|
58138
|
+
placeholder: "Enter value",
|
|
58139
|
+
onChange: function onChange(e) {
|
|
58140
|
+
return setTextInputValue(e.target.value);
|
|
58141
|
+
},
|
|
58142
|
+
className: "rpgui-input"
|
|
58143
|
+
}) : item.isStackable ? React.createElement(ArrowsContainer, null, React.createElement(SelectArrow, {
|
|
58165
58144
|
direction: "left",
|
|
58166
58145
|
onPointerDown: decrementQuantity,
|
|
58167
58146
|
size: 24
|
|
58168
|
-
}), React.createElement(QuantityInput
|
|
58147
|
+
}), React.createElement(QuantityInput, {
|
|
58169
58148
|
type: "number",
|
|
58170
58149
|
value: quantity,
|
|
58171
58150
|
onChange: handleQuantityChange,
|
|
@@ -58177,10 +58156,10 @@ var StoreItemRow = function StoreItemRow(_ref) {
|
|
|
58177
58156
|
direction: "right",
|
|
58178
58157
|
onPointerDown: incrementQuantity,
|
|
58179
58158
|
size: 24
|
|
58180
|
-
})), React.createElement(CTAButton, {
|
|
58159
|
+
})) : null, React.createElement(CTAButton, {
|
|
58181
58160
|
icon: React.createElement(FaCartPlus, null),
|
|
58182
58161
|
label: "Add",
|
|
58183
|
-
onClick:
|
|
58162
|
+
onClick: handleAddToCartInternal,
|
|
58184
58163
|
disabled: !hasRequiredAccount
|
|
58185
58164
|
})));
|
|
58186
58165
|
};
|
|
@@ -58208,21 +58187,27 @@ var Controls$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
58208
58187
|
displayName: "StoreItemRow__Controls",
|
|
58209
58188
|
componentId: "sc-ptotuo-5"
|
|
58210
58189
|
})(["display:flex;align-items:center;gap:1rem;min-width:fit-content;"]);
|
|
58211
|
-
var ArrowsContainer
|
|
58190
|
+
var ArrowsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
58212
58191
|
displayName: "StoreItemRow__ArrowsContainer",
|
|
58213
58192
|
componentId: "sc-ptotuo-6"
|
|
58214
58193
|
})(["position:relative;display:flex;align-items:center;width:120px;height:42px;justify-content:space-between;"]);
|
|
58215
|
-
var QuantityInput
|
|
58194
|
+
var QuantityInput = /*#__PURE__*/styled.input.withConfig({
|
|
58216
58195
|
displayName: "StoreItemRow__QuantityInput",
|
|
58217
58196
|
componentId: "sc-ptotuo-7"
|
|
58218
58197
|
})(["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;}"]);
|
|
58198
|
+
var TextInput = /*#__PURE__*/styled.input.withConfig({
|
|
58199
|
+
displayName: "StoreItemRow__TextInput",
|
|
58200
|
+
componentId: "sc-ptotuo-8"
|
|
58201
|
+
})(["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;"]);
|
|
58219
58202
|
|
|
58220
58203
|
var StoreItemsSection = function StoreItemsSection(_ref) {
|
|
58221
58204
|
var items = _ref.items,
|
|
58222
58205
|
onAddToCart = _ref.onAddToCart,
|
|
58223
58206
|
atlasJSON = _ref.atlasJSON,
|
|
58224
58207
|
atlasIMG = _ref.atlasIMG,
|
|
58225
|
-
userAccountType = _ref.userAccountType
|
|
58208
|
+
userAccountType = _ref.userAccountType,
|
|
58209
|
+
_ref$textInputItemKey = _ref.textInputItemKeys,
|
|
58210
|
+
textInputItemKeys = _ref$textInputItemKey === void 0 ? [] : _ref$textInputItemKey;
|
|
58226
58211
|
var _useState = useState(''),
|
|
58227
58212
|
searchQuery = _useState[0],
|
|
58228
58213
|
setSearchQuery = _useState[1];
|
|
@@ -58230,7 +58215,7 @@ var StoreItemsSection = function StoreItemsSection(_ref) {
|
|
|
58230
58215
|
return item.name.toLowerCase().includes(searchQuery.toLowerCase());
|
|
58231
58216
|
});
|
|
58232
58217
|
var renderStoreItem = function renderStoreItem(item) {
|
|
58233
|
-
//
|
|
58218
|
+
// Prefer a specialized character skin row when needed
|
|
58234
58219
|
if (item.metadataType === MetadataType.CharacterSkin) {
|
|
58235
58220
|
return React.createElement(StoreCharacterSkinRow, {
|
|
58236
58221
|
key: item._id,
|
|
@@ -58241,7 +58226,19 @@ var StoreItemsSection = function StoreItemsSection(_ref) {
|
|
|
58241
58226
|
userAccountType: userAccountType || UserAccountTypes.Free
|
|
58242
58227
|
});
|
|
58243
58228
|
}
|
|
58244
|
-
//
|
|
58229
|
+
// Render text input row when configured for this item key
|
|
58230
|
+
if (textInputItemKeys.includes(item.key) || textInputItemKeys.includes(item._id)) {
|
|
58231
|
+
return React.createElement(StoreItemRow, {
|
|
58232
|
+
key: item._id,
|
|
58233
|
+
item: item,
|
|
58234
|
+
atlasJSON: atlasJSON,
|
|
58235
|
+
atlasIMG: atlasIMG,
|
|
58236
|
+
onAddToCart: onAddToCart,
|
|
58237
|
+
userAccountType: userAccountType || UserAccountTypes.Free,
|
|
58238
|
+
showTextInput: true
|
|
58239
|
+
});
|
|
58240
|
+
}
|
|
58241
|
+
// Fallback to standard arrow-based row
|
|
58245
58242
|
return React.createElement(StoreItemRow, {
|
|
58246
58243
|
key: item._id,
|
|
58247
58244
|
item: item,
|
|
@@ -58395,7 +58392,7 @@ var StoreItemDetails = function StoreItemDetails(_ref) {
|
|
|
58395
58392
|
if (typeof imageUrl === 'string') return imageUrl;
|
|
58396
58393
|
return imageUrl["default"] || imageUrl.src;
|
|
58397
58394
|
};
|
|
58398
|
-
return React.createElement(Container$M, null, React.createElement(Header$
|
|
58395
|
+
return React.createElement(Container$M, null, React.createElement(Header$9, null, React.createElement(BackButton, {
|
|
58399
58396
|
onClick: onBack
|
|
58400
58397
|
}, React.createElement(FaArrowLeft, null), React.createElement("span", null, "Back"))), React.createElement(Content$5, null, React.createElement(DetailsGrid, null, React.createElement(ItemIcon, null, React.createElement("img", {
|
|
58401
58398
|
src: getImageSrc(),
|
|
@@ -58413,7 +58410,7 @@ var Container$M = /*#__PURE__*/styled.div.withConfig({
|
|
|
58413
58410
|
displayName: "StoreItemDetails__Container",
|
|
58414
58411
|
componentId: "sc-k3ho5z-0"
|
|
58415
58412
|
})(["display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;height:100%;"]);
|
|
58416
|
-
var Header$
|
|
58413
|
+
var Header$9 = /*#__PURE__*/styled.div.withConfig({
|
|
58417
58414
|
displayName: "StoreItemDetails__Header",
|
|
58418
58415
|
componentId: "sc-k3ho5z-1"
|
|
58419
58416
|
})(["display:flex;align-items:center;gap:1rem;"]);
|
|
@@ -58466,11 +58463,25 @@ var Store = function Store(_ref) {
|
|
|
58466
58463
|
_ref$loading = _ref.loading,
|
|
58467
58464
|
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
58468
58465
|
error = _ref.error,
|
|
58469
|
-
onClose = _ref.onClose
|
|
58466
|
+
onClose = _ref.onClose,
|
|
58467
|
+
_ref$hidePremiumTab = _ref.hidePremiumTab,
|
|
58468
|
+
hidePremiumTab = _ref$hidePremiumTab === void 0 ? false : _ref$hidePremiumTab,
|
|
58469
|
+
tabOrder = _ref.tabOrder,
|
|
58470
|
+
defaultActiveTab = _ref.defaultActiveTab,
|
|
58471
|
+
_ref$textInputItemKey = _ref.textInputItemKeys,
|
|
58472
|
+
textInputItemKeys = _ref$textInputItemKey === void 0 ? [] : _ref$textInputItemKey;
|
|
58470
58473
|
var _useState = useState(null),
|
|
58471
58474
|
selectedPack = _useState[0],
|
|
58472
58475
|
setSelectedPack = _useState[1];
|
|
58473
|
-
var _useState2 = useState(
|
|
58476
|
+
var _useState2 = useState(function () {
|
|
58477
|
+
var initialTabs = (tabOrder != null ? tabOrder : ['premium', 'packs', 'items']).filter(function (id) {
|
|
58478
|
+
return !(hidePremiumTab && id === 'premium');
|
|
58479
|
+
});
|
|
58480
|
+
if (defaultActiveTab && initialTabs.includes(defaultActiveTab)) {
|
|
58481
|
+
return defaultActiveTab;
|
|
58482
|
+
}
|
|
58483
|
+
return hidePremiumTab ? 'items' : 'premium';
|
|
58484
|
+
}),
|
|
58474
58485
|
activeTab = _useState2[0],
|
|
58475
58486
|
setActiveTab = _useState2[1];
|
|
58476
58487
|
var _useStoreCart = useStoreCart(),
|
|
@@ -58557,37 +58568,50 @@ var Store = function Store(_ref) {
|
|
|
58557
58568
|
if (error) {
|
|
58558
58569
|
return React.createElement(ErrorMessage$2, null, error);
|
|
58559
58570
|
}
|
|
58560
|
-
|
|
58561
|
-
|
|
58562
|
-
|
|
58563
|
-
|
|
58564
|
-
|
|
58565
|
-
|
|
58566
|
-
|
|
58567
|
-
|
|
58568
|
-
|
|
58569
|
-
|
|
58570
|
-
|
|
58571
|
-
|
|
58572
|
-
|
|
58573
|
-
|
|
58574
|
-
|
|
58575
|
-
|
|
58576
|
-
|
|
58577
|
-
|
|
58578
|
-
|
|
58579
|
-
|
|
58580
|
-
|
|
58581
|
-
|
|
58582
|
-
|
|
58583
|
-
|
|
58584
|
-
|
|
58585
|
-
|
|
58586
|
-
|
|
58587
|
-
|
|
58588
|
-
|
|
58589
|
-
|
|
58590
|
-
|
|
58571
|
+
// Build tabs dynamically based on props
|
|
58572
|
+
var tabIds = tabOrder != null ? tabOrder : ['premium', 'packs', 'items'];
|
|
58573
|
+
var availableTabIds = tabIds.filter(function (id) {
|
|
58574
|
+
return !(hidePremiumTab && id === 'premium');
|
|
58575
|
+
});
|
|
58576
|
+
var tabsMap = {
|
|
58577
|
+
premium: {
|
|
58578
|
+
id: 'premium',
|
|
58579
|
+
title: 'Premium',
|
|
58580
|
+
content: React.createElement(StorePacksSection, {
|
|
58581
|
+
packs: packs.filter(function (pack) {
|
|
58582
|
+
return pack.priceUSD >= 9.99;
|
|
58583
|
+
}),
|
|
58584
|
+
onAddToCart: handleAddPackToCart,
|
|
58585
|
+
onSelectPack: setSelectedPack
|
|
58586
|
+
})
|
|
58587
|
+
},
|
|
58588
|
+
packs: {
|
|
58589
|
+
id: 'packs',
|
|
58590
|
+
title: 'Packs',
|
|
58591
|
+
content: React.createElement(StorePacksSection, {
|
|
58592
|
+
packs: packs.filter(function (pack) {
|
|
58593
|
+
return pack.priceUSD < 9.99;
|
|
58594
|
+
}),
|
|
58595
|
+
onAddToCart: handleAddPackToCart,
|
|
58596
|
+
onSelectPack: setSelectedPack
|
|
58597
|
+
})
|
|
58598
|
+
},
|
|
58599
|
+
items: {
|
|
58600
|
+
id: 'items',
|
|
58601
|
+
title: 'Items',
|
|
58602
|
+
content: React.createElement(StoreItemsSection, {
|
|
58603
|
+
items: filteredItems.items,
|
|
58604
|
+
onAddToCart: handleAddToCart,
|
|
58605
|
+
atlasJSON: atlasJSON,
|
|
58606
|
+
atlasIMG: atlasIMG,
|
|
58607
|
+
userAccountType: userAccountType,
|
|
58608
|
+
textInputItemKeys: textInputItemKeys
|
|
58609
|
+
})
|
|
58610
|
+
}
|
|
58611
|
+
};
|
|
58612
|
+
var tabs = availableTabIds.map(function (id) {
|
|
58613
|
+
return tabsMap[id];
|
|
58614
|
+
});
|
|
58591
58615
|
return React.createElement(DraggableContainer, {
|
|
58592
58616
|
title: "Store",
|
|
58593
58617
|
onCloseButton: onClose,
|
|
@@ -58655,7 +58679,9 @@ var Store = function Store(_ref) {
|
|
|
58655
58679
|
borderColor: "#f59e0b",
|
|
58656
58680
|
hoverColor: "#fef3c7",
|
|
58657
58681
|
activeTab: activeTab,
|
|
58658
|
-
onTabChange:
|
|
58682
|
+
onTabChange: function onTabChange(tabId) {
|
|
58683
|
+
return setActiveTab(tabId);
|
|
58684
|
+
}
|
|
58659
58685
|
})), cartItems.length > 0 && React.createElement(Footer$2, null, React.createElement(CartSummary, null, React.createElement(CartInfo, null, React.createElement("span", null, "Items in cart:"), React.createElement("span", null, getTotalItems())), React.createElement(CartInfo, null, React.createElement("span", null, "Total:"), React.createElement("span", null, "$", getTotalPrice().toFixed(2)))), React.createElement(CTAButton, {
|
|
58660
58686
|
icon: React.createElement(FaShoppingCart, null),
|
|
58661
58687
|
label: "Proceed to Checkout ($" + getTotalPrice().toFixed(2) + ")",
|
|
@@ -58864,7 +58890,7 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
58864
58890
|
}
|
|
58865
58891
|
return null;
|
|
58866
58892
|
};
|
|
58867
|
-
return React.createElement(ItemWrapper$2, null, React.createElement(ItemIconContainer$4, null, React.createElement(SpriteContainer$
|
|
58893
|
+
return React.createElement(ItemWrapper$2, null, React.createElement(ItemIconContainer$4, null, React.createElement(SpriteContainer$5, null, React.createElement(ItemInfoWrapper, {
|
|
58868
58894
|
atlasIMG: atlasIMG,
|
|
58869
58895
|
atlasJSON: atlasJSON,
|
|
58870
58896
|
equipmentSet: equipmentSet,
|
|
@@ -58898,7 +58924,7 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
58898
58924
|
onPointerDown: function onPointerDown() {
|
|
58899
58925
|
return onLeftClick();
|
|
58900
58926
|
}
|
|
58901
|
-
}), React.createElement(QuantityInput$
|
|
58927
|
+
}), React.createElement(QuantityInput$1, {
|
|
58902
58928
|
type: "text",
|
|
58903
58929
|
value: inputQty,
|
|
58904
58930
|
onChange: handleQuantityChange,
|
|
@@ -58936,7 +58962,7 @@ var ItemIconContainer$4 = /*#__PURE__*/styled.div.withConfig({
|
|
|
58936
58962
|
displayName: "TradingItemRow__ItemIconContainer",
|
|
58937
58963
|
componentId: "sc-mja0b5-3"
|
|
58938
58964
|
})(["display:flex;justify-content:flex-start;align-items:center;flex:0 0 40px;"]);
|
|
58939
|
-
var SpriteContainer$
|
|
58965
|
+
var SpriteContainer$5 = /*#__PURE__*/styled.div.withConfig({
|
|
58940
58966
|
displayName: "TradingItemRow__SpriteContainer",
|
|
58941
58967
|
componentId: "sc-mja0b5-4"
|
|
58942
58968
|
})(["position:relative;top:-0.5rem;left:0;"]);
|
|
@@ -58948,7 +58974,7 @@ var QuantityContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
58948
58974
|
displayName: "TradingItemRow__QuantityContainer",
|
|
58949
58975
|
componentId: "sc-mja0b5-6"
|
|
58950
58976
|
})(["display:flex;min-width:90px;width:40%;justify-content:flex-end;align-items:center;flex:30%;gap:2px;position:relative;"]);
|
|
58951
|
-
var QuantityInput$
|
|
58977
|
+
var QuantityInput$1 = /*#__PURE__*/styled.input.withConfig({
|
|
58952
58978
|
displayName: "TradingItemRow__QuantityInput",
|
|
58953
58979
|
componentId: "sc-mja0b5-7"
|
|
58954
58980
|
})(["width:30px;text-align:center;background-color:", ";color:white;border:none;padding:1px;font-size:", ";position:relative;right:4px;"], uiColors.darkGray, uiFonts.size.small);
|