@rpg-engine/long-bow 0.5.7 → 0.5.9

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.
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { IRankingTopCharacterEntry, IRankingTopSkillEntry } from '@rpg-engine/shared';
3
+ export interface ILeaderboardProps {
4
+ items: Set<IRankingTopCharacterEntry> | Set<IRankingTopSkillEntry> | null;
5
+ onChangeClassType: (value: string) => void;
6
+ onChangeRankType: (value: string) => void;
7
+ onChangeSkillType: (value: string) => void;
8
+ skillOptions: string[];
9
+ rankOptions: string[];
10
+ classOptions: string[];
11
+ rankType: string;
12
+ }
13
+ export declare const Leaderboard: (props: ILeaderboardProps) => JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { IRankingTopCharacterEntry, IRankingTopSkillEntry } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ export interface ILeaderboardLevelProps {
4
+ items: Set<IRankingTopCharacterEntry> | Set<IRankingTopSkillEntry> | 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,124 @@ 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 Leaderboard = function Leaderboard(props) {
15744
+ var items = props.items,
15745
+ onChangeRankType = props.onChangeRankType,
15746
+ onChangeClassType = props.onChangeClassType,
15747
+ rankType = props.rankType,
15748
+ skillOptions = props.skillOptions,
15749
+ onChangeSkillType = props.onChangeSkillType,
15750
+ classOptions = props.classOptions,
15751
+ rankOptions = props.rankOptions;
15752
+ var itemsContainer = React.useRef(null);
15753
+ React.useEffect(function () {
15754
+ var _itemsContainer$curre;
15755
+ (_itemsContainer$curre = itemsContainer.current) == null ? void 0 : _itemsContainer$curre.scrollTo(0, 0);
15756
+ }, []);
15757
+ var rankTypeOptions = rankOptions.map(function (itemType, index) {
15758
+ return {
15759
+ id: index + 1,
15760
+ value: itemType,
15761
+ option: itemType
15762
+ };
15763
+ });
15764
+ var skillTypeOptions = skillOptions.map(function (itemType, index) {
15765
+ return {
15766
+ id: index + 1,
15767
+ value: itemType,
15768
+ option: itemType
15769
+ };
15770
+ });
15771
+ var classTypeOptions = classOptions.map(function (itemType, index) {
15772
+ return {
15773
+ id: index + 1,
15774
+ value: itemType,
15775
+ option: itemType
15776
+ };
15777
+ });
15778
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(WrapperContainer, null, React__default.createElement(StyledDropdown, {
15779
+ options: rankTypeOptions,
15780
+ onChange: onChangeRankType,
15781
+ width: "80%"
15782
+ }), rankType === 'Class' ? React__default.createElement(StyledDropdown, {
15783
+ options: classTypeOptions,
15784
+ onChange: onChangeClassType,
15785
+ width: "100%"
15786
+ }) : null, rankType === 'Skill' ? React__default.createElement(StyledDropdown, {
15787
+ options: skillTypeOptions,
15788
+ onChange: onChangeSkillType,
15789
+ width: "100%"
15790
+ }) : null), React__default.createElement(ItemComponentScrollWrapper, {
15791
+ id: "LeaderboardContainer",
15792
+ ref: itemsContainer
15793
+ }, React__default.createElement(TableWrapper, null, React__default.createElement(LeaderboardTable, {
15794
+ items: items,
15795
+ rankType: rankType
15796
+ }))));
15797
+ };
15798
+ var WrapperContainer = /*#__PURE__*/styled.div.withConfig({
15799
+ displayName: "Leaderboard__WrapperContainer",
15800
+ componentId: "sc-1wdsq7i-0"
15801
+ })(["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;}"]);
15802
+ var StyledDropdown = /*#__PURE__*/styled(Dropdown).withConfig({
15803
+ displayName: "Leaderboard__StyledDropdown",
15804
+ componentId: "sc-1wdsq7i-1"
15805
+ })(["margin:3px !important;width:170px !important;"]);
15806
+ var ItemComponentScrollWrapper = /*#__PURE__*/styled.div.withConfig({
15807
+ displayName: "Leaderboard__ItemComponentScrollWrapper",
15808
+ componentId: "sc-1wdsq7i-2"
15809
+ })(["overflow-y:scroll;height:390px;width:100%;margin-top:1rem;@media (max-width:950px){height:250px;}"]);
15810
+ var TableWrapper = /*#__PURE__*/styled.table.withConfig({
15811
+ displayName: "Leaderboard__TableWrapper",
15812
+ componentId: "sc-1wdsq7i-3"
15813
+ })(["margin:auto;width:100%;"]);
15814
+
15697
15815
  var ListMenu = function ListMenu(_ref) {
15698
15816
  var options = _ref.options,
15699
15817
  onSelected = _ref.onSelected,
@@ -16054,19 +16172,19 @@ var BuyPanel = function BuyPanel(_ref) {
16054
16172
  className: "big-input",
16055
16173
  onBlur: enableHotkeys,
16056
16174
  onFocus: disableHotkeys
16057
- }))), React__default.createElement(WrapperContainer, null, React__default.createElement(StyledDropdown, {
16175
+ }))), React__default.createElement(WrapperContainer$1, null, React__default.createElement(StyledDropdown$1, {
16058
16176
  options: itemTypeOptions,
16059
16177
  onChange: onChangeType,
16060
16178
  width: "95%"
16061
- }), React__default.createElement(StyledDropdown, {
16179
+ }), React__default.createElement(StyledDropdown$1, {
16062
16180
  options: itemRarityOptions,
16063
16181
  onChange: onChangeRarity,
16064
16182
  width: "95%"
16065
- }), React__default.createElement(StyledDropdown, {
16183
+ }), React__default.createElement(StyledDropdown$1, {
16066
16184
  options: orderByOptions,
16067
16185
  onChange: onChangeOrder,
16068
16186
  width: "100%"
16069
- }))), React__default.createElement(ItemComponentScrollWrapper, {
16187
+ }))), React__default.createElement(ItemComponentScrollWrapper$1, {
16070
16188
  id: "MarketContainer",
16071
16189
  ref: itemsContainer
16072
16190
  }, items == null ? void 0 : items.map(function (_ref2, index) {
@@ -16098,15 +16216,15 @@ var FilterInputsWrapper = /*#__PURE__*/styled.div.withConfig({
16098
16216
  displayName: "BuyPanel__FilterInputsWrapper",
16099
16217
  componentId: "sc-1si8t7i-2"
16100
16218
  })(["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({
16219
+ var WrapperContainer$1 = /*#__PURE__*/styled.div.withConfig({
16102
16220
  displayName: "BuyPanel__WrapperContainer",
16103
16221
  componentId: "sc-1si8t7i-3"
16104
16222
  })(["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({
16223
+ var ItemComponentScrollWrapper$1 = /*#__PURE__*/styled.div.withConfig({
16106
16224
  displayName: "BuyPanel__ItemComponentScrollWrapper",
16107
16225
  componentId: "sc-1si8t7i-4"
16108
16226
  })(["overflow-y:scroll;height:390px;width:100%;margin-top:1rem;@media (max-width:950px){height:250px;}"]);
16109
- var StyledDropdown = /*#__PURE__*/styled(Dropdown).withConfig({
16227
+ var StyledDropdown$1 = /*#__PURE__*/styled(Dropdown).withConfig({
16110
16228
  displayName: "BuyPanel__StyledDropdown",
16111
16229
  componentId: "sc-1si8t7i-5"
16112
16230
  })(["margin:3px !important;width:170px !important;"]);
@@ -16208,7 +16326,7 @@ var ManagmentPanel = function ManagmentPanel(_ref) {
16208
16326
  onPointerDown: function onPointerDown() {
16209
16327
  return availableGold > 0 && onMoneyWithdraw();
16210
16328
  }
16211
- }, "Withdraw")))), React__default.createElement(ItemComponentScrollWrapper$1, {
16329
+ }, "Withdraw")))), React__default.createElement(ItemComponentScrollWrapper$2, {
16212
16330
  id: "MarketContainer",
16213
16331
  ref: itemsContainer
16214
16332
  }, items == null ? void 0 : items.map(function (_ref2, index) {
@@ -16242,7 +16360,7 @@ var InnerOptionsWrapper = /*#__PURE__*/styled.div.withConfig({
16242
16360
  displayName: "ManagmentPanel__InnerOptionsWrapper",
16243
16361
  componentId: "sc-1yyi6jn-3"
16244
16362
  })(["display:flex;justify-content:space-between;flex-direction:column;height:100%;"]);
16245
- var ItemComponentScrollWrapper$1 = /*#__PURE__*/styled.div.withConfig({
16363
+ var ItemComponentScrollWrapper$2 = /*#__PURE__*/styled.div.withConfig({
16246
16364
  displayName: "ManagmentPanel__ItemComponentScrollWrapper",
16247
16365
  componentId: "sc-1yyi6jn-4"
16248
16366
  })(["overflow-y:scroll;height:390px;width:100%;margin-top:1rem;@media (max-width:950px){height:250px;}"]);
@@ -18191,6 +18309,7 @@ exports.InputRadio = InputRadio$1;
18191
18309
  exports.ItemContainer = ItemContainer$1;
18192
18310
  exports.ItemSelector = ItemSelector;
18193
18311
  exports.ItemSlot = ItemSlot;
18312
+ exports.Leaderboard = Leaderboard;
18194
18313
  exports.ListMenu = ListMenu;
18195
18314
  exports.Marketplace = Marketplace;
18196
18315
  exports.MarketplaceRows = MarketplaceRows;