@rpg-engine/long-bow 0.7.92 → 0.7.94
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/long-bow.cjs.development.js +27 -13
- 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 +27 -13
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CraftBook/CraftBook.tsx +51 -40
package/dist/long-bow.esm.js
CHANGED
|
@@ -28832,6 +28832,12 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
28832
28832
|
var _useState7 = useState(1),
|
|
28833
28833
|
currentPage = _useState7[0],
|
|
28834
28834
|
setCurrentPage = _useState7[1];
|
|
28835
|
+
var _useState8 = useState(craftablesItems),
|
|
28836
|
+
items = _useState8[0],
|
|
28837
|
+
setItems = _useState8[1];
|
|
28838
|
+
useEffect(function () {
|
|
28839
|
+
setItems(craftablesItems);
|
|
28840
|
+
}, [craftablesItems]);
|
|
28835
28841
|
useEffect(function () {
|
|
28836
28842
|
var handleResize = function handleResize() {
|
|
28837
28843
|
if (window.innerWidth < 500 && (size == null ? void 0 : size.width) !== mobilePortrait.width && (!scale || scale < 1)) {
|
|
@@ -28855,24 +28861,32 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
28855
28861
|
}) : [].concat(current, [itemKey]);
|
|
28856
28862
|
});
|
|
28857
28863
|
};
|
|
28858
|
-
var categoryOptions = [
|
|
28864
|
+
var categoryOptions = [{
|
|
28865
|
+
id: 0,
|
|
28866
|
+
value: 'Suggested',
|
|
28867
|
+
option: 'Suggested'
|
|
28868
|
+
}].concat(pinnedItems.length > 0 ? [{
|
|
28869
|
+
id: 1,
|
|
28870
|
+
value: 'Pinned',
|
|
28871
|
+
option: 'Pinned'
|
|
28872
|
+
}] : [], Object.keys(ItemSubType).filter(function (type) {
|
|
28859
28873
|
return type !== 'DeadBody';
|
|
28860
|
-
}).sort(function (a, b) {
|
|
28861
|
-
if (a === 'Suggested') return -1;
|
|
28862
|
-
if (b === 'Suggested') return 1;
|
|
28863
|
-
if (a === 'Pinned') return -1;
|
|
28864
|
-
if (b === 'Pinned') return 1;
|
|
28865
|
-
return a.localeCompare(b);
|
|
28866
28874
|
}).map(function (type, index) {
|
|
28867
28875
|
return {
|
|
28868
|
-
id: index,
|
|
28876
|
+
id: index + (pinnedItems.length > 0 ? 2 : 1),
|
|
28869
28877
|
value: type,
|
|
28870
|
-
option: type
|
|
28878
|
+
option: type === 'CraftingResources' || type === 'CraftingResource' ? 'Resources' : type
|
|
28871
28879
|
};
|
|
28880
|
+
})).sort(function (a, b) {
|
|
28881
|
+
if (a.value === 'Suggested') return -1;
|
|
28882
|
+
if (b.value === 'Suggested') return 1;
|
|
28883
|
+
if (a.value === 'Pinned') return -1;
|
|
28884
|
+
if (b.value === 'Pinned') return 1;
|
|
28885
|
+
return a.value.localeCompare(b.value);
|
|
28872
28886
|
});
|
|
28873
|
-
var filteredCraftableItems =
|
|
28887
|
+
var filteredCraftableItems = items == null ? void 0 : items.filter(function (item) {
|
|
28874
28888
|
var matchesSearch = item.name.toLowerCase().includes(searchTerm.toLowerCase());
|
|
28875
|
-
var matchesCategory = selectedType === 'Suggested' || selectedType === 'Pinned' && pinnedItems.includes(item.key) || item.
|
|
28889
|
+
var matchesCategory = selectedType === 'Suggested' || selectedType === 'Pinned' && pinnedItems.includes(item.key) || item.subType === selectedType;
|
|
28876
28890
|
return matchesSearch && matchesCategory;
|
|
28877
28891
|
});
|
|
28878
28892
|
var sortedItems = [].concat(filteredCraftableItems || []).sort(function (a, b) {
|
|
@@ -28942,7 +28956,7 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
28942
28956
|
inventory: inventory,
|
|
28943
28957
|
skills: skills
|
|
28944
28958
|
}));
|
|
28945
|
-
}))), React.createElement(PaginationContainer, null, React.createElement(PaginationButton, {
|
|
28959
|
+
}))), totalPages > 1 && React.createElement(PaginationContainer, null, React.createElement(PaginationButton, {
|
|
28946
28960
|
onClick: function onClick() {
|
|
28947
28961
|
return setCurrentPage(function (prev) {
|
|
28948
28962
|
return Math.max(1, prev - 1);
|
|
@@ -29015,7 +29029,7 @@ var ContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
29015
29029
|
var RadioInputScroller = /*#__PURE__*/styled.div.withConfig({
|
|
29016
29030
|
displayName: "CraftBook__RadioInputScroller",
|
|
29017
29031
|
componentId: "sc-19q95ue-8"
|
|
29018
|
-
})(["height:100%;overflow-y:scroll;overflow-x:hidden;padding:8px 16px;padding-right:24px;width:100%;box-sizing:border-box;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-
|
|
29032
|
+
})(["height:100%;overflow-y:scroll;overflow-x:hidden;padding:8px 16px;padding-right:24px;width:100%;box-sizing:border-box;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-content:start;@media (max-width:", "){grid-template-columns:1fr;}"], mobilePortrait.width);
|
|
29019
29033
|
var CraftingRecipeWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
29020
29034
|
displayName: "CraftBook__CraftingRecipeWrapper",
|
|
29021
29035
|
componentId: "sc-19q95ue-9"
|