ps99-api 2.5.0 → 2.6.0
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/example-web/react2/package-lock.json +10 -10
- package/example-web/react2/src/App.tsx +13 -10
- package/example-web/react2/src/components/AutoSizer.tsx +49 -0
- package/example-web/react2/src/components/CharmsComponent.tsx +39 -2
- package/example-web/react2/src/components/CollectionConfigIndex.tsx +707 -236
- package/example-web/react2/src/components/CollectionsIndex.tsx +346 -102
- package/example-web/react2/src/components/CollectionsLayout.tsx +17 -7
- package/example-web/react2/src/components/CurrencyComponent.tsx +3 -1
- package/example-web/react2/src/components/DynamicCollectionConfigData.tsx +10 -1
- package/example-web/react2/src/components/EnchantsComponent.tsx +45 -40
- package/example-web/react2/src/components/Footer.tsx +17 -0
- package/example-web/react2/src/components/Header.tsx +40 -21
- package/example-web/react2/src/components/MasteryComponent.tsx +105 -33
- package/example-web/react2/src/components/PotionsComponent.tsx +96 -18
- package/example-web/react2/src/components/ReactWindowMock.tsx +73 -0
- package/example-web/react2/src/components/UpgradesComponent.tsx +4 -3
- package/example-web/react2/src/context/ScrollContext.tsx +35 -0
- package/example-web/react2/src/hooks/useCollapsibleHeader.ts +69 -0
- package/example-web/react2/src/utils/gigantix.ts +40 -0
- package/package.json +1 -1
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
"version": "1.0.1",
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"axios": "^1.
|
|
44
|
+
"axios": "^1.13.5"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@jest/globals": "^29.7.0",
|
|
48
48
|
"@semantic-release/git": "^10.0.1",
|
|
49
|
-
"@tsconfig/
|
|
50
|
-
"@types/jest": "^29.5.
|
|
51
|
-
"@types/node": "^
|
|
49
|
+
"@tsconfig/node22": "^22.0.5",
|
|
50
|
+
"@types/jest": "^29.5.14",
|
|
51
|
+
"@types/node": "^25.2.3",
|
|
52
52
|
"cz-conventional-changelog": "^3.3.0",
|
|
53
|
-
"dets": "^0.
|
|
54
|
-
"esbuild": "0.
|
|
53
|
+
"dets": "^0.17.0",
|
|
54
|
+
"esbuild": "^0.27.3",
|
|
55
55
|
"jest": "^29.7.0",
|
|
56
|
-
"prettier": "^3.
|
|
57
|
-
"semantic-release": "^
|
|
58
|
-
"ts-jest": "^29.
|
|
59
|
-
"typescript": "^5.
|
|
56
|
+
"prettier": "^3.8.1",
|
|
57
|
+
"semantic-release": "^25.0.3",
|
|
58
|
+
"ts-jest": "^29.4.6",
|
|
59
|
+
"typescript": "^5.9.3"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"node_modules/@apideck/better-ajv-errors": {
|
|
@@ -7,20 +7,23 @@ import CollectionConfigIndex from "./components/CollectionConfigIndex";
|
|
|
7
7
|
import DynamicCollectionConfigData from "./components/DynamicCollectionConfigData";
|
|
8
8
|
import CollectionsLayout from "./components/CollectionsLayout";
|
|
9
9
|
import Footer from "./components/Footer";
|
|
10
|
+
import { ScrollProvider } from "./context/ScrollContext";
|
|
10
11
|
|
|
11
12
|
const App: React.FC = () => {
|
|
12
13
|
return (
|
|
13
14
|
<Router>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<Route
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
<ScrollProvider>
|
|
16
|
+
<Header />
|
|
17
|
+
<Routes>
|
|
18
|
+
<Route path="/" element={<HomePage />} />
|
|
19
|
+
<Route path="/collections" element={<CollectionsIndex />} />
|
|
20
|
+
<Route element={<CollectionsLayout />}>
|
|
21
|
+
<Route path="/collections/:collectionName" element={<CollectionConfigIndex />} />
|
|
22
|
+
<Route path="/collections/:collectionName/:configName" element={<DynamicCollectionConfigData />} />
|
|
23
|
+
</Route>
|
|
24
|
+
</Routes>
|
|
25
|
+
<Footer />
|
|
26
|
+
</ScrollProvider>
|
|
24
27
|
</Router>
|
|
25
28
|
);
|
|
26
29
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { useState, useLayoutEffect, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
export default function AutoSizer({
|
|
4
|
+
children,
|
|
5
|
+
className,
|
|
6
|
+
defaultHeight,
|
|
7
|
+
defaultWidth,
|
|
8
|
+
style,
|
|
9
|
+
renderProp,
|
|
10
|
+
...rest
|
|
11
|
+
}: any) {
|
|
12
|
+
const [size, setSize] = useState({ height: defaultHeight || 0, width: defaultWidth || 0 });
|
|
13
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
14
|
+
|
|
15
|
+
useLayoutEffect(() => {
|
|
16
|
+
const element = ref.current;
|
|
17
|
+
if (!element) return;
|
|
18
|
+
|
|
19
|
+
const ResizeObserver = (window as any).ResizeObserver;
|
|
20
|
+
if (!ResizeObserver) return;
|
|
21
|
+
|
|
22
|
+
const observer = new ResizeObserver((entries: any) => {
|
|
23
|
+
for (const entry of entries) {
|
|
24
|
+
if (entry.contentRect) {
|
|
25
|
+
const { width, height } = entry.contentRect;
|
|
26
|
+
// Rounding for stability
|
|
27
|
+
setSize({ width: Math.floor(width), height: Math.floor(height) });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
observer.observe(element);
|
|
33
|
+
return () => observer.disconnect();
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
const childParams = size;
|
|
37
|
+
|
|
38
|
+
// Render prop takes precedence if provided (based on my usage in other files)
|
|
39
|
+
const content = renderProp
|
|
40
|
+
? renderProp(childParams)
|
|
41
|
+
: (typeof children === 'function' ? children(childParams) : children);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className={className} ref={ref} style={{ ...style, width: '100%', height: '100%', overflow: 'hidden' }}>
|
|
45
|
+
{/* Only render content if we have size, or if default provided to avoid jumpiness */}
|
|
46
|
+
{(size.width > 0 && size.height > 0) ? content : null}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -9,9 +9,46 @@ const CharmsComponent: React.FC<{
|
|
|
9
9
|
}> = ({ configData }) => {
|
|
10
10
|
const { getRarityColor } = useItemResolution();
|
|
11
11
|
|
|
12
|
+
const isSingleTier = configData.Tiers.length === 1;
|
|
13
|
+
|
|
14
|
+
if (isSingleTier) {
|
|
15
|
+
const tier = configData.Tiers[0];
|
|
16
|
+
const rarityColor = tier.Rarity ? getRarityColor(tier.Rarity) : null;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div style={{ width: '100%', height: '100%', boxSizing: 'border-box', display: 'flex', flexDirection: 'column', alignItems: 'center', paddingTop: '20px' }}>
|
|
20
|
+
<div style={{
|
|
21
|
+
width: '120px',
|
|
22
|
+
height: '120px',
|
|
23
|
+
borderRadius: '16px',
|
|
24
|
+
border: rarityColor ? `4px solid ${rarityColor}` : '4px solid #eee',
|
|
25
|
+
padding: '10px',
|
|
26
|
+
backgroundColor: '#fff',
|
|
27
|
+
boxShadow: '0 4px 10px rgba(0,0,0,0.1)',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
marginBottom: '20px'
|
|
32
|
+
}}>
|
|
33
|
+
<ImageComponent src={configData.Icon} alt={tier.DisplayName} style={{ width: '100%', height: '100%', objectFit: 'contain' }} />
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div style={{ textAlign: 'center', maxWidth: '400px' }}>
|
|
37
|
+
{configData.BaseTier !== 1 && <p><strong>Base Tier:</strong> {configData.BaseTier}</p>}
|
|
38
|
+
{configData.MaxTier !== 1 && <p><strong>Max Tier:</strong> {configData.MaxTier}</p>}
|
|
39
|
+
{configData.DiminishPowerThreshold && <p><strong>Diminish:</strong> {configData.DiminishPowerThreshold}</p>}
|
|
40
|
+
{configData.Unique && <span className="badge" style={{ display: 'inline-block', marginBottom: '10px' }}>Unique</span>}
|
|
41
|
+
|
|
42
|
+
<h3 style={{ margin: '10px 0', fontSize: '1.5em', color: '#333' }}>{tier.DisplayName}</h3>
|
|
43
|
+
<p style={{ color: '#666', fontSize: '1.1em', marginBottom: '15px' }}>{tier.Desc}</p>
|
|
44
|
+
<p style={{ fontWeight: '900', fontSize: '1.2em', color: '#333' }}>Power: {tier.Power}</p>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
12
50
|
return (
|
|
13
51
|
<div style={{ width: '100%', height: '100%', boxSizing: 'border-box' }}>
|
|
14
|
-
|
|
15
52
|
<div style={{ display: 'flex', gap: '20px', justifyContent: 'center', flexWrap: 'wrap', marginBottom: '20px' }}>
|
|
16
53
|
<div style={{ width: '150px' }}>
|
|
17
54
|
<ImageComponent src={configData.Icon} alt={configData.Tiers[0].DisplayName} />
|
|
@@ -26,7 +63,7 @@ const CharmsComponent: React.FC<{
|
|
|
26
63
|
|
|
27
64
|
<div style={{ marginTop: '20px' }}>
|
|
28
65
|
<h3 style={{ fontSize: '1.2em', borderBottom: '1px solid #eee', paddingBottom: '5px' }}>Tiers</h3>
|
|
29
|
-
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(
|
|
66
|
+
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(150px, 1fr))", gap: "15px", marginTop: '15px' }}>
|
|
30
67
|
{configData.Tiers.map((tier, index) => {
|
|
31
68
|
const rarityColor = tier.Rarity ? getRarityColor(tier.Rarity) : null;
|
|
32
69
|
return (
|