@rpg-engine/long-bow 0.8.206 → 0.8.207

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.
@@ -4,6 +4,8 @@ export interface ICharacterListingModalProps {
4
4
  isOpen: boolean;
5
5
  onClose: () => void;
6
6
  accountCharacters: ICharacter[];
7
+ /** ID of the currently active/playing character — cannot be listed */
8
+ activeCharacterId?: string;
7
9
  /** Items atlas — for UI sprites like the DC coin */
8
10
  atlasJSON: any;
9
11
  atlasIMG: any;
@@ -10,6 +10,8 @@ export interface IMyCharacterListingsPanelProps {
10
10
  /** Characters that can be listed (used for the List a Character modal) */
11
11
  accountCharacters: ICharacter[];
12
12
  onCharacterList: (characterId: string, price: number) => void;
13
+ /** ID of the currently active character */
14
+ activeCharacterId?: string;
13
15
  /** Items atlas — for UI sprites like the DC coin */
14
16
  atlasJSON: any;
15
17
  atlasIMG: any;
@@ -13821,6 +13821,7 @@ var CharacterListingModal = function CharacterListingModal(_ref) {
13821
13821
  var isOpen = _ref.isOpen,
13822
13822
  onClose = _ref.onClose,
13823
13823
  accountCharacters = _ref.accountCharacters,
13824
+ activeCharacterId = _ref.activeCharacterId,
13824
13825
  atlasJSON = _ref.atlasJSON,
13825
13826
  atlasIMG = _ref.atlasIMG,
13826
13827
  characterAtlasJSON = _ref.characterAtlasJSON,
@@ -13844,7 +13845,10 @@ var CharacterListingModal = function CharacterListingModal(_ref) {
13844
13845
  var eligibleCharacters = accountCharacters.filter(function (c) {
13845
13846
  return !c.isListedForSale && !c.tradedAt;
13846
13847
  });
13847
- var canList = !!selectedId && Number(price) > 0;
13848
+ var isActiveCharacter = function isActiveCharacter(c) {
13849
+ return !!activeCharacterId && c._id === activeCharacterId;
13850
+ };
13851
+ var canList = !!selectedId && Number(price) > 0 && selectedId !== activeCharacterId;
13848
13852
  var handleClose = function handleClose() {
13849
13853
  setSelectedId(null);
13850
13854
  setPrice('');
@@ -13886,23 +13890,27 @@ var CharacterListingModal = function CharacterListingModal(_ref) {
13886
13890
  type: "button"
13887
13891
  }, React__default.createElement(fa.FaTimes, null))), React__default.createElement(CharacterList$1, null, eligibleCharacters.length === 0 ? React__default.createElement(EmptyState$6, null, "No eligible characters to list.") : eligibleCharacters.map(function (character) {
13888
13892
  var isSelected = selectedId === character._id;
13893
+ var isActive = isActiveCharacter(character);
13889
13894
  return React__default.createElement(CharacterRow, {
13890
13895
  key: character._id,
13891
- "$selected": isSelected,
13896
+ "$selected": isSelected && !isActive,
13897
+ "$disabled": isActive,
13892
13898
  onPointerDown: function onPointerDown() {
13893
- return setSelectedId(character._id);
13899
+ return !isActive && setSelectedId(character._id);
13894
13900
  },
13895
13901
  role: "radio",
13896
- "aria-checked": isSelected,
13897
- tabIndex: 0,
13902
+ "aria-checked": isSelected && !isActive,
13903
+ "aria-disabled": isActive,
13904
+ tabIndex: isActive ? -1 : 0,
13898
13905
  onKeyDown: function onKeyDown(e) {
13899
- if (e.key === 'Enter' || e.key === ' ') {
13906
+ if (!isActive && (e.key === 'Enter' || e.key === ' ')) {
13900
13907
  e.preventDefault();
13901
13908
  setSelectedId(character._id);
13902
13909
  }
13903
13910
  }
13904
13911
  }, React__default.createElement(RadioCircle$1, {
13905
- "$selected": isSelected
13912
+ "$selected": isSelected && !isActive,
13913
+ "$disabled": isActive
13906
13914
  }), React__default.createElement(SpriteWrapper$3, null, React__default.createElement(SpriteFromAtlas, {
13907
13915
  atlasIMG: characterAtlasIMG,
13908
13916
  atlasJSON: characterAtlasJSON,
@@ -13910,7 +13918,7 @@ var CharacterListingModal = function CharacterListingModal(_ref) {
13910
13918
  imgScale: 2,
13911
13919
  height: 40,
13912
13920
  width: 40
13913
- })), React__default.createElement(CharacterInfo$1, null, React__default.createElement(CharacterName$3, null, character.name || 'Unknown'), React__default.createElement(CharacterMeta$1, null, "Level ", getLevel(character))));
13921
+ })), React__default.createElement(CharacterInfo$1, null, React__default.createElement(CharacterName$3, null, character.name || 'Unknown'), React__default.createElement(CharacterMeta$1, null, "Level ", getLevel(character))), isActive && React__default.createElement(ActiveTag, null, "In-game"));
13914
13922
  })), React__default.createElement(PriceSection$1, null, React__default.createElement(PriceLabel, null, "Set Price (DC)"), React__default.createElement(PriceRow$1, null, React__default.createElement(Input, {
13915
13923
  onChange: function onChange(e) {
13916
13924
  return setPrice(e.target.value);
@@ -13972,76 +13980,94 @@ var CharacterList$1 = /*#__PURE__*/styled__default.div.withConfig({
13972
13980
  var CharacterRow = /*#__PURE__*/styled__default.div.withConfig({
13973
13981
  displayName: "CharacterListingModal__CharacterRow",
13974
13982
  componentId: "sc-1uxkx35-7"
13975
- })(["display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid ", ";border-radius:6px;background:", ";cursor:pointer;transition:border-color 0.15s,background 0.15s;&:hover{border-color:", ";background:", ";}&:focus-visible{outline:2px solid rgba(245,158,11,0.6);outline-offset:2px;}"], function (_ref2) {
13976
- var $selected = _ref2.$selected;
13977
- return $selected ? '#f59e0b' : 'rgba(255,255,255,0.08)';
13983
+ })(["display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid ", ";border-radius:6px;background:", ";cursor:", ";opacity:", ";transition:border-color 0.15s,background 0.15s;&:hover{border-color:", ";background:", ";}&:focus-visible{outline:2px solid rgba(245,158,11,0.6);outline-offset:2px;}"], function (_ref2) {
13984
+ var $selected = _ref2.$selected,
13985
+ $disabled = _ref2.$disabled;
13986
+ return $disabled ? 'rgba(255,255,255,0.04)' : $selected ? '#f59e0b' : 'rgba(255,255,255,0.08)';
13978
13987
  }, function (_ref3) {
13979
- var $selected = _ref3.$selected;
13980
- return $selected ? 'rgba(245,158,11,0.1)' : 'rgba(255,255,255,0.02)';
13988
+ var $selected = _ref3.$selected,
13989
+ $disabled = _ref3.$disabled;
13990
+ return $disabled ? 'rgba(0,0,0,0.15)' : $selected ? 'rgba(245,158,11,0.1)' : 'rgba(255,255,255,0.02)';
13981
13991
  }, function (_ref4) {
13982
- var $selected = _ref4.$selected;
13983
- return $selected ? '#f59e0b' : 'rgba(245,158,11,0.4)';
13992
+ var $disabled = _ref4.$disabled;
13993
+ return $disabled ? 'not-allowed' : 'pointer';
13984
13994
  }, function (_ref5) {
13985
- var $selected = _ref5.$selected;
13986
- return $selected ? 'rgba(245,158,11,0.1)' : 'rgba(245,158,11,0.05)';
13995
+ var $disabled = _ref5.$disabled;
13996
+ return $disabled ? 0.5 : 1;
13997
+ }, function (_ref6) {
13998
+ var $selected = _ref6.$selected,
13999
+ $disabled = _ref6.$disabled;
14000
+ return $disabled ? 'rgba(255,255,255,0.04)' : $selected ? '#f59e0b' : 'rgba(245,158,11,0.4)';
14001
+ }, function (_ref7) {
14002
+ var $selected = _ref7.$selected,
14003
+ $disabled = _ref7.$disabled;
14004
+ return $disabled ? 'rgba(0,0,0,0.15)' : $selected ? 'rgba(245,158,11,0.1)' : 'rgba(245,158,11,0.05)';
13987
14005
  });
13988
14006
  var RadioCircle$1 = /*#__PURE__*/styled__default.div.withConfig({
13989
14007
  displayName: "CharacterListingModal__RadioCircle",
13990
14008
  componentId: "sc-1uxkx35-8"
13991
- })(["width:14px;height:14px;border-radius:50%;border:2px solid ", ";flex-shrink:0;display:flex;align-items:center;justify-content:center;&::after{content:'';width:6px;height:6px;border-radius:50%;background:#f59e0b;opacity:", ";transition:opacity 0.15s;}"], function (_ref6) {
13992
- var $selected = _ref6.$selected;
13993
- return $selected ? '#f59e0b' : 'rgba(255,255,255,0.4)';
13994
- }, function (_ref7) {
13995
- var $selected = _ref7.$selected;
14009
+ })(["width:14px;height:14px;border-radius:50%;border:2px solid ", ";flex-shrink:0;display:flex;align-items:center;justify-content:center;&::after{content:'';width:6px;height:6px;border-radius:50%;background:", ";opacity:", ";transition:opacity 0.15s;}"], function (_ref8) {
14010
+ var $selected = _ref8.$selected,
14011
+ $disabled = _ref8.$disabled;
14012
+ return $disabled ? 'rgba(255,255,255,0.15)' : $selected ? '#f59e0b' : 'rgba(255,255,255,0.4)';
14013
+ }, function (_ref9) {
14014
+ var $disabled = _ref9.$disabled;
14015
+ return $disabled ? 'rgba(255,255,255,0.15)' : '#f59e0b';
14016
+ }, function (_ref10) {
14017
+ var $selected = _ref10.$selected;
13996
14018
  return $selected ? 1 : 0;
13997
14019
  });
14020
+ var ActiveTag = /*#__PURE__*/styled__default.span.withConfig({
14021
+ displayName: "CharacterListingModal__ActiveTag",
14022
+ componentId: "sc-1uxkx35-9"
14023
+ })(["font-family:'Press Start 2P',cursive !important;font-size:0.35rem !important;color:#666 !important;background:rgba(255,255,255,0.06);padding:3px 6px;border-radius:3px;white-space:nowrap;margin-left:auto;"]);
13998
14024
  var SpriteWrapper$3 = /*#__PURE__*/styled__default.div.withConfig({
13999
14025
  displayName: "CharacterListingModal__SpriteWrapper",
14000
- componentId: "sc-1uxkx35-9"
14026
+ componentId: "sc-1uxkx35-10"
14001
14027
  })(["display:flex;align-items:center;justify-content:center;image-rendering:pixelated;flex-shrink:0;width:40px;height:40px;"]);
14002
14028
  var CharacterInfo$1 = /*#__PURE__*/styled__default.div.withConfig({
14003
14029
  displayName: "CharacterListingModal__CharacterInfo",
14004
- componentId: "sc-1uxkx35-10"
14030
+ componentId: "sc-1uxkx35-11"
14005
14031
  })(["display:flex;flex-direction:column;gap:4px;flex:1;"]);
14006
14032
  var CharacterName$3 = /*#__PURE__*/styled__default.span.withConfig({
14007
14033
  displayName: "CharacterListingModal__CharacterName",
14008
- componentId: "sc-1uxkx35-11"
14034
+ componentId: "sc-1uxkx35-12"
14009
14035
  })(["font-family:'Press Start 2P',cursive !important;font-size:0.5rem !important;color:#f3f4f6 !important;"]);
14010
14036
  var CharacterMeta$1 = /*#__PURE__*/styled__default.span.withConfig({
14011
14037
  displayName: "CharacterListingModal__CharacterMeta",
14012
- componentId: "sc-1uxkx35-12"
14038
+ componentId: "sc-1uxkx35-13"
14013
14039
  })(["font-family:'Press Start 2P',cursive !important;font-size:0.4rem !important;color:#888 !important;text-transform:uppercase;letter-spacing:0.5px;"]);
14014
14040
  var PricePreview = /*#__PURE__*/styled__default.div.withConfig({
14015
14041
  displayName: "CharacterListingModal__PricePreview",
14016
- componentId: "sc-1uxkx35-13"
14042
+ componentId: "sc-1uxkx35-14"
14017
14043
  })(["display:flex;align-items:center;gap:6px;"]);
14018
14044
  var DCCoinWrapper$4 = /*#__PURE__*/styled__default.span.withConfig({
14019
14045
  displayName: "CharacterListingModal__DCCoinWrapper",
14020
- componentId: "sc-1uxkx35-14"
14046
+ componentId: "sc-1uxkx35-15"
14021
14047
  })(["display:flex;align-items:center;justify-content:center;flex-shrink:0;"]);
14022
14048
  var PricePreviewAmount = /*#__PURE__*/styled__default.span.withConfig({
14023
14049
  displayName: "CharacterListingModal__PricePreviewAmount",
14024
- componentId: "sc-1uxkx35-15"
14050
+ componentId: "sc-1uxkx35-16"
14025
14051
  })(["font-family:'Press Start 2P',cursive !important;font-size:0.55rem !important;color:#fef08a !important;"]);
14026
14052
  var PriceSection$1 = /*#__PURE__*/styled__default.div.withConfig({
14027
14053
  displayName: "CharacterListingModal__PriceSection",
14028
- componentId: "sc-1uxkx35-16"
14054
+ componentId: "sc-1uxkx35-17"
14029
14055
  })(["display:flex;flex-direction:column;gap:8px;border-top:1px solid rgba(255,255,255,0.06);padding-top:12px;"]);
14030
14056
  var PriceLabel = /*#__PURE__*/styled__default.p.withConfig({
14031
14057
  displayName: "CharacterListingModal__PriceLabel",
14032
- componentId: "sc-1uxkx35-17"
14058
+ componentId: "sc-1uxkx35-18"
14033
14059
  })(["margin:0;font-family:'Press Start 2P',cursive !important;font-size:0.55rem !important;color:#888 !important;text-transform:uppercase;letter-spacing:0.5px;"]);
14034
14060
  var PriceRow$1 = /*#__PURE__*/styled__default.div.withConfig({
14035
14061
  displayName: "CharacterListingModal__PriceRow",
14036
- componentId: "sc-1uxkx35-18"
14062
+ componentId: "sc-1uxkx35-19"
14037
14063
  })(["display:flex;gap:8px;align-items:center;.price-input{flex:1;height:12px;}"]);
14038
14064
  var ListBtn = /*#__PURE__*/styled__default(CTAButton).withConfig({
14039
14065
  displayName: "CharacterListingModal__ListBtn",
14040
- componentId: "sc-1uxkx35-19"
14066
+ componentId: "sc-1uxkx35-20"
14041
14067
  })(["flex-shrink:0;padding:10px 16px;height:32px;span{font-size:0.6rem;}svg{font-size:1.1rem;}"]);
14042
14068
  var EmptyState$6 = /*#__PURE__*/styled__default.div.withConfig({
14043
14069
  displayName: "CharacterListingModal__EmptyState",
14044
- componentId: "sc-1uxkx35-20"
14070
+ componentId: "sc-1uxkx35-21"
14045
14071
  })(["display:flex;align-items:center;justify-content:center;padding:32px 16px;font-family:'Press Start 2P',cursive !important;font-size:0.5rem !important;color:#666 !important;text-transform:uppercase;letter-spacing:1px;"]);
14046
14072
 
14047
14073
  var MyCharacterListingsPanel = function MyCharacterListingsPanel(_ref) {
@@ -14053,6 +14079,7 @@ var MyCharacterListingsPanel = function MyCharacterListingsPanel(_ref) {
14053
14079
  onCharacterDelist = _ref.onCharacterDelist,
14054
14080
  accountCharacters = _ref.accountCharacters,
14055
14081
  _onCharacterList = _ref.onCharacterList,
14082
+ activeCharacterId = _ref.activeCharacterId,
14056
14083
  atlasJSON = _ref.atlasJSON,
14057
14084
  atlasIMG = _ref.atlasIMG,
14058
14085
  characterAtlasJSON = _ref.characterAtlasJSON,
@@ -14093,6 +14120,7 @@ var MyCharacterListingsPanel = function MyCharacterListingsPanel(_ref) {
14093
14120
  return setIsListingModalOpen(false);
14094
14121
  },
14095
14122
  accountCharacters: accountCharacters,
14123
+ activeCharacterId: activeCharacterId,
14096
14124
  atlasJSON: atlasJSON,
14097
14125
  atlasIMG: atlasIMG,
14098
14126
  characterAtlasJSON: characterAtlasJSON,
@@ -14444,6 +14472,7 @@ var Marketplace = function Marketplace(props) {
14444
14472
  onCharacterDelist: onCharacterDelist != null ? onCharacterDelist : function () {},
14445
14473
  accountCharacters: accountCharacters != null ? accountCharacters : [],
14446
14474
  onCharacterList: onCharacterList != null ? onCharacterList : function () {},
14475
+ activeCharacterId: props.characterId,
14447
14476
  atlasJSON: props.atlasJSON,
14448
14477
  atlasIMG: props.atlasIMG,
14449
14478
  characterAtlasJSON: characterAtlasJSON != null ? characterAtlasJSON : props.atlasJSON,