@rpg-engine/long-bow 0.5.22 → 0.5.23
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/ItemQuantitySelectorModal.d.ts +12 -0
- package/dist/long-bow.cjs.development.js +109 -100
- 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 +109 -100
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemContainer.tsx +5 -38
- package/src/components/Item/Inventory/ItemQuantitySelectorModal.tsx +59 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -15641,6 +15641,89 @@ var SlotsContainer = function SlotsContainer(_ref) {
|
|
|
15641
15641
|
}, children);
|
|
15642
15642
|
};
|
|
15643
15643
|
|
|
15644
|
+
var ShortcutsSetter = function ShortcutsSetter(_ref) {
|
|
15645
|
+
var setSettingShortcutIndex = _ref.setSettingShortcutIndex,
|
|
15646
|
+
settingShortcutIndex = _ref.settingShortcutIndex,
|
|
15647
|
+
shortcuts = _ref.shortcuts,
|
|
15648
|
+
removeShortcut = _ref.removeShortcut,
|
|
15649
|
+
atlasJSON = _ref.atlasJSON,
|
|
15650
|
+
atlasIMG = _ref.atlasIMG;
|
|
15651
|
+
var getContent = function getContent(index) {
|
|
15652
|
+
var _shortcuts$index;
|
|
15653
|
+
if (((_shortcuts$index = shortcuts[index]) == null ? void 0 : _shortcuts$index.type) === ShortcutType.Item) {
|
|
15654
|
+
var _shortcuts$index2;
|
|
15655
|
+
var payload = (_shortcuts$index2 = shortcuts[index]) == null ? void 0 : _shortcuts$index2.payload;
|
|
15656
|
+
if (!payload) return null;
|
|
15657
|
+
return React.createElement(SpriteFromAtlas, {
|
|
15658
|
+
atlasIMG: atlasIMG,
|
|
15659
|
+
atlasJSON: atlasJSON,
|
|
15660
|
+
spriteKey: getItemTextureKeyPath({
|
|
15661
|
+
key: payload.texturePath,
|
|
15662
|
+
texturePath: payload.texturePath,
|
|
15663
|
+
stackQty: payload.stackQty || 1,
|
|
15664
|
+
isStackable: payload.isStackable
|
|
15665
|
+
}, atlasJSON),
|
|
15666
|
+
width: 32,
|
|
15667
|
+
height: 32,
|
|
15668
|
+
imgScale: 1.2,
|
|
15669
|
+
imgStyle: {
|
|
15670
|
+
left: '3px'
|
|
15671
|
+
}
|
|
15672
|
+
});
|
|
15673
|
+
}
|
|
15674
|
+
var IMAGE_SIZE = 32;
|
|
15675
|
+
var IMAGE_SCALE = 1;
|
|
15676
|
+
var shortcut = shortcuts[index];
|
|
15677
|
+
if ((shortcut == null ? void 0 : shortcut.type) === ShortcutType.Spell && shortcut.payload) {
|
|
15678
|
+
var _payload$texturePath;
|
|
15679
|
+
var _payload = shortcut.payload; // TypeScript type assertion
|
|
15680
|
+
return React.createElement(SpriteFromAtlas, {
|
|
15681
|
+
atlasIMG: _payload.atlasIMG,
|
|
15682
|
+
atlasJSON: _payload.atlasJSON,
|
|
15683
|
+
spriteKey: (_payload$texturePath = _payload.texturePath) != null ? _payload$texturePath : '',
|
|
15684
|
+
width: IMAGE_SIZE,
|
|
15685
|
+
height: IMAGE_SIZE,
|
|
15686
|
+
imgScale: IMAGE_SCALE,
|
|
15687
|
+
centered: true,
|
|
15688
|
+
borderRadius: "50%"
|
|
15689
|
+
});
|
|
15690
|
+
}
|
|
15691
|
+
return null;
|
|
15692
|
+
};
|
|
15693
|
+
return React.createElement(Container$j, null, React.createElement("p", null, "Shortcuts:"), React.createElement(List, {
|
|
15694
|
+
id: "shortcuts_list"
|
|
15695
|
+
}, Array.from({
|
|
15696
|
+
length: 12
|
|
15697
|
+
}).map(function (_, i) {
|
|
15698
|
+
return React.createElement(Shortcut, {
|
|
15699
|
+
key: i,
|
|
15700
|
+
onPointerDown: function onPointerDown() {
|
|
15701
|
+
if (settingShortcutIndex !== -1) setSettingShortcutIndex(-1);
|
|
15702
|
+
removeShortcut(i);
|
|
15703
|
+
if (settingShortcutIndex === -1 && (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)) setSettingShortcutIndex(i);
|
|
15704
|
+
},
|
|
15705
|
+
disabled: settingShortcutIndex !== -1 && settingShortcutIndex !== i,
|
|
15706
|
+
isBeingSet: settingShortcutIndex === i,
|
|
15707
|
+
id: "shortcutSetter_" + i
|
|
15708
|
+
}, getContent(i));
|
|
15709
|
+
})));
|
|
15710
|
+
};
|
|
15711
|
+
var Container$j = /*#__PURE__*/styled.div.withConfig({
|
|
15712
|
+
displayName: "ShortcutsSetter__Container",
|
|
15713
|
+
componentId: "sc-xuouuf-0"
|
|
15714
|
+
})(["p{margin:0;margin-left:0.5rem;font-size:10px;}width:100%;"]);
|
|
15715
|
+
var Shortcut = /*#__PURE__*/styled.button.withConfig({
|
|
15716
|
+
displayName: "ShortcutsSetter__Shortcut",
|
|
15717
|
+
componentId: "sc-xuouuf-1"
|
|
15718
|
+
})(["width:2.4rem;height:2.4rem;background-color:", ";border:2px solid ", ";border-radius:50%;text-transform:uppercase;font-size:0.7rem;font-weight:bold;display:flex;align-items:center;justify-content:center;span{margin-top:4px;}&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}&:disabled{opacity:0.5;}"], uiColors.lightGray, function (_ref2) {
|
|
15719
|
+
var isBeingSet = _ref2.isBeingSet;
|
|
15720
|
+
return isBeingSet ? uiColors.yellow : uiColors.darkGray;
|
|
15721
|
+
}, uiColors.darkGray, uiColors.gray);
|
|
15722
|
+
var List = /*#__PURE__*/styled.div.withConfig({
|
|
15723
|
+
displayName: "ShortcutsSetter__List",
|
|
15724
|
+
componentId: "sc-xuouuf-2"
|
|
15725
|
+
})(["width:100%;display:flex;align-items:center;gap:0.4rem;box-sizing:border-box;margin:0 !important;flex-wrap:wrap;padding:0.3rem;padding-bottom:1rem;"]);
|
|
15726
|
+
|
|
15644
15727
|
var RangeSliderType;
|
|
15645
15728
|
(function (RangeSliderType) {
|
|
15646
15729
|
RangeSliderType["Slider"] = "rpgui-slider";
|
|
@@ -15796,88 +15879,33 @@ var CloseButton$3 = /*#__PURE__*/styled.div.withConfig({
|
|
|
15796
15879
|
componentId: "sc-yfdtpn-3"
|
|
15797
15880
|
})(["position:absolute;top:3px;right:0px;color:white;z-index:22;font-size:0.8rem;"]);
|
|
15798
15881
|
|
|
15799
|
-
var
|
|
15800
|
-
var
|
|
15801
|
-
|
|
15802
|
-
|
|
15803
|
-
|
|
15804
|
-
|
|
15805
|
-
|
|
15806
|
-
|
|
15807
|
-
|
|
15808
|
-
|
|
15809
|
-
|
|
15810
|
-
var payload = (_shortcuts$index2 = shortcuts[index]) == null ? void 0 : _shortcuts$index2.payload;
|
|
15811
|
-
if (!payload) return null;
|
|
15812
|
-
return React.createElement(SpriteFromAtlas, {
|
|
15813
|
-
atlasIMG: atlasIMG,
|
|
15814
|
-
atlasJSON: atlasJSON,
|
|
15815
|
-
spriteKey: getItemTextureKeyPath({
|
|
15816
|
-
key: payload.texturePath,
|
|
15817
|
-
texturePath: payload.texturePath,
|
|
15818
|
-
stackQty: payload.stackQty || 1,
|
|
15819
|
-
isStackable: payload.isStackable
|
|
15820
|
-
}, atlasJSON),
|
|
15821
|
-
width: 32,
|
|
15822
|
-
height: 32,
|
|
15823
|
-
imgScale: 1.2,
|
|
15824
|
-
imgStyle: {
|
|
15825
|
-
left: '3px'
|
|
15826
|
-
}
|
|
15882
|
+
var ItemQuantitySelectorModal = function ItemQuantitySelectorModal(_ref) {
|
|
15883
|
+
var quantitySelect = _ref.quantitySelect,
|
|
15884
|
+
setQuantitySelect = _ref.setQuantitySelect;
|
|
15885
|
+
return React.createElement(ModalPortal, null, React.createElement(QuantitySelectorContainer, null, React.createElement(ItemQuantitySelector, {
|
|
15886
|
+
quantity: quantitySelect.maxQuantity,
|
|
15887
|
+
onConfirm: function onConfirm(quantity) {
|
|
15888
|
+
quantitySelect.callback(quantity);
|
|
15889
|
+
setQuantitySelect({
|
|
15890
|
+
isOpen: false,
|
|
15891
|
+
maxQuantity: 1,
|
|
15892
|
+
callback: function callback() {}
|
|
15827
15893
|
});
|
|
15828
|
-
}
|
|
15829
|
-
|
|
15830
|
-
|
|
15831
|
-
|
|
15832
|
-
|
|
15833
|
-
|
|
15834
|
-
|
|
15835
|
-
return React.createElement(SpriteFromAtlas, {
|
|
15836
|
-
atlasIMG: _payload.atlasIMG,
|
|
15837
|
-
atlasJSON: _payload.atlasJSON,
|
|
15838
|
-
spriteKey: (_payload$texturePath = _payload.texturePath) != null ? _payload$texturePath : '',
|
|
15839
|
-
width: IMAGE_SIZE,
|
|
15840
|
-
height: IMAGE_SIZE,
|
|
15841
|
-
imgScale: IMAGE_SCALE,
|
|
15842
|
-
centered: true,
|
|
15843
|
-
borderRadius: "50%"
|
|
15894
|
+
},
|
|
15895
|
+
onClose: function onClose() {
|
|
15896
|
+
quantitySelect.callback(-1);
|
|
15897
|
+
setQuantitySelect({
|
|
15898
|
+
isOpen: false,
|
|
15899
|
+
maxQuantity: 1,
|
|
15900
|
+
callback: function callback() {}
|
|
15844
15901
|
});
|
|
15845
15902
|
}
|
|
15846
|
-
return null;
|
|
15847
|
-
};
|
|
15848
|
-
return React.createElement(Container$j, null, React.createElement("p", null, "Shortcuts:"), React.createElement(List, {
|
|
15849
|
-
id: "shortcuts_list"
|
|
15850
|
-
}, Array.from({
|
|
15851
|
-
length: 12
|
|
15852
|
-
}).map(function (_, i) {
|
|
15853
|
-
return React.createElement(Shortcut, {
|
|
15854
|
-
key: i,
|
|
15855
|
-
onPointerDown: function onPointerDown() {
|
|
15856
|
-
if (settingShortcutIndex !== -1) setSettingShortcutIndex(-1);
|
|
15857
|
-
removeShortcut(i);
|
|
15858
|
-
if (settingShortcutIndex === -1 && (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)) setSettingShortcutIndex(i);
|
|
15859
|
-
},
|
|
15860
|
-
disabled: settingShortcutIndex !== -1 && settingShortcutIndex !== i,
|
|
15861
|
-
isBeingSet: settingShortcutIndex === i,
|
|
15862
|
-
id: "shortcutSetter_" + i
|
|
15863
|
-
}, getContent(i));
|
|
15864
15903
|
})));
|
|
15865
15904
|
};
|
|
15866
|
-
var
|
|
15867
|
-
displayName: "
|
|
15868
|
-
componentId: "sc-
|
|
15869
|
-
})(["
|
|
15870
|
-
var Shortcut = /*#__PURE__*/styled.button.withConfig({
|
|
15871
|
-
displayName: "ShortcutsSetter__Shortcut",
|
|
15872
|
-
componentId: "sc-xuouuf-1"
|
|
15873
|
-
})(["width:2.4rem;height:2.4rem;background-color:", ";border:2px solid ", ";border-radius:50%;text-transform:uppercase;font-size:0.7rem;font-weight:bold;display:flex;align-items:center;justify-content:center;span{margin-top:4px;}&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}&:disabled{opacity:0.5;}"], uiColors.lightGray, function (_ref2) {
|
|
15874
|
-
var isBeingSet = _ref2.isBeingSet;
|
|
15875
|
-
return isBeingSet ? uiColors.yellow : uiColors.darkGray;
|
|
15876
|
-
}, uiColors.darkGray, uiColors.gray);
|
|
15877
|
-
var List = /*#__PURE__*/styled.div.withConfig({
|
|
15878
|
-
displayName: "ShortcutsSetter__List",
|
|
15879
|
-
componentId: "sc-xuouuf-2"
|
|
15880
|
-
})(["width:100%;display:flex;align-items:center;gap:0.4rem;box-sizing:border-box;margin:0 !important;flex-wrap:wrap;padding:0.3rem;padding-bottom:1rem;"]);
|
|
15905
|
+
var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
15906
|
+
displayName: "ItemQuantitySelectorModal__QuantitySelectorContainer",
|
|
15907
|
+
componentId: "sc-1b8cosc-0"
|
|
15908
|
+
})(["position:absolute;top:0;left:0;width:100vw;height:100vh;z-index:100;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,0.5);"]);
|
|
15881
15909
|
|
|
15882
15910
|
var ItemContainer$1 = function ItemContainer(_ref) {
|
|
15883
15911
|
var itemContainer = _ref.itemContainer,
|
|
@@ -15993,34 +16021,15 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15993
16021
|
atlasJSON: atlasJSON
|
|
15994
16022
|
}), React.createElement(ItemsContainer, {
|
|
15995
16023
|
className: "item-container-body"
|
|
15996
|
-
}, onRenderSlots())), quantitySelect.isOpen && React.createElement(
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
|
|
16000
|
-
setQuantitySelect({
|
|
16001
|
-
isOpen: false,
|
|
16002
|
-
maxQuantity: 1,
|
|
16003
|
-
callback: function callback() {}
|
|
16004
|
-
});
|
|
16005
|
-
},
|
|
16006
|
-
onClose: function onClose() {
|
|
16007
|
-
quantitySelect.callback(-1);
|
|
16008
|
-
setQuantitySelect({
|
|
16009
|
-
isOpen: false,
|
|
16010
|
-
maxQuantity: 1,
|
|
16011
|
-
callback: function callback() {}
|
|
16012
|
-
});
|
|
16013
|
-
}
|
|
16014
|
-
}))));
|
|
16024
|
+
}, onRenderSlots())), quantitySelect.isOpen && React.createElement(ItemQuantitySelectorModal, {
|
|
16025
|
+
quantitySelect: quantitySelect,
|
|
16026
|
+
setQuantitySelect: setQuantitySelect
|
|
16027
|
+
}));
|
|
16015
16028
|
};
|
|
16016
16029
|
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
16017
16030
|
displayName: "ItemContainer__ItemsContainer",
|
|
16018
16031
|
componentId: "sc-15y5p9l-0"
|
|
16019
16032
|
})(["display:flex;justify-content:center;flex-wrap:wrap;max-height:270px;overflow-y:auto;overflow-x:hidden;width:415px;"]);
|
|
16020
|
-
var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
16021
|
-
displayName: "ItemContainer__QuantitySelectorContainer",
|
|
16022
|
-
componentId: "sc-15y5p9l-1"
|
|
16023
|
-
})(["position:absolute;top:0;left:0;width:100vw;height:100vh;z-index:100;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,0.5);"]);
|
|
16024
16033
|
|
|
16025
16034
|
var LeaderboardTable = function LeaderboardTable(props) {
|
|
16026
16035
|
var items = props.items,
|