@rpg-engine/long-bow 0.6.1 → 0.6.2
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 +5 -6
- package/dist/components/Stepper.d.ts +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +113 -30
- 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 +113 -31
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Stepper.stories.d.ts +5 -0
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemGem.tsx +51 -35
- package/src/components/Item/Inventory/ItemSlotRenderer.tsx +1 -3
- package/src/components/Stepper.tsx +115 -0
- package/src/components/TradingMenu/TradingMenu.tsx +2 -2
- package/src/index.tsx +1 -0
- package/src/mocks/itemContainer.mocks.ts +6 -6
- package/src/stories/Stepper.stories.tsx +48 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -13659,47 +13659,61 @@ var rarityColor = function rarityColor(item) {
|
|
|
13659
13659
|
}
|
|
13660
13660
|
};
|
|
13661
13661
|
|
|
13662
|
-
var
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13662
|
+
var gemColors = {
|
|
13663
|
+
'emerald-gem': '#50C878',
|
|
13664
|
+
'topaz-radiance': '#FFC87C',
|
|
13665
|
+
'sapphire-gem': '#0F52BA',
|
|
13666
|
+
'ruby-gem': '#E0115F',
|
|
13667
|
+
'misty-quartz-gem': '#D9D9F3',
|
|
13668
|
+
'coral-reef-gem': '#FF7F50',
|
|
13669
|
+
'jasper-gem': '#D73B3E',
|
|
13670
|
+
'earthstone-gem': '#8B4513',
|
|
13671
|
+
'obsidian-gem': '#0B0C0E',
|
|
13672
|
+
'amethyst-gem': '#9966CC'
|
|
13673
|
+
};
|
|
13674
|
+
var defaultColor = '#FFFFFF'; // Default color (white)
|
|
13675
|
+
var onRenderGems = function onRenderGems(item) {
|
|
13676
|
+
var _item$attachedGems;
|
|
13677
|
+
var gemQty = ((_item$attachedGems = item.attachedGems) == null ? void 0 : _item$attachedGems.length) || 0;
|
|
13667
13678
|
if (gemQty > 0) {
|
|
13668
13679
|
return React.createElement(ItemSlotQty, {
|
|
13669
|
-
|
|
13670
|
-
gemQty: gemQty,
|
|
13671
|
-
qtyClassName: qtyClassName
|
|
13680
|
+
item: item
|
|
13672
13681
|
});
|
|
13673
13682
|
}
|
|
13674
13683
|
return undefined;
|
|
13675
13684
|
};
|
|
13676
13685
|
var ItemSlotQty = function ItemSlotQty(_ref) {
|
|
13677
|
-
var
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
var
|
|
13681
|
-
length: gemQty
|
|
13682
|
-
}, function () {
|
|
13683
|
-
return '🔶';
|
|
13684
|
-
});
|
|
13686
|
+
var _item$attachedGems2;
|
|
13687
|
+
var item = _ref.item;
|
|
13688
|
+
console.log(item.attachedGems);
|
|
13689
|
+
var itemId = item._id;
|
|
13685
13690
|
return React.createElement(ItemQtyContainer, {
|
|
13686
13691
|
key: "qty-" + itemId,
|
|
13687
13692
|
className: "item-slot-qty"
|
|
13688
|
-
},
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
|
|
13692
|
-
|
|
13693
|
-
}
|
|
13693
|
+
}, (_item$attachedGems2 = item.attachedGems) == null ? void 0 : _item$attachedGems2.map(function (gem, index) {
|
|
13694
|
+
return React.createElement(Gem, {
|
|
13695
|
+
key: itemId + "-gem-" + index,
|
|
13696
|
+
color: gemColors[gem.key] || defaultColor
|
|
13697
|
+
});
|
|
13698
|
+
}));
|
|
13694
13699
|
};
|
|
13695
13700
|
var ItemQtyContainer = /*#__PURE__*/styled.div.withConfig({
|
|
13696
13701
|
displayName: "ItemGem__ItemQtyContainer",
|
|
13697
13702
|
componentId: "sc-1ekseaq-0"
|
|
13698
|
-
})(["position:relative;width:85%;height:16px;top:
|
|
13699
|
-
var
|
|
13700
|
-
displayName: "
|
|
13703
|
+
})(["position:relative;width:85%;height:16px;top:26px;left:-2px;pointer-events:none;transform:scale(0.8);display:flex;align-items:center;justify-content:center;opacity:0.8;"]);
|
|
13704
|
+
var Gem = /*#__PURE__*/styled.div.withConfig({
|
|
13705
|
+
displayName: "ItemGem__Gem",
|
|
13701
13706
|
componentId: "sc-1ekseaq-1"
|
|
13702
|
-
})(["
|
|
13707
|
+
})(["width:8px;height:8px;background-color:", ";border:1px solid black;transform:rotate(45deg);margin:0 2px;box-shadow:0 0 5px ", ";transition:transform 0.2s,box-shadow 0.2s;&:hover{transform:rotate(45deg) scale(1.2);box-shadow:0 0 10px ", ";}"], function (_ref2) {
|
|
13708
|
+
var color = _ref2.color;
|
|
13709
|
+
return color;
|
|
13710
|
+
}, function (_ref3) {
|
|
13711
|
+
var color = _ref3.color;
|
|
13712
|
+
return color;
|
|
13713
|
+
}, function (_ref4) {
|
|
13714
|
+
var color = _ref4.color;
|
|
13715
|
+
return color;
|
|
13716
|
+
});
|
|
13703
13717
|
|
|
13704
13718
|
var onRenderStackInfo = function onRenderStackInfo(itemId, stackQty) {
|
|
13705
13719
|
var isFractionalStackQty = stackQty % 1 !== 0;
|
|
@@ -13726,7 +13740,7 @@ var ItemSlotQty$1 = function ItemSlotQty(_ref) {
|
|
|
13726
13740
|
}, React.createElement(Ellipsis, {
|
|
13727
13741
|
maxLines: 1,
|
|
13728
13742
|
maxWidth: "48px"
|
|
13729
|
-
}, React.createElement(ItemQty
|
|
13743
|
+
}, React.createElement(ItemQty, {
|
|
13730
13744
|
className: qtyClassName
|
|
13731
13745
|
}, Math.round(stackQty * 100) / 100, ' ')));
|
|
13732
13746
|
};
|
|
@@ -13734,7 +13748,7 @@ var ItemQtyContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
13734
13748
|
displayName: "ItemSlotQty__ItemQtyContainer",
|
|
13735
13749
|
componentId: "sc-keb1s5-0"
|
|
13736
13750
|
})(["position:relative;width:85%;height:16px;top:25px;left:2px;pointer-events:none;display:flex;justify-content:flex-end;"]);
|
|
13737
|
-
var ItemQty
|
|
13751
|
+
var ItemQty = /*#__PURE__*/styled.span.withConfig({
|
|
13738
13752
|
displayName: "ItemSlotQty__ItemQty",
|
|
13739
13753
|
componentId: "sc-keb1s5-1"
|
|
13740
13754
|
})(["&.regular{font-size:", ";}&.small{font-size:", ";}&.xsmall{font-size:", ";}"], uiFonts.size.small, uiFonts.size.xsmall, uiFonts.size.xxsmall);
|
|
@@ -13749,7 +13763,7 @@ var ItemSlotRenderer = function ItemSlotRenderer(_ref) {
|
|
|
13749
13763
|
return item.stackQty && item.stackQty > 1 && onRenderStackInfo(item._id, item.stackQty);
|
|
13750
13764
|
};
|
|
13751
13765
|
var renderGems = function renderGems(item) {
|
|
13752
|
-
return item.attachedGems && onRenderGems(item
|
|
13766
|
+
return item.attachedGems && onRenderGems(item);
|
|
13753
13767
|
};
|
|
13754
13768
|
var renderItem = function renderItem(item) {
|
|
13755
13769
|
if (!(item != null && item.texturePath)) {
|
|
@@ -19006,6 +19020,74 @@ var SpellList = /*#__PURE__*/styled.div.withConfig({
|
|
|
19006
19020
|
componentId: "sc-r02nfq-2"
|
|
19007
19021
|
})(["width:100%;min-height:0;flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:1.5rem;margin-top:1rem;"]);
|
|
19008
19022
|
|
|
19023
|
+
var Stepper = function Stepper(_ref) {
|
|
19024
|
+
var _steps$currentStep;
|
|
19025
|
+
var steps = _ref.steps,
|
|
19026
|
+
finalCTAButton = _ref.finalCTAButton;
|
|
19027
|
+
var _useState = useState(0),
|
|
19028
|
+
currentStep = _useState[0],
|
|
19029
|
+
setCurrentStep = _useState[1];
|
|
19030
|
+
var currentComponent = (_steps$currentStep = steps[currentStep]) == null ? void 0 : _steps$currentStep.component;
|
|
19031
|
+
var totalSteps = steps.length;
|
|
19032
|
+
var onStepChange = function onStepChange(step) {
|
|
19033
|
+
setCurrentStep(step);
|
|
19034
|
+
};
|
|
19035
|
+
return React.createElement(StepperContainer, {
|
|
19036
|
+
className: "stepper-container"
|
|
19037
|
+
}, React.createElement(StepperTop, null, Array.from({
|
|
19038
|
+
length: totalSteps
|
|
19039
|
+
}, function (_, i) {
|
|
19040
|
+
return React.createElement(ProgressIndicator, {
|
|
19041
|
+
key: i,
|
|
19042
|
+
isActive: i <= currentStep,
|
|
19043
|
+
onClick: function onClick() {
|
|
19044
|
+
return onStepChange(i);
|
|
19045
|
+
}
|
|
19046
|
+
});
|
|
19047
|
+
})), React.createElement(StepperBody, null, currentComponent), React.createElement(StepperFooter, null, currentStep > 0 && React.createElement(SelectArrow, {
|
|
19048
|
+
direction: "left",
|
|
19049
|
+
onPointerDown: function onPointerDown() {
|
|
19050
|
+
return onStepChange(Math.max(0, currentStep - 1));
|
|
19051
|
+
}
|
|
19052
|
+
}), currentStep < totalSteps - 1 && React.createElement(SelectArrow, {
|
|
19053
|
+
direction: "right",
|
|
19054
|
+
onPointerDown: function onPointerDown() {
|
|
19055
|
+
return onStepChange(Math.min(totalSteps - 1, currentStep + 1));
|
|
19056
|
+
}
|
|
19057
|
+
}), currentStep === totalSteps - 1 && finalCTAButton && React.createElement(Button, {
|
|
19058
|
+
buttonType: ButtonTypes.RPGUIButton,
|
|
19059
|
+
onPointerDown: function onPointerDown() {
|
|
19060
|
+
return finalCTAButton.onClick;
|
|
19061
|
+
}
|
|
19062
|
+
}, finalCTAButton.label)));
|
|
19063
|
+
};
|
|
19064
|
+
var StepperContainer = /*#__PURE__*/styled.div.withConfig({
|
|
19065
|
+
displayName: "Stepper__StepperContainer",
|
|
19066
|
+
componentId: "sc-13obf1-0"
|
|
19067
|
+
})(["display:flex;flex-direction:column;height:100%;"]);
|
|
19068
|
+
var StepperTop = /*#__PURE__*/styled.div.withConfig({
|
|
19069
|
+
displayName: "Stepper__StepperTop",
|
|
19070
|
+
componentId: "sc-13obf1-1"
|
|
19071
|
+
})(["flex:1;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;margin-bottom:1rem;"]);
|
|
19072
|
+
var StepperBody = /*#__PURE__*/styled.div.withConfig({
|
|
19073
|
+
displayName: "Stepper__StepperBody",
|
|
19074
|
+
componentId: "sc-13obf1-2"
|
|
19075
|
+
})(["flex:8;"]);
|
|
19076
|
+
var StepperFooter = /*#__PURE__*/styled.div.withConfig({
|
|
19077
|
+
displayName: "Stepper__StepperFooter",
|
|
19078
|
+
componentId: "sc-13obf1-3"
|
|
19079
|
+
})(["margin-top:1rem;flex:1;display:flex;justify-content:flex-end;"]);
|
|
19080
|
+
var ProgressIndicator = /*#__PURE__*/styled.div.withConfig({
|
|
19081
|
+
displayName: "Stepper__ProgressIndicator",
|
|
19082
|
+
componentId: "sc-13obf1-4"
|
|
19083
|
+
})(["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) {
|
|
19084
|
+
var isActive = _ref2.isActive;
|
|
19085
|
+
return isActive ? uiColors.orange : uiColors.lightGray;
|
|
19086
|
+
}, function (_ref3) {
|
|
19087
|
+
var isActive = _ref3.isActive;
|
|
19088
|
+
return isActive ? 1 : 0.25;
|
|
19089
|
+
}, uiColors.raisinBlack);
|
|
19090
|
+
|
|
19009
19091
|
var TextArea = function TextArea(_ref) {
|
|
19010
19092
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
19011
19093
|
return React.createElement("textarea", Object.assign({}, props));
|
|
@@ -19296,7 +19378,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
19296
19378
|
scale: scale,
|
|
19297
19379
|
isBuy: isBuy()
|
|
19298
19380
|
}));
|
|
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, {
|
|
19381
|
+
})), React.createElement(GoldWrapper, null, React.createElement("p", null, "Available Gold:"), React.createElement("p", null, "$", characterAvailableGold.toFixed(2))), 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().toFixed(2))), React.createElement(ButtonWrapper$2, null, React.createElement(Button, {
|
|
19300
19382
|
buttonType: ButtonTypes.RPGUIButton,
|
|
19301
19383
|
disabled: !hasGoldForSale(),
|
|
19302
19384
|
onPointerDown: function onPointerDown() {
|
|
@@ -19440,5 +19522,5 @@ var ButtonWrapper$3 = /*#__PURE__*/styled.div.withConfig({
|
|
|
19440
19522
|
componentId: "sc-gptoxp-5"
|
|
19441
19523
|
})(["display:flex;justify-content:space-around;padding-top:20px;width:100%;"]);
|
|
19442
19524
|
|
|
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 };
|
|
19525
|
+
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, Stepper, TextArea, TimeWidget, TradingMenu, Truncate, _RPGUI, mockedPartyManager, mockedPartyRows, mockedPlayersRows, mockedPlayersRows2, useEventListener };
|
|
19444
19526
|
//# sourceMappingURL=long-bow.esm.js.map
|