@rpg-engine/long-bow 0.5.7 → 0.5.8
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/Leaderboard/Leaderboard.d.ts +11 -0
- package/dist/components/Leaderboard/LeaderboardTable.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +126 -9
- 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 +126 -10
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/mocks/leaderboard.mocks.d.ts +4 -0
- package/dist/stories/Leaderboard.stories.d.ts +7 -0
- package/package.json +2 -2
- package/src/components/Leaderboard/Leaderboard.tsx +111 -0
- package/src/components/Leaderboard/LeaderboardTable.tsx +97 -0
- package/src/index.tsx +1 -0
- package/src/mocks/leaderboard.mocks.ts +110 -0
- package/src/stories/Leaderboard.stories.tsx +57 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TopCharacterEntry, TopSkillEntry } from '@rpg-engine/shared';
|
|
3
|
+
export interface ILeaderboardProps {
|
|
4
|
+
items: Set<TopCharacterEntry> | Set<TopSkillEntry> | null;
|
|
5
|
+
onChangeClassType: (value: string) => void;
|
|
6
|
+
onChangeRankType: (value: string) => void;
|
|
7
|
+
onChangeSkillType: (value: string) => void;
|
|
8
|
+
skills: string[];
|
|
9
|
+
rankType: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const Leaderboard: (props: ILeaderboardProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TopCharacterEntry, TopSkillEntry } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ILeaderboardLevelProps {
|
|
4
|
+
items: Set<TopCharacterEntry> | Set<TopSkillEntry> | null;
|
|
5
|
+
rankType: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const LeaderboardTable: React.FC<ILeaderboardLevelProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './components/Input';
|
|
|
15
15
|
export { ErrorBoundary } from './components/Item/Inventory/ErrorBoundary';
|
|
16
16
|
export * from './components/Item/Inventory/ItemContainer';
|
|
17
17
|
export * from './components/Item/Inventory/ItemSlot';
|
|
18
|
+
export * from './components/Leaderboard/Leaderboard';
|
|
18
19
|
export * from './components/ListMenu';
|
|
19
20
|
export * from './components/Marketplace/Marketplace';
|
|
20
21
|
export * from './components/Marketplace/MarketplaceRows';
|
|
@@ -15694,6 +15694,122 @@ var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
15694
15694
|
componentId: "sc-15y5p9l-1"
|
|
15695
15695
|
})(["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);"]);
|
|
15696
15696
|
|
|
15697
|
+
var LeaderboardTable = function LeaderboardTable(props) {
|
|
15698
|
+
var items = props.items,
|
|
15699
|
+
rankType = props.rankType;
|
|
15700
|
+
if (!items) return null;
|
|
15701
|
+
function isTopSkillEntry(entry) {
|
|
15702
|
+
return 'skill' in entry;
|
|
15703
|
+
}
|
|
15704
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement("thead", null, React__default.createElement(TableRowWrapper, null, React__default.createElement(TableRowValue, null, React__default.createElement("p", null, React__default.createElement(Ellipsis, {
|
|
15705
|
+
maxLines: 1,
|
|
15706
|
+
maxWidth: "200px",
|
|
15707
|
+
fontSize: "14px"
|
|
15708
|
+
}, "Name"))), rankType === 'Skill' ? React__default.createElement(TableRowValue, null, React__default.createElement("p", null, React__default.createElement(Ellipsis, {
|
|
15709
|
+
maxLines: 1,
|
|
15710
|
+
maxWidth: "200px",
|
|
15711
|
+
fontSize: "14px"
|
|
15712
|
+
}, "Skill"))) : null, React__default.createElement(TableRowValue, null, React__default.createElement("p", null, React__default.createElement(Ellipsis, {
|
|
15713
|
+
maxLines: 1,
|
|
15714
|
+
maxWidth: "200px",
|
|
15715
|
+
fontSize: "14px"
|
|
15716
|
+
}, "Level"))))), React__default.createElement("tbody", null, Array.from(items).map(function (entry) {
|
|
15717
|
+
return React__default.createElement(TableRowWrapper, {
|
|
15718
|
+
key: entry.name
|
|
15719
|
+
}, React__default.createElement(TableRowValue, null, React__default.createElement("p", null, React__default.createElement(Ellipsis, {
|
|
15720
|
+
maxLines: 1,
|
|
15721
|
+
maxWidth: "200px",
|
|
15722
|
+
fontSize: "10px"
|
|
15723
|
+
}, entry.name))), isTopSkillEntry(entry) ? React__default.createElement(TableRowValue, null, React__default.createElement("p", null, React__default.createElement(Ellipsis, {
|
|
15724
|
+
maxLines: 1,
|
|
15725
|
+
maxWidth: "200px",
|
|
15726
|
+
fontSize: "10px"
|
|
15727
|
+
}, entry.skill))) : null, React__default.createElement(TableRowValue, null, React__default.createElement("p", null, React__default.createElement(Ellipsis, {
|
|
15728
|
+
maxLines: 1,
|
|
15729
|
+
maxWidth: "200px",
|
|
15730
|
+
fontSize: "10px"
|
|
15731
|
+
}, entry.level))));
|
|
15732
|
+
})));
|
|
15733
|
+
};
|
|
15734
|
+
var TableRowWrapper = /*#__PURE__*/styled.tr.withConfig({
|
|
15735
|
+
displayName: "LeaderboardTable__TableRowWrapper",
|
|
15736
|
+
componentId: "sc-kk017f-0"
|
|
15737
|
+
})(["margin:auto;padding:0.5rem;&:hover{background-color:", ";}p{font-size:0.8rem;}"], uiColors.darkGray);
|
|
15738
|
+
var TableRowValue = /*#__PURE__*/styled.td.withConfig({
|
|
15739
|
+
displayName: "LeaderboardTable__TableRowValue",
|
|
15740
|
+
componentId: "sc-kk017f-1"
|
|
15741
|
+
})(["padding:0 20px;"]);
|
|
15742
|
+
|
|
15743
|
+
var rankTypeOptions = /*#__PURE__*/['Level', 'Class', 'Skill'].map(function (itemType, index) {
|
|
15744
|
+
return {
|
|
15745
|
+
id: index + 1,
|
|
15746
|
+
value: itemType,
|
|
15747
|
+
option: itemType
|
|
15748
|
+
};
|
|
15749
|
+
});
|
|
15750
|
+
var classTypeOptions = /*#__PURE__*/Object.keys(shared.CharacterClass).map(function (itemType, index) {
|
|
15751
|
+
return {
|
|
15752
|
+
id: index + 1,
|
|
15753
|
+
value: itemType,
|
|
15754
|
+
option: itemType
|
|
15755
|
+
};
|
|
15756
|
+
});
|
|
15757
|
+
var Leaderboard = function Leaderboard(props) {
|
|
15758
|
+
var items = props.items,
|
|
15759
|
+
onChangeRankType = props.onChangeRankType,
|
|
15760
|
+
onChangeClassType = props.onChangeClassType,
|
|
15761
|
+
rankType = props.rankType,
|
|
15762
|
+
skills = props.skills,
|
|
15763
|
+
onChangeSkillType = props.onChangeSkillType;
|
|
15764
|
+
var itemsContainer = React.useRef(null);
|
|
15765
|
+
React.useEffect(function () {
|
|
15766
|
+
var _itemsContainer$curre;
|
|
15767
|
+
(_itemsContainer$curre = itemsContainer.current) == null ? void 0 : _itemsContainer$curre.scrollTo(0, 0);
|
|
15768
|
+
}, []);
|
|
15769
|
+
var skillTypeOptions = skills.map(function (itemType, index) {
|
|
15770
|
+
return {
|
|
15771
|
+
id: index + 1,
|
|
15772
|
+
value: itemType,
|
|
15773
|
+
option: itemType
|
|
15774
|
+
};
|
|
15775
|
+
});
|
|
15776
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(WrapperContainer, null, React__default.createElement(StyledDropdown, {
|
|
15777
|
+
options: rankTypeOptions,
|
|
15778
|
+
onChange: onChangeRankType,
|
|
15779
|
+
width: "80%"
|
|
15780
|
+
}), rankType === 'Class' ? React__default.createElement(StyledDropdown, {
|
|
15781
|
+
options: classTypeOptions,
|
|
15782
|
+
onChange: onChangeClassType,
|
|
15783
|
+
width: "100%"
|
|
15784
|
+
}) : null, rankType === 'Skill' ? React__default.createElement(StyledDropdown, {
|
|
15785
|
+
options: skillTypeOptions,
|
|
15786
|
+
onChange: onChangeSkillType,
|
|
15787
|
+
width: "100%"
|
|
15788
|
+
}) : null), React__default.createElement(ItemComponentScrollWrapper, {
|
|
15789
|
+
id: "LeaderboardContainer",
|
|
15790
|
+
ref: itemsContainer
|
|
15791
|
+
}, React__default.createElement(TableWrapper, null, React__default.createElement(LeaderboardTable, {
|
|
15792
|
+
items: items,
|
|
15793
|
+
rankType: rankType
|
|
15794
|
+
}))));
|
|
15795
|
+
};
|
|
15796
|
+
var WrapperContainer = /*#__PURE__*/styled.div.withConfig({
|
|
15797
|
+
displayName: "Leaderboard__WrapperContainer",
|
|
15798
|
+
componentId: "sc-1wdsq7i-0"
|
|
15799
|
+
})(["display:grid;grid-template-columns:50% 50%;justify-content:space-between;width:calc(100% - 40px);margin-left:10px;.rpgui-content .rpgui-dropdown-imp-header{padding:0px 10px 0 !important;}"]);
|
|
15800
|
+
var StyledDropdown = /*#__PURE__*/styled(Dropdown).withConfig({
|
|
15801
|
+
displayName: "Leaderboard__StyledDropdown",
|
|
15802
|
+
componentId: "sc-1wdsq7i-1"
|
|
15803
|
+
})(["margin:3px !important;width:170px !important;"]);
|
|
15804
|
+
var ItemComponentScrollWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
15805
|
+
displayName: "Leaderboard__ItemComponentScrollWrapper",
|
|
15806
|
+
componentId: "sc-1wdsq7i-2"
|
|
15807
|
+
})(["overflow-y:scroll;height:390px;width:100%;margin-top:1rem;@media (max-width:950px){height:250px;}"]);
|
|
15808
|
+
var TableWrapper = /*#__PURE__*/styled.table.withConfig({
|
|
15809
|
+
displayName: "Leaderboard__TableWrapper",
|
|
15810
|
+
componentId: "sc-1wdsq7i-3"
|
|
15811
|
+
})(["margin:auto;width:100%;"]);
|
|
15812
|
+
|
|
15697
15813
|
var ListMenu = function ListMenu(_ref) {
|
|
15698
15814
|
var options = _ref.options,
|
|
15699
15815
|
onSelected = _ref.onSelected,
|
|
@@ -16054,19 +16170,19 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
16054
16170
|
className: "big-input",
|
|
16055
16171
|
onBlur: enableHotkeys,
|
|
16056
16172
|
onFocus: disableHotkeys
|
|
16057
|
-
}))), React__default.createElement(WrapperContainer, null, React__default.createElement(StyledDropdown, {
|
|
16173
|
+
}))), React__default.createElement(WrapperContainer$1, null, React__default.createElement(StyledDropdown$1, {
|
|
16058
16174
|
options: itemTypeOptions,
|
|
16059
16175
|
onChange: onChangeType,
|
|
16060
16176
|
width: "95%"
|
|
16061
|
-
}), React__default.createElement(StyledDropdown, {
|
|
16177
|
+
}), React__default.createElement(StyledDropdown$1, {
|
|
16062
16178
|
options: itemRarityOptions,
|
|
16063
16179
|
onChange: onChangeRarity,
|
|
16064
16180
|
width: "95%"
|
|
16065
|
-
}), React__default.createElement(StyledDropdown, {
|
|
16181
|
+
}), React__default.createElement(StyledDropdown$1, {
|
|
16066
16182
|
options: orderByOptions,
|
|
16067
16183
|
onChange: onChangeOrder,
|
|
16068
16184
|
width: "100%"
|
|
16069
|
-
}))), React__default.createElement(ItemComponentScrollWrapper, {
|
|
16185
|
+
}))), React__default.createElement(ItemComponentScrollWrapper$1, {
|
|
16070
16186
|
id: "MarketContainer",
|
|
16071
16187
|
ref: itemsContainer
|
|
16072
16188
|
}, items == null ? void 0 : items.map(function (_ref2, index) {
|
|
@@ -16098,15 +16214,15 @@ var FilterInputsWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
16098
16214
|
displayName: "BuyPanel__FilterInputsWrapper",
|
|
16099
16215
|
componentId: "sc-1si8t7i-2"
|
|
16100
16216
|
})(["width:95%;display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;margin-left:10px;gap:5px;color:white;flex-wrap:wrap;p{width:auto;margin:0;}input{width:75px;height:10px;}.big-input{width:130px;}"]);
|
|
16101
|
-
var WrapperContainer = /*#__PURE__*/styled.div.withConfig({
|
|
16217
|
+
var WrapperContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
16102
16218
|
displayName: "BuyPanel__WrapperContainer",
|
|
16103
16219
|
componentId: "sc-1si8t7i-3"
|
|
16104
16220
|
})(["display:grid;grid-template-columns:40% 30% 30%;justify-content:space-between;width:calc(100% - 40px);margin-left:10px;.rpgui-content .rpgui-dropdown-imp-header{padding:0px 10px 0 !important;}"]);
|
|
16105
|
-
var ItemComponentScrollWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
16221
|
+
var ItemComponentScrollWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
16106
16222
|
displayName: "BuyPanel__ItemComponentScrollWrapper",
|
|
16107
16223
|
componentId: "sc-1si8t7i-4"
|
|
16108
16224
|
})(["overflow-y:scroll;height:390px;width:100%;margin-top:1rem;@media (max-width:950px){height:250px;}"]);
|
|
16109
|
-
var StyledDropdown = /*#__PURE__*/styled(Dropdown).withConfig({
|
|
16225
|
+
var StyledDropdown$1 = /*#__PURE__*/styled(Dropdown).withConfig({
|
|
16110
16226
|
displayName: "BuyPanel__StyledDropdown",
|
|
16111
16227
|
componentId: "sc-1si8t7i-5"
|
|
16112
16228
|
})(["margin:3px !important;width:170px !important;"]);
|
|
@@ -16208,7 +16324,7 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
|
|
|
16208
16324
|
onPointerDown: function onPointerDown() {
|
|
16209
16325
|
return availableGold > 0 && onMoneyWithdraw();
|
|
16210
16326
|
}
|
|
16211
|
-
}, "Withdraw")))), React__default.createElement(ItemComponentScrollWrapper$
|
|
16327
|
+
}, "Withdraw")))), React__default.createElement(ItemComponentScrollWrapper$2, {
|
|
16212
16328
|
id: "MarketContainer",
|
|
16213
16329
|
ref: itemsContainer
|
|
16214
16330
|
}, items == null ? void 0 : items.map(function (_ref2, index) {
|
|
@@ -16242,7 +16358,7 @@ var InnerOptionsWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
16242
16358
|
displayName: "ManagmentPanel__InnerOptionsWrapper",
|
|
16243
16359
|
componentId: "sc-1yyi6jn-3"
|
|
16244
16360
|
})(["display:flex;justify-content:space-between;flex-direction:column;height:100%;"]);
|
|
16245
|
-
var ItemComponentScrollWrapper$
|
|
16361
|
+
var ItemComponentScrollWrapper$2 = /*#__PURE__*/styled.div.withConfig({
|
|
16246
16362
|
displayName: "ManagmentPanel__ItemComponentScrollWrapper",
|
|
16247
16363
|
componentId: "sc-1yyi6jn-4"
|
|
16248
16364
|
})(["overflow-y:scroll;height:390px;width:100%;margin-top:1rem;@media (max-width:950px){height:250px;}"]);
|
|
@@ -18191,6 +18307,7 @@ exports.InputRadio = InputRadio$1;
|
|
|
18191
18307
|
exports.ItemContainer = ItemContainer$1;
|
|
18192
18308
|
exports.ItemSelector = ItemSelector;
|
|
18193
18309
|
exports.ItemSlot = ItemSlot;
|
|
18310
|
+
exports.Leaderboard = Leaderboard;
|
|
18194
18311
|
exports.ListMenu = ListMenu;
|
|
18195
18312
|
exports.Marketplace = Marketplace;
|
|
18196
18313
|
exports.MarketplaceRows = MarketplaceRows;
|