@terrafirmagreg-team/recipe 1.2.9 → 1.2.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terrafirmagreg-team/recipe",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Recipe viewer and calculator",
|
|
6
6
|
"license": "LGPL-3.0-only",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@terrafirmagreg-team/data": "^1.2.3",
|
|
27
|
-
"@terrafirmagreg-team/dump": "^1.2.
|
|
28
|
-
"@terrafirmagreg-team/game": "^1.2.
|
|
29
|
-
"@terrafirmagreg-team/kit": "^1.2.
|
|
30
|
-
"@terrafirmagreg-team/mdx": "^1.2.
|
|
27
|
+
"@terrafirmagreg-team/dump": "^1.2.7",
|
|
28
|
+
"@terrafirmagreg-team/game": "^1.2.6",
|
|
29
|
+
"@terrafirmagreg-team/kit": "^1.2.12",
|
|
30
|
+
"@terrafirmagreg-team/mdx": "^1.2.7",
|
|
31
31
|
"@terrafirmagreg-team/preview": "^1.2.3",
|
|
32
32
|
"@terrafirmagreg-team/sites": "^1.2.2",
|
|
33
|
-
"@terrafirmagreg-team/translate": "^1.2.
|
|
34
|
-
"@terrafirmagreg-team/ui": "^1.2.
|
|
33
|
+
"@terrafirmagreg-team/translate": "^1.2.8",
|
|
34
|
+
"@terrafirmagreg-team/ui": "^1.2.9",
|
|
35
35
|
"@types/pathfinding": "^0.1.0",
|
|
36
36
|
"comlink": "^4.4.2",
|
|
37
37
|
"fflate": "0.8.3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useMemo, useRef
|
|
3
|
+
import { useMemo, useRef } from 'react';
|
|
4
4
|
import { SlotHitbox } from '@terrafirmagreg-team/recipe/components/cards/slot-hitbox';
|
|
5
5
|
import { recipeGlareFilter } from '@terrafirmagreg-team/recipe/components/cards/glare-filter';
|
|
6
6
|
import {
|
|
@@ -21,7 +21,6 @@ import { dumpRelPublicUrl } from '@terrafirmagreg-team/dump/lib/dump/paths';
|
|
|
21
21
|
import { useDumpLocation } from '@terrafirmagreg-team/game/hooks/use-dump-location';
|
|
22
22
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
23
23
|
import { useInView } from '@terrafirmagreg-team/ui/hooks/use-in-view';
|
|
24
|
-
import { cn } from '@terrafirmagreg-team/ui/lib/utils/cn';
|
|
25
24
|
import { GlbEmbedViewer } from '@terrafirmagreg-team/ui/components/blocks/media/glb/viewer';
|
|
26
25
|
import type { EntryTooltipLevel } from '@terrafirmagreg-team/game/components/entry/tooltip';
|
|
27
26
|
import type {
|
|
@@ -100,19 +99,10 @@ export function RecipeCard({
|
|
|
100
99
|
? dumpRelPublicUrl(dataset, multiblock.glb)
|
|
101
100
|
: undefined;
|
|
102
101
|
|
|
103
|
-
const [imgReady, setImgReady] = useState(false);
|
|
104
|
-
const [prevImgSrc, setPrevImgSrc] = useState(src);
|
|
105
|
-
if (prevImgSrc !== src) {
|
|
106
|
-
setPrevImgSrc(src);
|
|
107
|
-
setImgReady(false);
|
|
108
|
-
}
|
|
109
102
|
return (
|
|
110
103
|
<div
|
|
111
104
|
ref={rootRef}
|
|
112
|
-
className=
|
|
113
|
-
'relative w-fit overflow-hidden rounded-sm',
|
|
114
|
-
imgReady && 'bg-mc-panel',
|
|
115
|
-
)}
|
|
105
|
+
className="relative w-fit overflow-hidden rounded-sm bg-mc-panel"
|
|
116
106
|
>
|
|
117
107
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
|
118
108
|
<img
|
|
@@ -125,7 +115,6 @@ export function RecipeCard({
|
|
|
125
115
|
decoding="async"
|
|
126
116
|
draggable={false}
|
|
127
117
|
onError={onFail}
|
|
128
|
-
onLoad={() => setImgReady(true)}
|
|
129
118
|
style={recipeGlareFilter}
|
|
130
119
|
/>
|
|
131
120
|
{inView && interactive && glbUrl ? (
|
|
@@ -29,13 +29,6 @@ export function PagedCard({
|
|
|
29
29
|
const inView = props.eager || observedInView;
|
|
30
30
|
const [page, setPage] = useState(0);
|
|
31
31
|
|
|
32
|
-
const [imgReady, setImgReady] = useState(false);
|
|
33
|
-
const [prevSrc, setPrevSrc] = useState(src);
|
|
34
|
-
if (prevSrc !== src) {
|
|
35
|
-
setPrevSrc(src);
|
|
36
|
-
setImgReady(false);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
32
|
const slots = useMemo(() => recipeSlots(recipe), [recipe]);
|
|
40
33
|
const visibleH = maxH ? Math.floor(maxH) : 0;
|
|
41
34
|
const overflow = visibleH > 0 && natural > visibleH;
|
|
@@ -109,8 +102,7 @@ export function PagedCard({
|
|
|
109
102
|
<div
|
|
110
103
|
ref={rootRef}
|
|
111
104
|
className={cn(
|
|
112
|
-
'relative w-fit overflow-hidden rounded-sm',
|
|
113
|
-
imgReady && 'bg-mc-panel',
|
|
105
|
+
'relative w-fit overflow-hidden rounded-sm bg-mc-panel',
|
|
114
106
|
)}
|
|
115
107
|
style={{ height: pinTop + memberH + capH }}
|
|
116
108
|
{...swipe}
|
|
@@ -181,7 +173,6 @@ export function PagedCard({
|
|
|
181
173
|
}}
|
|
182
174
|
loading="lazy"
|
|
183
175
|
decoding="async"
|
|
184
|
-
onLoad={() => setImgReady(true)}
|
|
185
176
|
/>
|
|
186
177
|
</div>
|
|
187
178
|
{pages > 1 && (
|
|
@@ -83,9 +83,7 @@ export function StripCard({
|
|
|
83
83
|
<div
|
|
84
84
|
ref={rootRef}
|
|
85
85
|
className={cn(
|
|
86
|
-
'relative w-fit overflow-hidden rounded-sm',
|
|
87
|
-
|
|
88
|
-
measured?.src === src && 'bg-mc-panel',
|
|
86
|
+
'relative w-fit overflow-hidden rounded-sm bg-mc-panel',
|
|
89
87
|
)}
|
|
90
88
|
style={{
|
|
91
89
|
width: imgW,
|