@rpg-engine/long-bow 0.2.46 → 0.2.48
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/shared/Ellipsis.d.ts +3 -2
- package/dist/long-bow.cjs.development.js +30 -23
- 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 +30 -23
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Item/Inventory/ItemSlot.tsx +35 -17
- package/src/components/PropertySelect/PropertySelect.tsx +7 -5
- package/src/components/TradingMenu/TradingItemRow.tsx +5 -3
- package/src/components/shared/Ellipsis.tsx +10 -9
- package/src/mocks/itemContainer.mocks.ts +46 -12
package/dist/long-bow.esm.js
CHANGED
|
@@ -27344,21 +27344,23 @@ var Ellipsis = function Ellipsis(_ref) {
|
|
|
27344
27344
|
var children = _ref.children,
|
|
27345
27345
|
maxLines = _ref.maxLines,
|
|
27346
27346
|
maxWidth = _ref.maxWidth,
|
|
27347
|
-
fontSize = _ref.fontSize
|
|
27347
|
+
fontSize = _ref.fontSize,
|
|
27348
|
+
center = _ref.center;
|
|
27348
27349
|
return React.createElement(Container$1, {
|
|
27349
27350
|
maxWidth: maxWidth,
|
|
27350
|
-
fontSize: fontSize
|
|
27351
|
-
|
|
27351
|
+
fontSize: fontSize,
|
|
27352
|
+
center: center
|
|
27353
|
+
}, React.createElement("div", {
|
|
27352
27354
|
className: "ellipsis-" + maxLines + "-lines"
|
|
27353
27355
|
}, children));
|
|
27354
27356
|
};
|
|
27355
27357
|
var Container$1 = /*#__PURE__*/styled.div.withConfig({
|
|
27356
27358
|
displayName: "Ellipsis__Container",
|
|
27357
27359
|
componentId: "sc-ysrlju-0"
|
|
27358
|
-
})(["
|
|
27359
|
-
return props.fontSize || '1rem';
|
|
27360
|
-
}, function (props) {
|
|
27360
|
+
})([".ellipsis-1-lines{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:", ";", "}.ellipsis-2-lines{display:-webkit-box;max-width:", "px;height:25px;margin:0 auto;line-height:1;-webkit-line-clamp:2;-webkit-box-orient:vertical;text-overflow:ellipsis;overflow:hidden;}.ellipsis-3-lines{display:-webkit-box;max-width:", "px;height:43px;margin:0 auto;line-height:1;-webkit-line-clamp:3;-webkit-box-orient:vertical;text-overflow:ellipsis;overflow:hidden;}"], function (props) {
|
|
27361
27361
|
return props.maxWidth;
|
|
27362
|
+
}, function (props) {
|
|
27363
|
+
return props.center && "margin: 0 auto;";
|
|
27362
27364
|
}, function (props) {
|
|
27363
27365
|
return props.maxWidth;
|
|
27364
27366
|
}, function (props) {
|
|
@@ -27395,10 +27397,11 @@ var PropertySelect = function PropertySelect(_ref) {
|
|
|
27395
27397
|
}
|
|
27396
27398
|
return '';
|
|
27397
27399
|
};
|
|
27398
|
-
return React.createElement(Container$2, null, React.createElement(TextOverlay, null, React.createElement(Item, null, React.createElement(Ellipsis, {
|
|
27400
|
+
return React.createElement(Container$2, null, React.createElement(TextOverlay, null, React.createElement("p", null, React.createElement(Item, null, React.createElement(Ellipsis, {
|
|
27399
27401
|
maxLines: 1,
|
|
27400
|
-
maxWidth:
|
|
27401
|
-
|
|
27402
|
+
maxWidth: "60%",
|
|
27403
|
+
center: true
|
|
27404
|
+
}, getCurrentSelectionName())))), React.createElement("div", {
|
|
27402
27405
|
className: "rpgui-progress-track"
|
|
27403
27406
|
}), React.createElement(SelectArrow, {
|
|
27404
27407
|
direction: "left",
|
|
@@ -28046,17 +28049,19 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
28046
28049
|
setContextActions(generateContextMenu(item, containerType));
|
|
28047
28050
|
}
|
|
28048
28051
|
}, [item]);
|
|
28049
|
-
var getLeftPositionValue = function getLeftPositionValue(quantity) {
|
|
28050
|
-
if (quantity > 0 && quantity < 10) return '2.5rem';else if (quantity > 9 && quantity < 100) return '2.0rem';else if (quantity > 99) return '1rem';
|
|
28051
|
-
return '2.5rem';
|
|
28052
|
-
};
|
|
28053
28052
|
var getStackInfo = function getStackInfo(itemId, stackQty) {
|
|
28054
28053
|
// if (itemToRender?.isStackable && itemToRender?.stackQty) {
|
|
28054
|
+
var isFractionalStackQty = stackQty % 1 !== 0;
|
|
28055
|
+
var isLargerThan999 = stackQty > 999;
|
|
28055
28056
|
if (stackQty > 1) {
|
|
28056
|
-
return React.createElement(
|
|
28057
|
-
left: getLeftPositionValue(stackQty),
|
|
28057
|
+
return React.createElement(ItemQtyContainer, {
|
|
28058
28058
|
key: "qty-" + itemId
|
|
28059
|
-
},
|
|
28059
|
+
}, React.createElement(Ellipsis, {
|
|
28060
|
+
maxLines: 1,
|
|
28061
|
+
maxWidth: "48px"
|
|
28062
|
+
}, React.createElement(ItemQty, {
|
|
28063
|
+
className: isFractionalStackQty || isLargerThan999 ? 'small' : 'regular'
|
|
28064
|
+
}, ' ', stackQty, ' ')));
|
|
28060
28065
|
}
|
|
28061
28066
|
return undefined;
|
|
28062
28067
|
};
|
|
@@ -28163,12 +28168,14 @@ var Container$9 = /*#__PURE__*/styled.div.withConfig({
|
|
|
28163
28168
|
displayName: "ItemSlot__Container",
|
|
28164
28169
|
componentId: "sc-l2j5ef-0"
|
|
28165
28170
|
})(["margin:0.1rem;.sprite-from-atlas-img{position:relative;top:1.5rem;left:1.5rem;}position:relative;"]);
|
|
28171
|
+
var ItemQtyContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28172
|
+
displayName: "ItemSlot__ItemQtyContainer",
|
|
28173
|
+
componentId: "sc-l2j5ef-1"
|
|
28174
|
+
})(["position:relative;width:85%;height:16px;top:25px;left:2px;display:flex;justify-content:flex-end;"]);
|
|
28166
28175
|
var ItemQty = /*#__PURE__*/styled.span.withConfig({
|
|
28167
28176
|
displayName: "ItemSlot__ItemQty",
|
|
28168
|
-
componentId: "sc-l2j5ef-
|
|
28169
|
-
})(["
|
|
28170
|
-
return props.left;
|
|
28171
|
-
});
|
|
28177
|
+
componentId: "sc-l2j5ef-2"
|
|
28178
|
+
})(["&.regular{font-size:", ";}&.small{font-size:", ";}"], uiFonts.size.small, uiFonts.size.xsmall);
|
|
28172
28179
|
|
|
28173
28180
|
var EquipmentSet = function EquipmentSet(_ref) {
|
|
28174
28181
|
var equipmentSet = _ref.equipmentSet,
|
|
@@ -29430,10 +29437,10 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
29430
29437
|
atlasJSON: atlasJSON,
|
|
29431
29438
|
spriteKey: traderItem.texturePath,
|
|
29432
29439
|
imgScale: 2.5
|
|
29433
|
-
}))), React.createElement(ItemNameContainer, null, React.createElement(NameValue, null, React.createElement(Ellipsis, {
|
|
29440
|
+
}))), React.createElement(ItemNameContainer, null, React.createElement(NameValue, null, React.createElement("p", null, React.createElement(Ellipsis, {
|
|
29434
29441
|
maxLines: 1,
|
|
29435
|
-
maxWidth:
|
|
29436
|
-
}, capitalize(traderItem.name)), React.createElement("p", null, "$", traderItem.price))), React.createElement(QuantityContainer, null, React.createElement(SelectArrow, {
|
|
29442
|
+
maxWidth: "250px"
|
|
29443
|
+
}, capitalize(traderItem.name))), React.createElement("p", null, "$", traderItem.price))), React.createElement(QuantityContainer, null, React.createElement(SelectArrow, {
|
|
29437
29444
|
size: 32,
|
|
29438
29445
|
className: "arrow-selector",
|
|
29439
29446
|
direction: "left",
|