@rpg-engine/long-bow 0.8.130 → 0.8.133
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/PaymentMethodModal.d.ts +8 -0
- package/dist/components/Store/Store.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +78 -10
- 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 +79 -12
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Store/PaymentMethodModal.tsx +140 -0
- package/src/components/Store/Store.tsx +22 -7
- package/src/components/Store/StoreItemDetails.tsx +1 -0
- package/src/components/Store/StoreItemRow.tsx +4 -1
- package/src/index.tsx +1 -0
- package/src/stories/Features/store/Store.stories.tsx +2 -0
|
@@ -8,6 +8,9 @@ export interface IStoreProps {
|
|
|
8
8
|
atlasIMG: string;
|
|
9
9
|
onPurchase: (purchase: Partial<IPurchase>) => Promise<boolean>;
|
|
10
10
|
onShowHistory?: () => void;
|
|
11
|
+
onShowWallet?: () => void;
|
|
12
|
+
walletLabel?: string;
|
|
13
|
+
packsTabLabel?: string;
|
|
11
14
|
userAccountType: UserAccountTypes;
|
|
12
15
|
loading?: boolean;
|
|
13
16
|
error?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export * from './components/Store/CartView';
|
|
|
61
61
|
export * from './components/Store/hooks/useStoreCart';
|
|
62
62
|
export * from './components/Store/MetadataCollector';
|
|
63
63
|
export * from './components/Store/Store';
|
|
64
|
+
export * from './components/Store/PaymentMethodModal';
|
|
64
65
|
export * from './components/Table/Table';
|
|
65
66
|
export * from './components/TextArea';
|
|
66
67
|
export * from './components/TimeWidget/TimeWidget';
|
|
@@ -25,6 +25,7 @@ var ai = require('react-icons/ai');
|
|
|
25
25
|
var reactColorful = require('react-colorful');
|
|
26
26
|
require('rpgui/rpgui.css');
|
|
27
27
|
require('rpgui/rpgui.min.js');
|
|
28
|
+
var gi = require('react-icons/gi');
|
|
28
29
|
var capitalize = _interopDefault(require('lodash/capitalize'));
|
|
29
30
|
|
|
30
31
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
@@ -58647,7 +58648,7 @@ var StoreItemRow = function StoreItemRow(_ref) {
|
|
|
58647
58648
|
height: 32,
|
|
58648
58649
|
imgScale: 2,
|
|
58649
58650
|
centered: true
|
|
58650
|
-
})), 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, {
|
|
58651
|
+
})), React__default.createElement(ItemDetails$2, null, React__default.createElement(ItemName$2, null, item.name), React__default.createElement(ItemPrice$1, null, "$", item.price, item.dcPrice ? " \xB7 " + item.dcPrice.toLocaleString() + " DC" : ''), React__default.createElement(ItemDescription, null, item.description)), React__default.createElement(Controls$1, null, showTextInput ? React__default.createElement(TextInput, {
|
|
58651
58652
|
type: "text",
|
|
58652
58653
|
value: textInputValue,
|
|
58653
58654
|
placeholder: textInputPlaceholder,
|
|
@@ -58953,7 +58954,7 @@ var StoreItemDetails = function StoreItemDetails(_ref) {
|
|
|
58953
58954
|
}, React__default.createElement(fa.FaArrowLeft, null), React__default.createElement("span", null, "Back"))), React__default.createElement(Content$5, null, React__default.createElement(DetailsGrid, null, React__default.createElement(ItemIcon, null, React__default.createElement("img", {
|
|
58954
58955
|
src: getImageSrc(),
|
|
58955
58956
|
alt: item.name
|
|
58956
|
-
})), React__default.createElement(ItemInfo$2, null, React__default.createElement(ItemName$3, null, item.name), React__default.createElement(ItemPrice$2, null, "$", 'priceUSD' in item ? item.priceUSD : item.price), React__default.createElement(Description$6, null, item.description))), React__default.createElement(Actions, null, React__default.createElement(CTAButton, {
|
|
58957
|
+
})), React__default.createElement(ItemInfo$2, null, React__default.createElement(ItemName$3, null, item.name), React__default.createElement(ItemPrice$2, null, "$", 'priceUSD' in item ? item.priceUSD : item.price, item.dcPrice ? " \xB7 " + item.dcPrice.toLocaleString() + " DC" : ''), React__default.createElement(Description$6, null, item.description))), React__default.createElement(Actions, null, React__default.createElement(CTAButton, {
|
|
58957
58958
|
icon: React__default.createElement(fa.FaCartPlus, null),
|
|
58958
58959
|
label: "Add to Cart",
|
|
58959
58960
|
onClick: function onClick() {
|
|
@@ -59015,6 +59016,8 @@ var Store = function Store(_ref) {
|
|
|
59015
59016
|
atlasIMG = _ref.atlasIMG,
|
|
59016
59017
|
_onPurchase2 = _ref.onPurchase,
|
|
59017
59018
|
onShowHistory = _ref.onShowHistory,
|
|
59019
|
+
onShowWallet = _ref.onShowWallet,
|
|
59020
|
+
walletLabel = _ref.walletLabel,
|
|
59018
59021
|
userAccountType = _ref.userAccountType,
|
|
59019
59022
|
_ref$loading = _ref.loading,
|
|
59020
59023
|
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
@@ -59027,7 +59030,9 @@ var Store = function Store(_ref) {
|
|
|
59027
59030
|
_ref$textInputItemKey = _ref.textInputItemKeys,
|
|
59028
59031
|
textInputItemKeys = _ref$textInputItemKey === void 0 ? [] : _ref$textInputItemKey,
|
|
59029
59032
|
customPacksContent = _ref.customPacksContent,
|
|
59030
|
-
customWalletContent = _ref.customWalletContent
|
|
59033
|
+
customWalletContent = _ref.customWalletContent,
|
|
59034
|
+
_ref$packsTabLabel = _ref.packsTabLabel,
|
|
59035
|
+
packsTabLabel = _ref$packsTabLabel === void 0 ? 'Packs' : _ref$packsTabLabel;
|
|
59031
59036
|
var _useState = React.useState(null),
|
|
59032
59037
|
selectedPack = _useState[0],
|
|
59033
59038
|
setSelectedPack = _useState[1];
|
|
@@ -59151,7 +59156,7 @@ var Store = function Store(_ref) {
|
|
|
59151
59156
|
},
|
|
59152
59157
|
packs: {
|
|
59153
59158
|
id: 'packs',
|
|
59154
|
-
title:
|
|
59159
|
+
title: packsTabLabel,
|
|
59155
59160
|
content: customPacksContent != null ? customPacksContent : React__default.createElement(StorePacksSection, {
|
|
59156
59161
|
packs: packs.filter(function (pack) {
|
|
59157
59162
|
return pack.priceUSD < 9.99;
|
|
@@ -59232,10 +59237,14 @@ var Store = function Store(_ref) {
|
|
|
59232
59237
|
onAddToCart: function onAddToCart() {
|
|
59233
59238
|
return handleAddPackToCart(selectedPack);
|
|
59234
59239
|
}
|
|
59235
|
-
}) : React__default.createElement(Container$N, null, React__default.createElement(TopBar$1, null, React__default.createElement(
|
|
59240
|
+
}) : React__default.createElement(Container$N, null, React__default.createElement(TopBar$1, null, React__default.createElement(LeftButtons, null, onShowHistory && React__default.createElement(CTAButton, {
|
|
59236
59241
|
icon: React__default.createElement(fa.FaHistory, null),
|
|
59237
59242
|
label: "History",
|
|
59238
59243
|
onClick: onShowHistory
|
|
59244
|
+
}), onShowWallet && React__default.createElement(CTAButton, {
|
|
59245
|
+
icon: React__default.createElement(fa.FaWallet, null),
|
|
59246
|
+
label: walletLabel != null ? walletLabel : 'DC Wallet',
|
|
59247
|
+
onClick: onShowWallet
|
|
59239
59248
|
})), React__default.createElement(CartButton, null, React__default.createElement(CTAButton, {
|
|
59240
59249
|
icon: React__default.createElement(fa.FaShoppingCart, null),
|
|
59241
59250
|
label: getTotalItems() + " items ($" + getTotalPrice().toFixed(2) + ")",
|
|
@@ -59266,10 +59275,10 @@ var TopBar$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
59266
59275
|
displayName: "Store__TopBar",
|
|
59267
59276
|
componentId: "sc-64dj00-1"
|
|
59268
59277
|
})(["display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:0 1rem;flex-shrink:0;margin-top:0.5rem;"]);
|
|
59269
|
-
var
|
|
59270
|
-
displayName: "
|
|
59278
|
+
var LeftButtons = /*#__PURE__*/styled__default.div.withConfig({
|
|
59279
|
+
displayName: "Store__LeftButtons",
|
|
59271
59280
|
componentId: "sc-64dj00-2"
|
|
59272
|
-
})(["min-width:fit-content;margin-right:auto;"]);
|
|
59281
|
+
})(["display:flex;gap:0.5rem;min-width:fit-content;margin-right:auto;"]);
|
|
59273
59282
|
var CartButton = /*#__PURE__*/styled__default.div.withConfig({
|
|
59274
59283
|
displayName: "Store__CartButton",
|
|
59275
59284
|
componentId: "sc-64dj00-3"
|
|
@@ -59299,6 +59308,64 @@ var ErrorMessage$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
59299
59308
|
componentId: "sc-64dj00-9"
|
|
59300
59309
|
})(["text-align:center;color:", ";padding:2rem;"], uiColors.red);
|
|
59301
59310
|
|
|
59311
|
+
var PaymentMethodModal = function PaymentMethodModal(_ref) {
|
|
59312
|
+
var dcBalance = _ref.dcBalance,
|
|
59313
|
+
onPayWithDC = _ref.onPayWithDC,
|
|
59314
|
+
onPayWithCard = _ref.onPayWithCard,
|
|
59315
|
+
onClose = _ref.onClose;
|
|
59316
|
+
var stopPropagation = React.useCallback(function (e) {
|
|
59317
|
+
e.stopPropagation();
|
|
59318
|
+
}, []);
|
|
59319
|
+
return React__default.createElement(ModalPortal, null, React__default.createElement(Overlay$4, {
|
|
59320
|
+
onPointerDown: onClose
|
|
59321
|
+
}), React__default.createElement(ModalContainer$1, null, React__default.createElement(ModalContent$1, {
|
|
59322
|
+
onClick: stopPropagation,
|
|
59323
|
+
onTouchStart: stopPropagation,
|
|
59324
|
+
onPointerDown: stopPropagation
|
|
59325
|
+
}, React__default.createElement(Title$f, null, "How would you like to pay?"), React__default.createElement(OptionButton, {
|
|
59326
|
+
onClick: onPayWithDC,
|
|
59327
|
+
className: "rpgui-button"
|
|
59328
|
+
}, React__default.createElement(gi.GiCrystalBall, null), React__default.createElement(OptionLabel, null, React__default.createElement("span", null, "Pay with DC"), React__default.createElement(OptionBalance, null, dcBalance.toLocaleString(), " DC available"))), React__default.createElement(OptionButton, {
|
|
59329
|
+
onClick: onPayWithCard,
|
|
59330
|
+
className: "rpgui-button"
|
|
59331
|
+
}, React__default.createElement(fa.FaCreditCard, null), React__default.createElement(OptionLabel, null, React__default.createElement("span", null, "Pay with Credit Card"))), React__default.createElement(CancelWrapper, null, React__default.createElement(Button, {
|
|
59332
|
+
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
59333
|
+
onPointerDown: onClose
|
|
59334
|
+
}, "Cancel")))));
|
|
59335
|
+
};
|
|
59336
|
+
var Overlay$4 = /*#__PURE__*/styled__default.div.withConfig({
|
|
59337
|
+
displayName: "PaymentMethodModal__Overlay",
|
|
59338
|
+
componentId: "sc-1dxy6lr-0"
|
|
59339
|
+
})(["position:fixed;inset:0;background:rgba(0,0,0,0.65);z-index:1000;"]);
|
|
59340
|
+
var ModalContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
59341
|
+
displayName: "PaymentMethodModal__ModalContainer",
|
|
59342
|
+
componentId: "sc-1dxy6lr-1"
|
|
59343
|
+
})(["position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:1001;pointer-events:none;"]);
|
|
59344
|
+
var ModalContent$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
59345
|
+
displayName: "PaymentMethodModal__ModalContent",
|
|
59346
|
+
componentId: "sc-1dxy6lr-2"
|
|
59347
|
+
})(["background:#1a1a2e;border:2px solid #f59e0b;border-radius:8px;padding:24px;min-width:320px;max-width:90%;display:flex;flex-direction:column;gap:12px;pointer-events:auto;animation:scaleIn 0.2s ease-out;@keyframes scaleIn{from{transform:scale(0.85);opacity:0;}to{transform:scale(1);opacity:1;}}"]);
|
|
59348
|
+
var Title$f = /*#__PURE__*/styled__default.h3.withConfig({
|
|
59349
|
+
displayName: "PaymentMethodModal__Title",
|
|
59350
|
+
componentId: "sc-1dxy6lr-3"
|
|
59351
|
+
})(["margin:0 0 8px;font-family:'Press Start 2P',cursive;font-size:0.75rem;color:#fef08a;text-align:center;"]);
|
|
59352
|
+
var OptionButton = /*#__PURE__*/styled__default.button.withConfig({
|
|
59353
|
+
displayName: "PaymentMethodModal__OptionButton",
|
|
59354
|
+
componentId: "sc-1dxy6lr-4"
|
|
59355
|
+
})(["display:flex;align-items:center;gap:12px;width:100%;padding:10px 14px;cursor:pointer;font-family:'Press Start 2P',cursive;font-size:0.65rem;svg{font-size:1.25rem;flex-shrink:0;}"]);
|
|
59356
|
+
var OptionLabel = /*#__PURE__*/styled__default.div.withConfig({
|
|
59357
|
+
displayName: "PaymentMethodModal__OptionLabel",
|
|
59358
|
+
componentId: "sc-1dxy6lr-5"
|
|
59359
|
+
})(["display:flex;flex-direction:column;align-items:flex-start;gap:4px;"]);
|
|
59360
|
+
var OptionBalance = /*#__PURE__*/styled__default.span.withConfig({
|
|
59361
|
+
displayName: "PaymentMethodModal__OptionBalance",
|
|
59362
|
+
componentId: "sc-1dxy6lr-6"
|
|
59363
|
+
})(["font-size:0.55rem;color:#fef08a;opacity:0.8;"]);
|
|
59364
|
+
var CancelWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
59365
|
+
displayName: "PaymentMethodModal__CancelWrapper",
|
|
59366
|
+
componentId: "sc-1dxy6lr-7"
|
|
59367
|
+
})(["display:flex;justify-content:center;margin-top:4px;filter:grayscale(0.6);"]);
|
|
59368
|
+
|
|
59302
59369
|
var TextArea = function TextArea(_ref) {
|
|
59303
59370
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
59304
59371
|
return React__default.createElement("textarea", Object.assign({}, props));
|
|
@@ -59629,7 +59696,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
59629
59696
|
width: "500px",
|
|
59630
59697
|
cancelDrag: "#TraderContainer",
|
|
59631
59698
|
scale: scale
|
|
59632
|
-
}, React__default.createElement(Container$O, null, React__default.createElement(Title$
|
|
59699
|
+
}, React__default.createElement(Container$O, null, React__default.createElement(Title$g, null, type.charAt(0).toUpperCase() + type.slice(1), " Menu"), React__default.createElement("hr", {
|
|
59633
59700
|
className: "golden"
|
|
59634
59701
|
}), React__default.createElement(ScrollWrapper, {
|
|
59635
59702
|
id: "TraderContainer"
|
|
@@ -59661,7 +59728,7 @@ var Container$O = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
59661
59728
|
displayName: "TradingMenu__Container",
|
|
59662
59729
|
componentId: "sc-1wjsz1l-0"
|
|
59663
59730
|
})(["width:100%;"]);
|
|
59664
|
-
var Title$
|
|
59731
|
+
var Title$g = /*#__PURE__*/styled__default.h1.withConfig({
|
|
59665
59732
|
displayName: "TradingMenu__Title",
|
|
59666
59733
|
componentId: "sc-1wjsz1l-1"
|
|
59667
59734
|
})(["font-size:0.7rem !important;color:yellow !important;text-align:center;"]);
|
|
@@ -59890,6 +59957,7 @@ exports.PartyInvite = PartyInvite;
|
|
|
59890
59957
|
exports.PartyManager = PartyManager;
|
|
59891
59958
|
exports.PartyManagerRow = PartyManagerRow;
|
|
59892
59959
|
exports.PartyRow = PartyRow;
|
|
59960
|
+
exports.PaymentMethodModal = PaymentMethodModal;
|
|
59893
59961
|
exports.PlayersRow = PlayersRow;
|
|
59894
59962
|
exports.ProgressBar = ProgressBar$1;
|
|
59895
59963
|
exports.PropertySelect = PropertySelect;
|