@rpg-engine/long-bow 0.5.76 → 0.5.78

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.
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, Component, useRef, useContext, createContext, useMemo, useCallback, Fragment } from 'react';
2
2
  import { BeatLoader } from 'react-spinners';
3
- import styled, { keyframes } from 'styled-components';
3
+ import styled, { css, keyframes } from 'styled-components';
4
4
  import { v4 } from 'uuid';
5
5
  import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemRarities, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemSubType, ItemSlotType, isMobileOrTablet, CharacterClass, getSPForLevel, getXPForLevel, PeriodOfDay, UserAccountTypes } from '@rpg-engine/shared';
6
6
  import dayjs from 'dayjs';
@@ -42,7 +42,9 @@ var AsyncDropdown = function AsyncDropdown(_ref) {
42
42
  var options = _ref.options,
43
43
  width = _ref.width,
44
44
  onChange = _ref.onChange,
45
- defaultValue = _ref.defaultValue;
45
+ defaultValue = _ref.defaultValue,
46
+ _ref$opensUp = _ref.opensUp,
47
+ opensUp = _ref$opensUp === void 0 ? false : _ref$opensUp;
46
48
  var dropdownId = v4();
47
49
  var _useState = useState(defaultValue || (options == null ? void 0 : (_options$ = options[0]) == null ? void 0 : _options$.value)),
48
50
  selectedValue = _useState[0],
@@ -93,7 +95,8 @@ var AsyncDropdown = function AsyncDropdown(_ref) {
93
95
  color: uiColors.white
94
96
  }))), React.createElement(DropdownOptions, {
95
97
  className: "rpgui-dropdown-imp",
96
- opened: opened
98
+ opened: opened,
99
+ opensUp: opensUp
97
100
  }, options == null ? void 0 : options.map(function (option) {
98
101
  return React.createElement("li", {
99
102
  key: option.id,
@@ -125,8 +128,12 @@ var DropdownSelect = /*#__PURE__*/styled.p.withConfig({
125
128
  var DropdownOptions = /*#__PURE__*/styled.ul.withConfig({
126
129
  displayName: "AsyncDropdown__DropdownOptions",
127
130
  componentId: "sc-lk409c-4"
128
- })(["position:absolute;width:100%;max-height:300px;overflow-y:auto;display:", ";box-sizing:border-box;@media (max-width:768px){padding:8px 0;}"], function (props) {
131
+ })(["position:absolute;width:100%;max-height:300px;overflow-y:auto;display:", ";box-sizing:border-box;bottom:", ";top:", ";margin:0;padding:0;@media (max-width:768px){padding:8px 0;}"], function (props) {
129
132
  return props.opened ? 'block' : 'none';
133
+ }, function (props) {
134
+ return props.opensUp ? '100%' : 'auto';
135
+ }, function (props) {
136
+ return props.opensUp ? 'auto' : '100%';
130
137
  });
131
138
 
132
139
  function _extends() {
@@ -13460,8 +13467,14 @@ var DraggableContainer = function DraggableContainer(_ref) {
13460
13467
  } : _ref$initialPosition,
13461
13468
  scale = _ref.scale,
13462
13469
  _ref$dragDisabled = _ref.dragDisabled,
13463
- dragDisabled = _ref$dragDisabled === void 0 ? false : _ref$dragDisabled;
13470
+ dragDisabled = _ref$dragDisabled === void 0 ? false : _ref$dragDisabled,
13471
+ isFullScreen = _ref.isFullScreen,
13472
+ opacity = _ref.opacity;
13464
13473
  var draggableRef = useRef(null);
13474
+ if (isFullScreen) {
13475
+ width = '100%';
13476
+ height = '100%';
13477
+ }
13465
13478
  useOutsideClick(draggableRef, 'item-container');
13466
13479
  useEffect(function () {
13467
13480
  document.addEventListener('clickOutside', function (event) {
@@ -13509,7 +13522,9 @@ var DraggableContainer = function DraggableContainer(_ref) {
13509
13522
  ref: draggableRef,
13510
13523
  width: width,
13511
13524
  height: height || 'auto',
13512
- className: "rpgui-container " + type + " " + className
13525
+ className: "rpgui-container " + type + " " + className,
13526
+ isFullScreen: isFullScreen,
13527
+ opacity: opacity
13513
13528
  }, title && React.createElement(TitleContainer, {
13514
13529
  className: "drag-handler"
13515
13530
  }, React.createElement(Title, null, imgSrc && React.createElement(Icon, {
@@ -13523,11 +13538,17 @@ var DraggableContainer = function DraggableContainer(_ref) {
13523
13538
  var Container$7 = /*#__PURE__*/styled.div.withConfig({
13524
13539
  displayName: "DraggableContainer__Container",
13525
13540
  componentId: "sc-184mpyl-0"
13526
- })(["height:", ";width:", ";display:flex;flex-wrap:wrap;image-rendering:pixelated;&.rpgui-container{padding-top:1.5rem;}"], function (props) {
13541
+ })(["height:", ";width:", ";display:flex;flex-wrap:wrap;image-rendering:pixelated;", " ", " &.rpgui-container{padding-top:1.5rem;}"], function (props) {
13527
13542
  return props.height;
13528
13543
  }, function (_ref2) {
13529
13544
  var width = _ref2.width;
13530
13545
  return width;
13546
+ }, function (_ref3) {
13547
+ var opacity = _ref3.opacity;
13548
+ return opacity && css(["opacity:", ";"], opacity);
13549
+ }, function (_ref4) {
13550
+ var isFullScreen = _ref4.isFullScreen;
13551
+ return isFullScreen && css(["justify-content:center;align-items:flex-start;align-content:flex-start;"]);
13531
13552
  });
13532
13553
  var CloseButton$2 = /*#__PURE__*/styled.div.withConfig({
13533
13554
  displayName: "DraggableContainer__CloseButton",
@@ -13536,7 +13557,7 @@ var CloseButton$2 = /*#__PURE__*/styled.div.withConfig({
13536
13557
  var TitleContainer = /*#__PURE__*/styled.div.withConfig({
13537
13558
  displayName: "DraggableContainer__TitleContainer",
13538
13559
  componentId: "sc-184mpyl-2"
13539
- })(["width:100%;height:100%;display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;"]);
13560
+ })(["width:100%;height:100%;display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;max-height:42px;"]);
13540
13561
  var Title = /*#__PURE__*/styled.h1.withConfig({
13541
13562
  displayName: "DraggableContainer__Title",
13542
13563
  componentId: "sc-184mpyl-3"
@@ -16109,8 +16130,12 @@ var SlotsContainer = function SlotsContainer(_ref) {
16109
16130
  onOutsideClick = _ref.onOutsideClick,
16110
16131
  initialPosition = _ref.initialPosition,
16111
16132
  scale = _ref.scale,
16112
- width = _ref.width;
16133
+ width = _ref.width,
16134
+ isFullScreen = _ref.isFullScreen,
16135
+ opacity = _ref.opacity;
16113
16136
  return React.createElement(DraggableContainer, {
16137
+ isFullScreen: isFullScreen,
16138
+ opacity: opacity,
16114
16139
  title: title,
16115
16140
  type: RPGUIContainerTypes.Framed,
16116
16141
  onCloseButton: function onCloseButton() {
@@ -16204,6 +16229,8 @@ var useScrollOnDrag = function useScrollOnDrag(_ref) {
16204
16229
  };
16205
16230
  };
16206
16231
 
16232
+ var UI_BREAKPOINT_MOBILE = '950px';
16233
+
16207
16234
  var ShortcutsSetter = function ShortcutsSetter(_ref) {
16208
16235
  var setSettingShortcutIndex = _ref.setSettingShortcutIndex,
16209
16236
  settingShortcutIndex = _ref.settingShortcutIndex,
@@ -16274,7 +16301,7 @@ var ShortcutsSetter = function ShortcutsSetter(_ref) {
16274
16301
  var Container$k = /*#__PURE__*/styled.div.withConfig({
16275
16302
  displayName: "ShortcutsSetter__Container",
16276
16303
  componentId: "sc-xuouuf-0"
16277
- })(["p{margin:0;margin-left:0.5rem;font-size:10px;}width:100%;"]);
16304
+ })(["p{margin:0;margin-left:0.5rem;font-size:10px;}width:100%;@media screen and (max-width:", "){max-height:80px;}"], UI_BREAKPOINT_MOBILE);
16278
16305
  var Shortcut = /*#__PURE__*/styled.button.withConfig({
16279
16306
  displayName: "ShortcutsSetter__Shortcut",
16280
16307
  componentId: "sc-xuouuf-1"
@@ -16496,7 +16523,9 @@ var ItemContainer$1 = function ItemContainer(_ref) {
16496
16523
  equipmentSet = _ref.equipmentSet,
16497
16524
  isDepotSystem = _ref.isDepotSystem,
16498
16525
  onPositionChangeEnd = _ref.onPositionChangeEnd,
16499
- onPositionChangeStart = _ref.onPositionChangeStart;
16526
+ onPositionChangeStart = _ref.onPositionChangeStart,
16527
+ isFullScreen = _ref.isFullScreen,
16528
+ opacity = _ref.opacity;
16500
16529
  var _useState = useState({
16501
16530
  isOpen: false,
16502
16531
  maxQuantity: 1,
@@ -16616,7 +16645,9 @@ var ItemContainer$1 = function ItemContainer(_ref) {
16616
16645
  initialPosition: initialPosition,
16617
16646
  scale: scale,
16618
16647
  onPositionChangeEnd: onPositionChangeEnd,
16619
- onPositionChangeStart: onPositionChangeStart
16648
+ onPositionChangeStart: onPositionChangeStart,
16649
+ isFullScreen: isFullScreen,
16650
+ opacity: opacity
16620
16651
  }, type === ItemContainerType.Inventory && shortcuts && removeShortcut && React.createElement(ShortcutsSetter, {
16621
16652
  setSettingShortcutIndex: setSettingShortcutIndex,
16622
16653
  settingShortcutIndex: settingShortcutIndex,
@@ -16627,7 +16658,8 @@ var ItemContainer$1 = function ItemContainer(_ref) {
16627
16658
  }), React.createElement(ItemsContainer, {
16628
16659
  className: "item-container-body",
16629
16660
  ref: containerRef,
16630
- isScrollable: itemContainer.slotQty > MIN_SLOTS_FOR_SCROLL
16661
+ isScrollable: itemContainer.slotQty > MIN_SLOTS_FOR_SCROLL,
16662
+ isFullScreen: isFullScreen
16631
16663
  }, onRenderSlots())), quantitySelect.isOpen && React.createElement(ItemQuantitySelectorModal, {
16632
16664
  quantitySelect: quantitySelect,
16633
16665
  setQuantitySelect: setQuantitySelect
@@ -16636,9 +16668,21 @@ var ItemContainer$1 = function ItemContainer(_ref) {
16636
16668
  var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
16637
16669
  displayName: "ItemContainer__ItemsContainer",
16638
16670
  componentId: "sc-15y5p9l-0"
16639
- })(["display:flex;justify-content:center;flex-wrap:wrap;max-height:270px;overflow-y:", ";overflow-x:hidden;width:415px;"], function (_ref2) {
16640
- var isScrollable = _ref2.isScrollable;
16671
+ })(["display:flex;justify-content:", ";flex-wrap:wrap;max-height:", ";overflow-y:", ";overflow-x:hidden;width:", ";margin-top:", ";"], function (_ref2) {
16672
+ var isFullScreen = _ref2.isFullScreen;
16673
+ return isFullScreen ? 'flex-start' : 'center';
16674
+ }, function (_ref3) {
16675
+ var isFullScreen = _ref3.isFullScreen;
16676
+ return isFullScreen ? '100vh' : '270px';
16677
+ }, function (_ref4) {
16678
+ var isScrollable = _ref4.isScrollable;
16641
16679
  return isScrollable ? 'scroll' : 'hidden';
16680
+ }, function (_ref5) {
16681
+ var isFullScreen = _ref5.isFullScreen;
16682
+ return isFullScreen ? '100vw' : '415px';
16683
+ }, function (_ref6) {
16684
+ var isFullScreen = _ref6.isFullScreen;
16685
+ return isFullScreen ? '1rem' : '0';
16642
16686
  });
16643
16687
 
16644
16688
  var LeaderboardTable = function LeaderboardTable(props) {