@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
|
@@ -28839,6 +28839,12 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
28839
28839
|
var _useState7 = React.useState(1),
|
|
28840
28840
|
currentPage = _useState7[0],
|
|
28841
28841
|
setCurrentPage = _useState7[1];
|
|
28842
|
+
var _useState8 = React.useState(craftablesItems),
|
|
28843
|
+
items = _useState8[0],
|
|
28844
|
+
setItems = _useState8[1];
|
|
28845
|
+
React.useEffect(function () {
|
|
28846
|
+
setItems(craftablesItems);
|
|
28847
|
+
}, [craftablesItems]);
|
|
28842
28848
|
React.useEffect(function () {
|
|
28843
28849
|
var handleResize = function handleResize() {
|
|
28844
28850
|
if (window.innerWidth < 500 && (size == null ? void 0 : size.width) !== mobilePortrait.width && (!scale || scale < 1)) {
|
|
@@ -28862,24 +28868,32 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
28862
28868
|
}) : [].concat(current, [itemKey]);
|
|
28863
28869
|
});
|
|
28864
28870
|
};
|
|
28865
|
-
var categoryOptions = [
|
|
28871
|
+
var categoryOptions = [{
|
|
28872
|
+
id: 0,
|
|
28873
|
+
value: 'Suggested',
|
|
28874
|
+
option: 'Suggested'
|
|
28875
|
+
}].concat(pinnedItems.length > 0 ? [{
|
|
28876
|
+
id: 1,
|
|
28877
|
+
value: 'Pinned',
|
|
28878
|
+
option: 'Pinned'
|
|
28879
|
+
}] : [], Object.keys(shared.ItemSubType).filter(function (type) {
|
|
28866
28880
|
return type !== 'DeadBody';
|
|
28867
|
-
}).sort(function (a, b) {
|
|
28868
|
-
if (a === 'Suggested') return -1;
|
|
28869
|
-
if (b === 'Suggested') return 1;
|
|
28870
|
-
if (a === 'Pinned') return -1;
|
|
28871
|
-
if (b === 'Pinned') return 1;
|
|
28872
|
-
return a.localeCompare(b);
|
|
28873
28881
|
}).map(function (type, index) {
|
|
28874
28882
|
return {
|
|
28875
|
-
id: index,
|
|
28883
|
+
id: index + (pinnedItems.length > 0 ? 2 : 1),
|
|
28876
28884
|
value: type,
|
|
28877
|
-
option: type
|
|
28885
|
+
option: type === 'CraftingResources' || type === 'CraftingResource' ? 'Resources' : type
|
|
28878
28886
|
};
|
|
28887
|
+
})).sort(function (a, b) {
|
|
28888
|
+
if (a.value === 'Suggested') return -1;
|
|
28889
|
+
if (b.value === 'Suggested') return 1;
|
|
28890
|
+
if (a.value === 'Pinned') return -1;
|
|
28891
|
+
if (b.value === 'Pinned') return 1;
|
|
28892
|
+
return a.value.localeCompare(b.value);
|
|
28879
28893
|
});
|
|
28880
|
-
var filteredCraftableItems =
|
|
28894
|
+
var filteredCraftableItems = items == null ? void 0 : items.filter(function (item) {
|
|
28881
28895
|
var matchesSearch = item.name.toLowerCase().includes(searchTerm.toLowerCase());
|
|
28882
|
-
var matchesCategory = selectedType === 'Suggested' || selectedType === 'Pinned' && pinnedItems.includes(item.key) || item.
|
|
28896
|
+
var matchesCategory = selectedType === 'Suggested' || selectedType === 'Pinned' && pinnedItems.includes(item.key) || item.subType === selectedType;
|
|
28883
28897
|
return matchesSearch && matchesCategory;
|
|
28884
28898
|
});
|
|
28885
28899
|
var sortedItems = [].concat(filteredCraftableItems || []).sort(function (a, b) {
|
|
@@ -28949,7 +28963,7 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
28949
28963
|
inventory: inventory,
|
|
28950
28964
|
skills: skills
|
|
28951
28965
|
}));
|
|
28952
|
-
}))), React__default.createElement(PaginationContainer, null, React__default.createElement(PaginationButton, {
|
|
28966
|
+
}))), totalPages > 1 && React__default.createElement(PaginationContainer, null, React__default.createElement(PaginationButton, {
|
|
28953
28967
|
onClick: function onClick() {
|
|
28954
28968
|
return setCurrentPage(function (prev) {
|
|
28955
28969
|
return Math.max(1, prev - 1);
|
|
@@ -29022,7 +29036,7 @@ var ContentContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
29022
29036
|
var RadioInputScroller = /*#__PURE__*/styled__default.div.withConfig({
|
|
29023
29037
|
displayName: "CraftBook__RadioInputScroller",
|
|
29024
29038
|
componentId: "sc-19q95ue-8"
|
|
29025
|
-
})(["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-
|
|
29039
|
+
})(["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);
|
|
29026
29040
|
var CraftingRecipeWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
29027
29041
|
displayName: "CraftBook__CraftingRecipeWrapper",
|
|
29028
29042
|
componentId: "sc-19q95ue-9"
|