@rpg-engine/long-bow 0.3.95 → 0.3.96
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/long-bow.cjs.development.js +41 -15
- 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 +41 -15
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Item/Cards/ItemInfo.tsx +41 -5
- package/src/components/Item/Cards/ItemInfoDisplay.tsx +9 -2
- package/src/components/Item/Cards/MobileItemTooltip.tsx +3 -3
- package/src/constants/uiColors.ts +1 -1
- package/src/mocks/equipmentSet.mocks.ts +1 -1
- package/src/mocks/itemContainer.mocks.ts +42 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -12644,7 +12644,7 @@ var uiColors = {
|
|
|
12644
12644
|
blue: '#597DCE',
|
|
12645
12645
|
darkBlue: '#30346D',
|
|
12646
12646
|
brown: '#854C30',
|
|
12647
|
-
lightGreen: '#
|
|
12647
|
+
lightGreen: '#66cd1c',
|
|
12648
12648
|
brownGreen: '#346524'
|
|
12649
12649
|
};
|
|
12650
12650
|
|
|
@@ -13251,15 +13251,15 @@ var MobileItemTooltip = function MobileItemTooltip(_ref) {
|
|
|
13251
13251
|
var Container$9 = /*#__PURE__*/styled.div.withConfig({
|
|
13252
13252
|
displayName: "MobileItemTooltip__Container",
|
|
13253
13253
|
componentId: "sc-ku4p1j-0"
|
|
13254
|
-
})(["position:absolute;z-index:100;left:0;top:0;width:100vw;height:100vh;background-color:rgba(0 0 0 / 0.5);display:flex;justify-content:center;align-items:center;gap:0.5rem;transition:opacity 0.08s;animation:fadeIn 0.1s forwards;@keyframes fadeIn{0%{opacity:0;}100%{opacity:0.92;}}@keyframes fadeOut{0%{opacity:0.92;}100%{opacity:0;}}&.fadeOut{animation:fadeOut 0.1s forwards;}@media (max-width:
|
|
13254
|
+
})(["position:absolute;z-index:100;left:0;top:0;width:100vw;height:100vh;background-color:rgba(0 0 0 / 0.5);display:flex;justify-content:center;align-items:center;gap:0.5rem;transition:opacity 0.08s;animation:fadeIn 0.1s forwards;@keyframes fadeIn{0%{opacity:0;}100%{opacity:0.92;}}@keyframes fadeOut{0%{opacity:0.92;}100%{opacity:0;}}&.fadeOut{animation:fadeOut 0.1s forwards;}@media (max-width:640px){flex-direction:column;}"]);
|
|
13255
13255
|
var OptionsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
13256
13256
|
displayName: "MobileItemTooltip__OptionsContainer",
|
|
13257
13257
|
componentId: "sc-ku4p1j-1"
|
|
13258
|
-
})(["display:flex;flex-direction:column;gap:0.5rem;flex-wrap:wrap;@media (max-width:
|
|
13258
|
+
})(["display:flex;flex-direction:column;gap:0.5rem;flex-wrap:wrap;@media (max-width:640px){flex-direction:row;justify-content:center;}"]);
|
|
13259
13259
|
var Option = /*#__PURE__*/styled.button.withConfig({
|
|
13260
13260
|
displayName: "MobileItemTooltip__Option",
|
|
13261
13261
|
componentId: "sc-ku4p1j-2"
|
|
13262
|
-
})(["padding:1rem;background-color:#333;color:white;border:none;border-radius:3px;width:8rem;transition:background-color 0.1s;&:hover{background-color:#555;}@media (max-width:
|
|
13262
|
+
})(["padding:1rem;background-color:#333;color:white;border:none;border-radius:3px;width:8rem;transition:background-color 0.1s;&:hover{background-color:#555;}@media (max-width:640px){padding:1rem 0.5rem;}"]);
|
|
13263
13263
|
|
|
13264
13264
|
var generateContextMenuListOptions = function generateContextMenuListOptions(actionsByTypeList) {
|
|
13265
13265
|
var contextMenu = actionsByTypeList.map(function (action) {
|
|
@@ -13833,6 +13833,15 @@ var ItemInfo = function ItemInfo(_ref) {
|
|
|
13833
13833
|
}
|
|
13834
13834
|
return statistics;
|
|
13835
13835
|
};
|
|
13836
|
+
var renderEntityEffects = function renderEntityEffects() {
|
|
13837
|
+
if (!item.entityEffects || !item.entityEffectChance) return null;
|
|
13838
|
+
return item.entityEffects.map(function (effect, index) {
|
|
13839
|
+
return React.createElement(Statistic, {
|
|
13840
|
+
key: index,
|
|
13841
|
+
"$isSpecial": true
|
|
13842
|
+
}, effect[0].toUpperCase() + effect.slice(1), " (", item.entityEffectChance, "%)");
|
|
13843
|
+
});
|
|
13844
|
+
};
|
|
13836
13845
|
var renderAvaibleSlots = function renderAvaibleSlots() {
|
|
13837
13846
|
if (!item.allowedEquipSlotType) return null;
|
|
13838
13847
|
return item.allowedEquipSlotType.map(function (slotType, index) {
|
|
@@ -13856,12 +13865,18 @@ var ItemInfo = function ItemInfo(_ref) {
|
|
|
13856
13865
|
item: item
|
|
13857
13866
|
}, React.createElement(Header, null, React.createElement("div", null, React.createElement(Title$1, null, item.name), item.rarity !== 'Common' && React.createElement(Rarity, {
|
|
13858
13867
|
item: item
|
|
13859
|
-
}, item.rarity), React.createElement(Type, null, item.subType)), React.createElement(AllowedSlots, null, renderAvaibleSlots())),
|
|
13868
|
+
}, item.rarity), React.createElement(Type, null, item.subType)), React.createElement(AllowedSlots, null, renderAvaibleSlots())), item.minRequirements && React.createElement(LevelRequirement, null, React.createElement("div", null, "Level: ", item.minRequirements.level), React.createElement("div", null, item.minRequirements.skill.name[0].toUpperCase() + item.minRequirements.skill.name.slice(1), ": ", item.minRequirements.skill.level)), renderStatistics(), renderEntityEffects(), item.usableEffectDescription && React.createElement(Statistic, {
|
|
13869
|
+
"$isSpecial": true
|
|
13870
|
+
}, item.usableEffectDescription), item.equippedBuffDescription && React.createElement(Statistic, {
|
|
13871
|
+
"$isSpecial": true
|
|
13872
|
+
}, item.equippedBuffDescription), item.isTwoHanded && React.createElement(Statistic, {
|
|
13873
|
+
"$isSpecial": true
|
|
13874
|
+
}, "Two handed"), React.createElement(Description, null, item.description), item.maxStackSize && item.maxStackSize !== 1 && React.createElement(StackInfo, null, "x", Math.round(((_item$stackQty = item.stackQty) != null ? _item$stackQty : 1) * 100) / 100, "(", item.maxStackSize, ")"), renderMissingStatistic().length > 0 && React.createElement(MissingStatistics, null, React.createElement(Statistic, null, "Equipped Diff"), itemToCompare && renderMissingStatistic()));
|
|
13860
13875
|
};
|
|
13861
13876
|
var Container$b = /*#__PURE__*/styled.div.withConfig({
|
|
13862
13877
|
displayName: "ItemInfo__Container",
|
|
13863
13878
|
componentId: "sc-1xm4q8k-0"
|
|
13864
|
-
})(["color:white;background-color:#222;border-radius:5px;padding:0.5rem;font-size:", ";border:3px solid ", ";height:max-content;width:
|
|
13879
|
+
})(["color:white;background-color:#222;border-radius:5px;padding:0.5rem;font-size:", ";border:3px solid ", ";height:max-content;width:18rem;@media (max-width:640px){width:80vw;}"], uiFonts.size.small, function (_ref2) {
|
|
13865
13880
|
var _rarityColor;
|
|
13866
13881
|
var item = _ref2.item;
|
|
13867
13882
|
return (_rarityColor = rarityColor(item)) != null ? _rarityColor : uiColors.lightGray;
|
|
@@ -13881,29 +13896,36 @@ var Type = /*#__PURE__*/styled.div.withConfig({
|
|
|
13881
13896
|
displayName: "ItemInfo__Type",
|
|
13882
13897
|
componentId: "sc-1xm4q8k-3"
|
|
13883
13898
|
})(["font-size:", ";margin-top:0.2rem;color:", ";"], uiFonts.size.small, uiColors.lightGray);
|
|
13899
|
+
var LevelRequirement = /*#__PURE__*/styled.div.withConfig({
|
|
13900
|
+
displayName: "ItemInfo__LevelRequirement",
|
|
13901
|
+
componentId: "sc-1xm4q8k-4"
|
|
13902
|
+
})(["font-size:", ";margin-top:0.2rem;margin-bottom:1rem;color:", ";"], uiFonts.size.small, uiColors.orange);
|
|
13884
13903
|
var Statistic = /*#__PURE__*/styled.div.withConfig({
|
|
13885
13904
|
displayName: "ItemInfo__Statistic",
|
|
13886
|
-
componentId: "sc-1xm4q8k-
|
|
13887
|
-
})(["margin-bottom:0.4rem;width:
|
|
13905
|
+
componentId: "sc-1xm4q8k-5"
|
|
13906
|
+
})(["margin-bottom:0.4rem;width:100%;color:", ";.label{display:inline-block;margin-right:0.5rem;color:inherit;}.value{display:inline-block;color:inherit;}&.better,.better{color:", ";}&.worse,.worse{color:", ";}"], function (_ref4) {
|
|
13907
|
+
var $isSpecial = _ref4.$isSpecial;
|
|
13908
|
+
return $isSpecial ? uiColors.darkYellow : 'inherit';
|
|
13909
|
+
}, uiColors.lightGreen, uiColors.cardinal);
|
|
13888
13910
|
var Description = /*#__PURE__*/styled.div.withConfig({
|
|
13889
13911
|
displayName: "ItemInfo__Description",
|
|
13890
|
-
componentId: "sc-1xm4q8k-
|
|
13912
|
+
componentId: "sc-1xm4q8k-6"
|
|
13891
13913
|
})(["margin-top:1.5rem;font-size:", ";color:", ";font-style:italic;"], uiFonts.size.small, uiColors.lightGray);
|
|
13892
13914
|
var Header = /*#__PURE__*/styled.div.withConfig({
|
|
13893
13915
|
displayName: "ItemInfo__Header",
|
|
13894
|
-
componentId: "sc-1xm4q8k-
|
|
13916
|
+
componentId: "sc-1xm4q8k-7"
|
|
13895
13917
|
})(["display:flex;align-items:center;justify-content:space-between;margin-bottom:0.5rem;"]);
|
|
13896
13918
|
var AllowedSlots = /*#__PURE__*/styled.div.withConfig({
|
|
13897
13919
|
displayName: "ItemInfo__AllowedSlots",
|
|
13898
|
-
componentId: "sc-1xm4q8k-
|
|
13920
|
+
componentId: "sc-1xm4q8k-8"
|
|
13899
13921
|
})(["display:flex;align-items:center;justify-content:center;gap:0.5rem;margin-left:auto;align-self:flex-start;"]);
|
|
13900
13922
|
var StackInfo = /*#__PURE__*/styled.div.withConfig({
|
|
13901
13923
|
displayName: "ItemInfo__StackInfo",
|
|
13902
|
-
componentId: "sc-1xm4q8k-
|
|
13924
|
+
componentId: "sc-1xm4q8k-9"
|
|
13903
13925
|
})(["width:100%;text-align:right;font-size:", ";color:", ";margin-top:1rem;"], uiFonts.size.small, uiColors.orange);
|
|
13904
13926
|
var MissingStatistics = /*#__PURE__*/styled.div.withConfig({
|
|
13905
13927
|
displayName: "ItemInfo__MissingStatistics",
|
|
13906
|
-
componentId: "sc-1xm4q8k-
|
|
13928
|
+
componentId: "sc-1xm4q8k-10"
|
|
13907
13929
|
})(["margin-top:1rem;color:", ";"], uiColors.cardinal);
|
|
13908
13930
|
|
|
13909
13931
|
var itemSlotTypes = ['head', 'neck', 'leftHand', 'rightHand', 'ring', 'legs', 'boot', 'accessory', 'armor', 'inventory'];
|
|
@@ -13925,7 +13947,11 @@ var ItemInfoDisplay = function ItemInfoDisplay(_ref) {
|
|
|
13925
13947
|
var allowedSlotTypeCamelCase = camelCase(item.allowedEquipSlotType[0]);
|
|
13926
13948
|
var itemSubTypeCamelCase = camelCase(item.subType);
|
|
13927
13949
|
var slotType = getSlotType(itemSlotTypes, allowedSlotTypeCamelCase, itemSubTypeCamelCase);
|
|
13928
|
-
var
|
|
13950
|
+
var itemSubTypeFromEquipment = Object.values(equipmentSet).find(function (item) {
|
|
13951
|
+
var _item$subType;
|
|
13952
|
+
return camelCase((_item$subType = item == null ? void 0 : item.subType) != null ? _item$subType : '') === itemSubTypeCamelCase;
|
|
13953
|
+
});
|
|
13954
|
+
var itemFromEquipment = itemSubTypeFromEquipment ? itemSubTypeFromEquipment : equipmentSet[slotType];
|
|
13929
13955
|
if (itemFromEquipment && (!item._id || itemFromEquipment._id !== item._id)) {
|
|
13930
13956
|
return itemFromEquipment;
|
|
13931
13957
|
}
|
|
@@ -13949,7 +13975,7 @@ var ItemInfoDisplay = function ItemInfoDisplay(_ref) {
|
|
|
13949
13975
|
var Flex = /*#__PURE__*/styled.div.withConfig({
|
|
13950
13976
|
displayName: "ItemInfoDisplay__Flex",
|
|
13951
13977
|
componentId: "sc-1lftdo8-0"
|
|
13952
|
-
})(["display:flex;gap:0.5rem;flex-direction:", ";@media (max-width:
|
|
13978
|
+
})(["display:flex;gap:0.5rem;flex-direction:", ";align-items:center;@media (max-width:640px){flex-direction:column-reverse;align-items:center;}"], function (_ref2) {
|
|
13953
13979
|
var $isMobile = _ref2.$isMobile;
|
|
13954
13980
|
return $isMobile ? 'row-reverse' : 'row';
|
|
13955
13981
|
});
|