@rpg-engine/long-bow 0.8.20 → 0.8.21
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/InformationCenter/InformationCenter.d.ts +1 -14
- package/dist/components/InformationCenter/InformationCenterTypes.d.ts +17 -0
- package/dist/components/InformationCenter/sections/bestiary/InformationCenterBestiarySection.d.ts +2 -0
- package/dist/components/InformationCenter/sections/bestiary/InformationCenterNPCDetails.d.ts +2 -0
- package/dist/long-bow.cjs.development.js +53 -21
- 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 +53 -21
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/InformationCenter/InformationCenter.tsx +109 -117
- package/src/components/InformationCenter/InformationCenterTypes.ts +18 -0
- package/src/components/InformationCenter/sections/bestiary/InformationCenterBestiarySection.tsx +6 -0
- package/src/components/InformationCenter/sections/bestiary/InformationCenterNPCDetails.tsx +232 -178
- package/src/components/shared/PaginatedContent/PaginatedContent.tsx +1 -1
- package/src/mocks/informationCenter.mocks.ts +17 -8
- package/src/stories/UI/info/InformationCenter.stories.tsx +5 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -30963,7 +30963,7 @@ var StyledDropdown = /*#__PURE__*/styled(Dropdown).withConfig({
|
|
|
30963
30963
|
var PaginatedContent = function PaginatedContent(_ref) {
|
|
30964
30964
|
var items = _ref.items,
|
|
30965
30965
|
_ref$itemsPerPage = _ref.itemsPerPage,
|
|
30966
|
-
itemsPerPage = _ref$itemsPerPage === void 0 ?
|
|
30966
|
+
itemsPerPage = _ref$itemsPerPage === void 0 ? 8 : _ref$itemsPerPage,
|
|
30967
30967
|
renderItem = _ref.renderItem,
|
|
30968
30968
|
_ref$emptyMessage = _ref.emptyMessage,
|
|
30969
30969
|
emptyMessage = _ref$emptyMessage === void 0 ? 'No items found' : _ref$emptyMessage,
|
|
@@ -31181,6 +31181,13 @@ var SpriteContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
|
31181
31181
|
})(["width:64px;height:64px;background:rgba(0,0,0,0.3);border-radius:4px;display:flex;justify-content:center;align-items:center;position:relative;.sprite-from-atlas-img{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(2);transform-origin:center;}"]);
|
|
31182
31182
|
|
|
31183
31183
|
var ITEMS_PER_PAGE$1 = 5;
|
|
31184
|
+
var formatItemName = function formatItemName(itemPath) {
|
|
31185
|
+
var _itemPath$split$pop;
|
|
31186
|
+
var cleanText = ((_itemPath$split$pop = itemPath.split('/').pop()) == null ? void 0 : _itemPath$split$pop.split('.').shift()) || '';
|
|
31187
|
+
return cleanText.split('-').map(function (word) {
|
|
31188
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
31189
|
+
}).join(' ');
|
|
31190
|
+
};
|
|
31184
31191
|
var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
|
|
31185
31192
|
var _npc$loots, _npc$skills$strength, _npc$skills$dexterity, _npc$skills$resistanc;
|
|
31186
31193
|
var npc = _ref.npc,
|
|
@@ -31188,6 +31195,8 @@ var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
|
|
|
31188
31195
|
itemsAtlasIMG = _ref.itemsAtlasIMG,
|
|
31189
31196
|
entitiesAtlasJSON = _ref.entitiesAtlasJSON,
|
|
31190
31197
|
entitiesAtlasIMG = _ref.entitiesAtlasIMG,
|
|
31198
|
+
iconAtlasIMG = _ref.iconAtlasIMG,
|
|
31199
|
+
iconAtlasJSON = _ref.iconAtlasJSON,
|
|
31191
31200
|
onBack = _ref.onBack;
|
|
31192
31201
|
var isMobile = isMobileOrTablet();
|
|
31193
31202
|
var _useState = useState(''),
|
|
@@ -31221,7 +31230,7 @@ var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
|
|
|
31221
31230
|
}
|
|
31222
31231
|
};
|
|
31223
31232
|
var filteredLoots = ((_npc$loots = npc.loots) == null ? void 0 : _npc$loots.filter(function (loot) {
|
|
31224
|
-
return
|
|
31233
|
+
return formatItemName(loot.itemBlueprintKey).toLowerCase().includes(lootSearchQuery.toLowerCase());
|
|
31225
31234
|
})) || [];
|
|
31226
31235
|
var totalLootPages = Math.ceil(filteredLoots.length / ITEMS_PER_PAGE$1);
|
|
31227
31236
|
var paginatedLoots = filteredLoots.slice((currentLootPage - 1) * ITEMS_PER_PAGE$1, currentLootPage * ITEMS_PER_PAGE$1);
|
|
@@ -31251,7 +31260,7 @@ var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
|
|
|
31251
31260
|
width: 24,
|
|
31252
31261
|
height: 24,
|
|
31253
31262
|
imgScale: 1
|
|
31254
|
-
}), React.createElement(LootDetails, null, React.createElement(LootName, null,
|
|
31263
|
+
}), React.createElement(LootDetails, null, React.createElement(LootName, null, formatItemName(loot.itemBlueprintKey)), React.createElement(LootInfo, null, React.createElement(LootChance, null, formatRarity(loot.chance)), loot.quantityRange && React.createElement(LootQuantity, null, "x", loot.quantityRange[0], "-", loot.quantityRange[1]))));
|
|
31255
31264
|
})), filteredLoots.length > ITEMS_PER_PAGE$1 && React.createElement(PaginationContainer$2, null, React.createElement(StyledPagination, {
|
|
31256
31265
|
currentPage: currentLootPage,
|
|
31257
31266
|
totalPages: totalLootPages,
|
|
@@ -31269,7 +31278,14 @@ var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
|
|
|
31269
31278
|
}, React.createElement(SpellsList, null, npc.areaSpells.map(function (spell, index) {
|
|
31270
31279
|
return React.createElement(SpellItem, {
|
|
31271
31280
|
key: index
|
|
31272
|
-
}, React.createElement(
|
|
31281
|
+
}, React.createElement(SpellIconContainer, null, React.createElement(SpriteFromAtlas, {
|
|
31282
|
+
atlasJSON: iconAtlasJSON,
|
|
31283
|
+
atlasIMG: iconAtlasIMG,
|
|
31284
|
+
spriteKey: spell.texturePath || spell.spellKey,
|
|
31285
|
+
width: 24,
|
|
31286
|
+
height: 24,
|
|
31287
|
+
imgScale: 1
|
|
31288
|
+
})), React.createElement(SpellContent, null, React.createElement(SpellName, null, formatText(spell.spellKey)), React.createElement(SpellDetails, null, "Power:", ' ', React.createElement(SpellValue, null, formatText(spell.power)), React.createElement(Separator, null, "\u2022"), "Chance: ", React.createElement(SpellValue, null, spell.probability, "%"))));
|
|
31273
31289
|
}))));
|
|
31274
31290
|
};
|
|
31275
31291
|
var InfoSection = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -31312,69 +31328,77 @@ var SpellsList = /*#__PURE__*/styled.div.withConfig({
|
|
|
31312
31328
|
displayName: "InformationCenterNPCDetails__SpellsList",
|
|
31313
31329
|
componentId: "sc-fdu3xl-9"
|
|
31314
31330
|
})(["display:flex;flex-direction:column;gap:8px;padding:12px;"]);
|
|
31331
|
+
var SpellIconContainer = /*#__PURE__*/styled.div.withConfig({
|
|
31332
|
+
displayName: "InformationCenterNPCDetails__SpellIconContainer",
|
|
31333
|
+
componentId: "sc-fdu3xl-10"
|
|
31334
|
+
})(["display:flex;padding-right:30px;padding-bottom:30px;"]);
|
|
31335
|
+
var SpellContent = /*#__PURE__*/styled.div.withConfig({
|
|
31336
|
+
displayName: "InformationCenterNPCDetails__SpellContent",
|
|
31337
|
+
componentId: "sc-fdu3xl-11"
|
|
31338
|
+
})(["display:flex;flex-direction:column;gap:4px;flex:1;"]);
|
|
31315
31339
|
var SpellItem = /*#__PURE__*/styled.div.withConfig({
|
|
31316
31340
|
displayName: "InformationCenterNPCDetails__SpellItem",
|
|
31317
|
-
componentId: "sc-fdu3xl-
|
|
31318
|
-
})(["display:flex;
|
|
31341
|
+
componentId: "sc-fdu3xl-12"
|
|
31342
|
+
})(["display:flex;gap:8px;background:rgba(255,255,255,0.05);padding:8px;padding-left:10px;border-radius:4px;align-items:center;"]);
|
|
31319
31343
|
var SpellName = /*#__PURE__*/styled.div.withConfig({
|
|
31320
31344
|
displayName: "InformationCenterNPCDetails__SpellName",
|
|
31321
|
-
componentId: "sc-fdu3xl-
|
|
31345
|
+
componentId: "sc-fdu3xl-13"
|
|
31322
31346
|
})(["color:", ";font-size:0.5rem;"], uiColors.yellow);
|
|
31323
31347
|
var SpellDetails = /*#__PURE__*/styled.div.withConfig({
|
|
31324
31348
|
displayName: "InformationCenterNPCDetails__SpellDetails",
|
|
31325
|
-
componentId: "sc-fdu3xl-
|
|
31349
|
+
componentId: "sc-fdu3xl-14"
|
|
31326
31350
|
})(["display:flex;align-items:center;gap:8px;color:", ";font-size:0.45rem;opacity:0.8;"], uiColors.white);
|
|
31327
31351
|
var SpellValue = /*#__PURE__*/styled.span.withConfig({
|
|
31328
31352
|
displayName: "InformationCenterNPCDetails__SpellValue",
|
|
31329
|
-
componentId: "sc-fdu3xl-
|
|
31353
|
+
componentId: "sc-fdu3xl-15"
|
|
31330
31354
|
})(["color:", ";"], uiColors.yellow);
|
|
31331
31355
|
var Separator = /*#__PURE__*/styled.span.withConfig({
|
|
31332
31356
|
displayName: "InformationCenterNPCDetails__Separator",
|
|
31333
|
-
componentId: "sc-fdu3xl-
|
|
31357
|
+
componentId: "sc-fdu3xl-16"
|
|
31334
31358
|
})(["color:", ";opacity:0.5;"], uiColors.yellow);
|
|
31335
31359
|
var LootSearchContainer = /*#__PURE__*/styled.div.withConfig({
|
|
31336
31360
|
displayName: "InformationCenterNPCDetails__LootSearchContainer",
|
|
31337
|
-
componentId: "sc-fdu3xl-
|
|
31361
|
+
componentId: "sc-fdu3xl-17"
|
|
31338
31362
|
})(["padding:12px 12px 0;"]);
|
|
31339
31363
|
var StyledSearchBar$1 = /*#__PURE__*/styled(SearchBar).withConfig({
|
|
31340
31364
|
displayName: "InformationCenterNPCDetails__StyledSearchBar",
|
|
31341
|
-
componentId: "sc-fdu3xl-
|
|
31365
|
+
componentId: "sc-fdu3xl-18"
|
|
31342
31366
|
})(["width:100%;"]);
|
|
31343
31367
|
var LootGrid = /*#__PURE__*/styled.div.withConfig({
|
|
31344
31368
|
displayName: "InformationCenterNPCDetails__LootGrid",
|
|
31345
|
-
componentId: "sc-fdu3xl-
|
|
31369
|
+
componentId: "sc-fdu3xl-19"
|
|
31346
31370
|
})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;padding:12px;"]);
|
|
31347
31371
|
var LootItem = /*#__PURE__*/styled.div.withConfig({
|
|
31348
31372
|
displayName: "InformationCenterNPCDetails__LootItem",
|
|
31349
|
-
componentId: "sc-fdu3xl-
|
|
31373
|
+
componentId: "sc-fdu3xl-20"
|
|
31350
31374
|
})(["display:flex;align-items:center;gap:8px;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"]);
|
|
31351
31375
|
var LootDetails = /*#__PURE__*/styled.div.withConfig({
|
|
31352
31376
|
displayName: "InformationCenterNPCDetails__LootDetails",
|
|
31353
|
-
componentId: "sc-fdu3xl-
|
|
31377
|
+
componentId: "sc-fdu3xl-21"
|
|
31354
31378
|
})(["flex:1;display:flex;flex-direction:column;gap:4px;"]);
|
|
31355
31379
|
var LootName = /*#__PURE__*/styled.div.withConfig({
|
|
31356
31380
|
displayName: "InformationCenterNPCDetails__LootName",
|
|
31357
|
-
componentId: "sc-fdu3xl-
|
|
31381
|
+
componentId: "sc-fdu3xl-22"
|
|
31358
31382
|
})(["color:", ";font-size:0.5rem;"], uiColors.white);
|
|
31359
31383
|
var LootInfo = /*#__PURE__*/styled.div.withConfig({
|
|
31360
31384
|
displayName: "InformationCenterNPCDetails__LootInfo",
|
|
31361
|
-
componentId: "sc-fdu3xl-
|
|
31385
|
+
componentId: "sc-fdu3xl-23"
|
|
31362
31386
|
})(["display:flex;align-items:center;gap:8px;"]);
|
|
31363
31387
|
var LootChance = /*#__PURE__*/styled.span.withConfig({
|
|
31364
31388
|
displayName: "InformationCenterNPCDetails__LootChance",
|
|
31365
|
-
componentId: "sc-fdu3xl-
|
|
31389
|
+
componentId: "sc-fdu3xl-24"
|
|
31366
31390
|
})(["color:", ";font-size:0.45rem;"], uiColors.yellow);
|
|
31367
31391
|
var LootQuantity = /*#__PURE__*/styled.span.withConfig({
|
|
31368
31392
|
displayName: "InformationCenterNPCDetails__LootQuantity",
|
|
31369
|
-
componentId: "sc-fdu3xl-
|
|
31393
|
+
componentId: "sc-fdu3xl-25"
|
|
31370
31394
|
})(["color:", ";font-size:0.45rem;"], uiColors.lightGray);
|
|
31371
31395
|
var PaginationContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
31372
31396
|
displayName: "InformationCenterNPCDetails__PaginationContainer",
|
|
31373
|
-
componentId: "sc-fdu3xl-
|
|
31397
|
+
componentId: "sc-fdu3xl-26"
|
|
31374
31398
|
})(["display:flex;justify-content:center;padding:12px;"]);
|
|
31375
31399
|
var StyledPagination = /*#__PURE__*/styled(Pagination).withConfig({
|
|
31376
31400
|
displayName: "InformationCenterNPCDetails__StyledPagination",
|
|
31377
|
-
componentId: "sc-fdu3xl-
|
|
31401
|
+
componentId: "sc-fdu3xl-27"
|
|
31378
31402
|
})(["font-size:0.6rem;"]);
|
|
31379
31403
|
|
|
31380
31404
|
var TooltipContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -31504,6 +31528,8 @@ var InformationCenterBestiarySection = function InformationCenterBestiarySection
|
|
|
31504
31528
|
var bestiaryItems = _ref.bestiaryItems,
|
|
31505
31529
|
itemsAtlasJSON = _ref.itemsAtlasJSON,
|
|
31506
31530
|
itemsAtlasIMG = _ref.itemsAtlasIMG,
|
|
31531
|
+
iconsAtlasIMG = _ref.iconsAtlasIMG,
|
|
31532
|
+
iconsAtlasJSON = _ref.iconsAtlasJSON,
|
|
31507
31533
|
entitiesAtlasJSON = _ref.entitiesAtlasJSON,
|
|
31508
31534
|
entitiesAtlasIMG = _ref.entitiesAtlasIMG,
|
|
31509
31535
|
initialSearchQuery = _ref.initialSearchQuery,
|
|
@@ -31615,6 +31641,8 @@ var InformationCenterBestiarySection = function InformationCenterBestiarySection
|
|
|
31615
31641
|
npc: selectedMonster,
|
|
31616
31642
|
itemsAtlasJSON: itemsAtlasJSON,
|
|
31617
31643
|
itemsAtlasIMG: itemsAtlasIMG,
|
|
31644
|
+
iconAtlasIMG: iconsAtlasIMG,
|
|
31645
|
+
iconAtlasJSON: iconsAtlasJSON,
|
|
31618
31646
|
entitiesAtlasJSON: entitiesAtlasJSON,
|
|
31619
31647
|
entitiesAtlasIMG: entitiesAtlasIMG,
|
|
31620
31648
|
onBack: function onBack() {
|
|
@@ -32094,6 +32122,8 @@ var InformationCenter = function InformationCenter(_ref) {
|
|
|
32094
32122
|
itemsAtlasIMG = _ref.itemsAtlasIMG,
|
|
32095
32123
|
entitiesAtlasJSON = _ref.entitiesAtlasJSON,
|
|
32096
32124
|
entitiesAtlasIMG = _ref.entitiesAtlasIMG,
|
|
32125
|
+
iconsAtlasIMG = _ref.iconsAtlasIMG,
|
|
32126
|
+
iconsAtlasJSON = _ref.iconsAtlasJSON,
|
|
32097
32127
|
_ref$faqItems = _ref.faqItems,
|
|
32098
32128
|
faqItems = _ref$faqItems === void 0 ? [] : _ref$faqItems,
|
|
32099
32129
|
_ref$bestiaryItems = _ref.bestiaryItems,
|
|
@@ -32126,6 +32156,8 @@ var InformationCenter = function InformationCenter(_ref) {
|
|
|
32126
32156
|
bestiaryItems: bestiaryItems,
|
|
32127
32157
|
itemsAtlasJSON: itemsAtlasJSON,
|
|
32128
32158
|
itemsAtlasIMG: itemsAtlasIMG,
|
|
32159
|
+
iconsAtlasIMG: iconsAtlasIMG,
|
|
32160
|
+
iconsAtlasJSON: iconsAtlasJSON,
|
|
32129
32161
|
entitiesAtlasJSON: entitiesAtlasJSON,
|
|
32130
32162
|
entitiesAtlasIMG: entitiesAtlasIMG,
|
|
32131
32163
|
initialSearchQuery: initialSearchQuery,
|