@rpg-engine/long-bow 0.6.0 → 0.6.1
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/Item/Inventory/ItemGem.d.ts +9 -0
- package/dist/index.d.ts +0 -1
- package/dist/long-bow.cjs.development.js +56 -78
- 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 +57 -78
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Item/Inventory/ItemGem.tsx +64 -0
- package/src/components/Item/Inventory/ItemSlotRenderer.tsx +17 -1
- package/src/components/TradingMenu/TradingMenu.tsx +2 -2
- package/src/index.tsx +0 -1
- package/src/mocks/itemContainer.mocks.ts +58 -0
- package/dist/components/Stepper.d.ts +0 -14
- package/dist/stories/Stepper.stories.d.ts +0 -5
- package/src/components/Stepper.tsx +0 -115
- package/src/stories/Stepper.stories.tsx +0 -48
package/dist/long-bow.esm.js
CHANGED
|
@@ -13659,6 +13659,48 @@ var rarityColor = function rarityColor(item) {
|
|
|
13659
13659
|
}
|
|
13660
13660
|
};
|
|
13661
13661
|
|
|
13662
|
+
var onRenderGems = function onRenderGems(itemId, gemQty) {
|
|
13663
|
+
var qtyClassName = 'small';
|
|
13664
|
+
if (gemQty <= 2) {
|
|
13665
|
+
qtyClassName = 'regular';
|
|
13666
|
+
}
|
|
13667
|
+
if (gemQty > 0) {
|
|
13668
|
+
return React.createElement(ItemSlotQty, {
|
|
13669
|
+
itemId: itemId,
|
|
13670
|
+
gemQty: gemQty,
|
|
13671
|
+
qtyClassName: qtyClassName
|
|
13672
|
+
});
|
|
13673
|
+
}
|
|
13674
|
+
return undefined;
|
|
13675
|
+
};
|
|
13676
|
+
var ItemSlotQty = function ItemSlotQty(_ref) {
|
|
13677
|
+
var itemId = _ref.itemId,
|
|
13678
|
+
gemQty = _ref.gemQty,
|
|
13679
|
+
qtyClassName = _ref.qtyClassName;
|
|
13680
|
+
var gemArray = Array.from({
|
|
13681
|
+
length: gemQty
|
|
13682
|
+
}, function () {
|
|
13683
|
+
return '🔶';
|
|
13684
|
+
});
|
|
13685
|
+
return React.createElement(ItemQtyContainer, {
|
|
13686
|
+
key: "qty-" + itemId,
|
|
13687
|
+
className: "item-slot-qty"
|
|
13688
|
+
}, React.createElement(Ellipsis, {
|
|
13689
|
+
maxLines: 1,
|
|
13690
|
+
maxWidth: "48px"
|
|
13691
|
+
}, React.createElement(ItemQty, {
|
|
13692
|
+
className: qtyClassName
|
|
13693
|
+
}, gemArray.join(''))));
|
|
13694
|
+
};
|
|
13695
|
+
var ItemQtyContainer = /*#__PURE__*/styled.div.withConfig({
|
|
13696
|
+
displayName: "ItemGem__ItemQtyContainer",
|
|
13697
|
+
componentId: "sc-1ekseaq-0"
|
|
13698
|
+
})(["position:relative;width:85%;height:16px;top:25px;left:5px;pointer-events:none;display:flex;"]);
|
|
13699
|
+
var ItemQty = /*#__PURE__*/styled.span.withConfig({
|
|
13700
|
+
displayName: "ItemGem__ItemQty",
|
|
13701
|
+
componentId: "sc-1ekseaq-1"
|
|
13702
|
+
})(["&.regular{font-size:", ";}&.small{font-size:", ";}"], uiFonts.size.small, uiFonts.size.xsmall);
|
|
13703
|
+
|
|
13662
13704
|
var onRenderStackInfo = function onRenderStackInfo(itemId, stackQty) {
|
|
13663
13705
|
var isFractionalStackQty = stackQty % 1 !== 0;
|
|
13664
13706
|
var isLargerThan999 = stackQty > 999;
|
|
@@ -13666,7 +13708,7 @@ var onRenderStackInfo = function onRenderStackInfo(itemId, stackQty) {
|
|
|
13666
13708
|
if (isLargerThan999) qtyClassName = 'small';
|
|
13667
13709
|
if (isFractionalStackQty) qtyClassName = 'xsmall';
|
|
13668
13710
|
if (stackQty > 1) {
|
|
13669
|
-
return React.createElement(ItemSlotQty, {
|
|
13711
|
+
return React.createElement(ItemSlotQty$1, {
|
|
13670
13712
|
itemId: itemId,
|
|
13671
13713
|
stackQty: stackQty,
|
|
13672
13714
|
qtyClassName: qtyClassName
|
|
@@ -13674,25 +13716,25 @@ var onRenderStackInfo = function onRenderStackInfo(itemId, stackQty) {
|
|
|
13674
13716
|
}
|
|
13675
13717
|
return undefined;
|
|
13676
13718
|
};
|
|
13677
|
-
var ItemSlotQty = function ItemSlotQty(_ref) {
|
|
13719
|
+
var ItemSlotQty$1 = function ItemSlotQty(_ref) {
|
|
13678
13720
|
var itemId = _ref.itemId,
|
|
13679
13721
|
stackQty = _ref.stackQty,
|
|
13680
13722
|
qtyClassName = _ref.qtyClassName;
|
|
13681
|
-
return React.createElement(ItemQtyContainer, {
|
|
13723
|
+
return React.createElement(ItemQtyContainer$1, {
|
|
13682
13724
|
key: "qty-" + itemId,
|
|
13683
13725
|
className: "item-slot-qty"
|
|
13684
13726
|
}, React.createElement(Ellipsis, {
|
|
13685
13727
|
maxLines: 1,
|
|
13686
13728
|
maxWidth: "48px"
|
|
13687
|
-
}, React.createElement(ItemQty, {
|
|
13729
|
+
}, React.createElement(ItemQty$1, {
|
|
13688
13730
|
className: qtyClassName
|
|
13689
13731
|
}, Math.round(stackQty * 100) / 100, ' ')));
|
|
13690
13732
|
};
|
|
13691
|
-
var ItemQtyContainer = /*#__PURE__*/styled.div.withConfig({
|
|
13733
|
+
var ItemQtyContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
13692
13734
|
displayName: "ItemSlotQty__ItemQtyContainer",
|
|
13693
13735
|
componentId: "sc-keb1s5-0"
|
|
13694
13736
|
})(["position:relative;width:85%;height:16px;top:25px;left:2px;pointer-events:none;display:flex;justify-content:flex-end;"]);
|
|
13695
|
-
var ItemQty = /*#__PURE__*/styled.span.withConfig({
|
|
13737
|
+
var ItemQty$1 = /*#__PURE__*/styled.span.withConfig({
|
|
13696
13738
|
displayName: "ItemSlotQty__ItemQty",
|
|
13697
13739
|
componentId: "sc-keb1s5-1"
|
|
13698
13740
|
})(["&.regular{font-size:", ";}&.small{font-size:", ";}&.xsmall{font-size:", ";}"], uiFonts.size.small, uiFonts.size.xsmall, uiFonts.size.xxsmall);
|
|
@@ -13703,8 +13745,13 @@ var ItemSlotRenderer = function ItemSlotRenderer(_ref) {
|
|
|
13703
13745
|
atlasIMG = _ref.atlasIMG,
|
|
13704
13746
|
slotSpriteMask = _ref.slotSpriteMask,
|
|
13705
13747
|
item = _ref.item;
|
|
13748
|
+
var renderStackInfo = function renderStackInfo(item) {
|
|
13749
|
+
return item.stackQty && item.stackQty > 1 && onRenderStackInfo(item._id, item.stackQty);
|
|
13750
|
+
};
|
|
13751
|
+
var renderGems = function renderGems(item) {
|
|
13752
|
+
return item.attachedGems && onRenderGems(item._id, item.attachedGems.length);
|
|
13753
|
+
};
|
|
13706
13754
|
var renderItem = function renderItem(item) {
|
|
13707
|
-
var _item$stackQty;
|
|
13708
13755
|
if (!(item != null && item.texturePath)) {
|
|
13709
13756
|
return null;
|
|
13710
13757
|
}
|
|
@@ -13721,7 +13768,7 @@ var ItemSlotRenderer = function ItemSlotRenderer(_ref) {
|
|
|
13721
13768
|
}, atlasJSON),
|
|
13722
13769
|
imgScale: 3,
|
|
13723
13770
|
imgClassname: "sprite-from-atlas-img--item"
|
|
13724
|
-
}),
|
|
13771
|
+
}), renderStackInfo(item), renderGems(item));
|
|
13725
13772
|
};
|
|
13726
13773
|
var renderEquipment = function renderEquipment(itemToRender) {
|
|
13727
13774
|
var _itemToRender$allowed;
|
|
@@ -18959,74 +19006,6 @@ var SpellList = /*#__PURE__*/styled.div.withConfig({
|
|
|
18959
19006
|
componentId: "sc-r02nfq-2"
|
|
18960
19007
|
})(["width:100%;min-height:0;flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:1.5rem;margin-top:1rem;"]);
|
|
18961
19008
|
|
|
18962
|
-
var Stepper = function Stepper(_ref) {
|
|
18963
|
-
var _steps$currentStep;
|
|
18964
|
-
var steps = _ref.steps,
|
|
18965
|
-
finalCTAButton = _ref.finalCTAButton;
|
|
18966
|
-
var _useState = useState(0),
|
|
18967
|
-
currentStep = _useState[0],
|
|
18968
|
-
setCurrentStep = _useState[1];
|
|
18969
|
-
var currentComponent = (_steps$currentStep = steps[currentStep]) == null ? void 0 : _steps$currentStep.component;
|
|
18970
|
-
var totalSteps = steps.length;
|
|
18971
|
-
var onStepChange = function onStepChange(step) {
|
|
18972
|
-
setCurrentStep(step);
|
|
18973
|
-
};
|
|
18974
|
-
return React.createElement(StepperContainer, {
|
|
18975
|
-
className: "stepper-container"
|
|
18976
|
-
}, React.createElement(StepperTop, null, Array.from({
|
|
18977
|
-
length: totalSteps
|
|
18978
|
-
}, function (_, i) {
|
|
18979
|
-
return React.createElement(ProgressIndicator, {
|
|
18980
|
-
key: i,
|
|
18981
|
-
isActive: i <= currentStep,
|
|
18982
|
-
onClick: function onClick() {
|
|
18983
|
-
return onStepChange(i);
|
|
18984
|
-
}
|
|
18985
|
-
});
|
|
18986
|
-
})), React.createElement(StepperBody, null, currentComponent), React.createElement(StepperFooter, null, currentStep > 0 && React.createElement(SelectArrow, {
|
|
18987
|
-
direction: "left",
|
|
18988
|
-
onPointerDown: function onPointerDown() {
|
|
18989
|
-
return onStepChange(Math.max(0, currentStep - 1));
|
|
18990
|
-
}
|
|
18991
|
-
}), currentStep < totalSteps - 1 && React.createElement(SelectArrow, {
|
|
18992
|
-
direction: "right",
|
|
18993
|
-
onPointerDown: function onPointerDown() {
|
|
18994
|
-
return onStepChange(Math.min(totalSteps - 1, currentStep + 1));
|
|
18995
|
-
}
|
|
18996
|
-
}), currentStep === totalSteps - 1 && finalCTAButton && React.createElement(Button, {
|
|
18997
|
-
buttonType: ButtonTypes.RPGUIButton,
|
|
18998
|
-
onPointerDown: function onPointerDown() {
|
|
18999
|
-
return finalCTAButton.onClick;
|
|
19000
|
-
}
|
|
19001
|
-
}, finalCTAButton.label)));
|
|
19002
|
-
};
|
|
19003
|
-
var StepperContainer = /*#__PURE__*/styled.div.withConfig({
|
|
19004
|
-
displayName: "Stepper__StepperContainer",
|
|
19005
|
-
componentId: "sc-13obf1-0"
|
|
19006
|
-
})(["display:flex;flex-direction:column;height:100%;"]);
|
|
19007
|
-
var StepperTop = /*#__PURE__*/styled.div.withConfig({
|
|
19008
|
-
displayName: "Stepper__StepperTop",
|
|
19009
|
-
componentId: "sc-13obf1-1"
|
|
19010
|
-
})(["flex:1;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;margin-bottom:1rem;"]);
|
|
19011
|
-
var StepperBody = /*#__PURE__*/styled.div.withConfig({
|
|
19012
|
-
displayName: "Stepper__StepperBody",
|
|
19013
|
-
componentId: "sc-13obf1-2"
|
|
19014
|
-
})(["flex:8;"]);
|
|
19015
|
-
var StepperFooter = /*#__PURE__*/styled.div.withConfig({
|
|
19016
|
-
displayName: "Stepper__StepperFooter",
|
|
19017
|
-
componentId: "sc-13obf1-3"
|
|
19018
|
-
})(["margin-top:1rem;flex:1;display:flex;justify-content:flex-end;"]);
|
|
19019
|
-
var ProgressIndicator = /*#__PURE__*/styled.div.withConfig({
|
|
19020
|
-
displayName: "Stepper__ProgressIndicator",
|
|
19021
|
-
componentId: "sc-13obf1-4"
|
|
19022
|
-
})(["width:20px;height:20px;border-radius:50%;background-color:", ";margin:0 5px;transition:background-color 0.3s;opacity:", ";border:1px solid ", ";cursor:pointer;"], function (_ref2) {
|
|
19023
|
-
var isActive = _ref2.isActive;
|
|
19024
|
-
return isActive ? uiColors.orange : uiColors.lightGray;
|
|
19025
|
-
}, function (_ref3) {
|
|
19026
|
-
var isActive = _ref3.isActive;
|
|
19027
|
-
return isActive ? 1 : 0.25;
|
|
19028
|
-
}, uiColors.raisinBlack);
|
|
19029
|
-
|
|
19030
19009
|
var TextArea = function TextArea(_ref) {
|
|
19031
19010
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
19032
19011
|
return React.createElement("textarea", Object.assign({}, props));
|
|
@@ -19317,7 +19296,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
19317
19296
|
scale: scale,
|
|
19318
19297
|
isBuy: isBuy()
|
|
19319
19298
|
}));
|
|
19320
|
-
})), React.createElement(GoldWrapper, null, React.createElement("p", null, "Available Gold:"), React.createElement("p", null, "$", characterAvailableGold
|
|
19299
|
+
})), React.createElement(GoldWrapper, null, React.createElement("p", null, "Available Gold:"), React.createElement("p", null, "$", characterAvailableGold)), React.createElement(TotalWrapper, null, React.createElement("p", null, "Total:"), React.createElement("p", null, "$", sum)), !hasGoldForSale() ? React.createElement(AlertWrapper, null, React.createElement("p", null, " Sorry, not enough money.")) : React.createElement(GoldWrapper, null, React.createElement("p", null, "Final Gold:"), React.createElement("p", null, "$", getFinalGold())), React.createElement(ButtonWrapper$2, null, React.createElement(Button, {
|
|
19321
19300
|
buttonType: ButtonTypes.RPGUIButton,
|
|
19322
19301
|
disabled: !hasGoldForSale(),
|
|
19323
19302
|
onPointerDown: function onPointerDown() {
|
|
@@ -19461,5 +19440,5 @@ var ButtonWrapper$3 = /*#__PURE__*/styled.div.withConfig({
|
|
|
19461
19440
|
componentId: "sc-gptoxp-5"
|
|
19462
19441
|
})(["display:flex;justify-content:space-around;padding-top:20px;width:100%;"]);
|
|
19463
19442
|
|
|
19464
|
-
export { AsyncDropdown, Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, ChatRevamp, CheckButton, CheckItem, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, EquipmentSlotSpriteByType, ErrorBoundary, FriendList, HistoryDialog, ImageCarousel, ImgSide, Input, InputRadio$1 as InputRadio, ItemContainer$1 as ItemContainer, ItemSelector, ItemSlot, Leaderboard, ListMenu, Marketplace, MarketplaceRows, NPCDialog, NPCDialogType, NPCMultiDialog, PartyCreate, PartyDashboard, PartyInvite, PartyManager, PartyManagerRow, PartyRow, PlayersRow, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, Shortcuts, SimpleImageCarousel, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas,
|
|
19443
|
+
export { AsyncDropdown, Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, ChatRevamp, CheckButton, CheckItem, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, EquipmentSlotSpriteByType, ErrorBoundary, FriendList, HistoryDialog, ImageCarousel, ImgSide, Input, InputRadio$1 as InputRadio, ItemContainer$1 as ItemContainer, ItemSelector, ItemSlot, Leaderboard, ListMenu, Marketplace, MarketplaceRows, NPCDialog, NPCDialogType, NPCMultiDialog, PartyCreate, PartyDashboard, PartyInvite, PartyManager, PartyManagerRow, PartyRow, PlayersRow, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, Shortcuts, SimpleImageCarousel, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas, TextArea, TimeWidget, TradingMenu, Truncate, _RPGUI, mockedPartyManager, mockedPartyRows, mockedPlayersRows, mockedPlayersRows2, useEventListener };
|
|
19465
19444
|
//# sourceMappingURL=long-bow.esm.js.map
|