@terrafirmagreg-team/recipe 1.2.17 → 1.2.19

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.17",
3
+ "version": "1.2.19",
4
4
  "type": "module",
5
5
  "description": "Recipe viewer and calculator",
6
6
  "license": "LGPL-3.0-only",
@@ -23,15 +23,15 @@
23
23
  "./styles.css": "./styles.css"
24
24
  },
25
25
  "dependencies": {
26
- "@terrafirmagreg-team/data": "^1.2.5",
27
- "@terrafirmagreg-team/dump": "^1.2.12",
28
- "@terrafirmagreg-team/game": "^1.2.6",
29
- "@terrafirmagreg-team/kit": "^1.2.18",
30
- "@terrafirmagreg-team/mdx": "^1.2.8",
31
- "@terrafirmagreg-team/preview": "^1.2.4",
26
+ "@terrafirmagreg-team/data": "^1.2.9",
27
+ "@terrafirmagreg-team/dump": "^1.2.13",
28
+ "@terrafirmagreg-team/game": "^1.2.8",
29
+ "@terrafirmagreg-team/kit": "^1.2.21",
30
+ "@terrafirmagreg-team/mdx": "^1.2.10",
31
+ "@terrafirmagreg-team/preview": "^1.2.5",
32
32
  "@terrafirmagreg-team/sites": "^1.2.3",
33
- "@terrafirmagreg-team/translate": "^1.2.9",
34
- "@terrafirmagreg-team/ui": "^1.2.12",
33
+ "@terrafirmagreg-team/translate": "^1.2.11",
34
+ "@terrafirmagreg-team/ui": "^1.2.15",
35
35
  "@types/pathfinding": "^0.1.0",
36
36
  "comlink": "^4.4.2",
37
37
  "fflate": "0.8.3",
@@ -39,7 +39,7 @@ export function CardText({
39
39
  : {}),
40
40
  }}
41
41
  >
42
- <McText text={content} />
42
+ <McText text={content} surface="dark" />
43
43
  </span>
44
44
  );
45
45
  }
@@ -52,7 +52,7 @@ export function CardWidgetTips({
52
52
  <TooltipContent className="flex-col items-start gap-0.5 p-3 text-sm whitespace-pre-wrap">
53
53
  {(widget.tooltip ?? []).map((line, lineIndex) => (
54
54
  <p key={lineIndex}>
55
- <McText text={line} />
55
+ <McText text={line} surface="dark" />
56
56
  </p>
57
57
  ))}
58
58
  </TooltipContent>
@@ -37,27 +37,36 @@ export function StripCardTagPager({
37
37
  onMouseLeave={() => setHover(false)}
38
38
  onFocus={() => setHover(true)}
39
39
  onBlur={() => setHover(false)}
40
- className="absolute flex cursor-pointer items-center justify-center border-0 p-0 outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-default"
40
+ className="absolute flex cursor-pointer items-center justify-center border-0 bg-transparent p-0 outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-default"
41
41
  style={{
42
- left,
43
- top,
44
- width: 12 * scale,
45
- height: 12 * scale,
46
- background: disabled ? 'var(--color-mc-dim)' : hover ? 'var(--color-mc-bright)' : 'var(--color-mc-panel)',
47
- boxShadow: `inset ${scale}px ${scale}px 0 rgba(255,255,255,0.65), inset -${scale}px -${scale}px 0 rgba(0,0,0,0.45)`,
42
+ left: left - 4 * scale,
43
+ top: top - 4 * scale,
44
+ width: 20 * scale,
45
+ height: 20 * scale,
48
46
  }}
49
47
  >
50
48
  <span
51
49
  aria-hidden
52
- className="block"
50
+ className="flex items-center justify-center"
53
51
  style={{
54
- width: 0,
55
- height: 0,
56
- borderTop: `${2.5 * scale}px solid transparent`,
57
- borderBottom: `${2.5 * scale}px solid transparent`,
58
- ...(dir < 0 ? { borderRight: arrow } : { borderLeft: arrow }),
52
+ width: 12 * scale,
53
+ height: 12 * scale,
54
+ background: disabled ? 'var(--color-mc-dim)' : hover ? 'var(--color-mc-bright)' : 'var(--color-mc-panel)',
55
+ boxShadow: `inset ${scale}px ${scale}px 0 rgba(255,255,255,0.65), inset -${scale}px -${scale}px 0 rgba(0,0,0,0.45)`,
59
56
  }}
60
- />
57
+ >
58
+ <span
59
+ aria-hidden
60
+ className="block"
61
+ style={{
62
+ width: 0,
63
+ height: 0,
64
+ borderTop: `${2.5 * scale}px solid transparent`,
65
+ borderBottom: `${2.5 * scale}px solid transparent`,
66
+ ...(dir < 0 ? { borderRight: arrow } : { borderLeft: arrow }),
67
+ }}
68
+ />
69
+ </span>
61
70
  </button>
62
71
  );
63
72
  }
@@ -88,18 +97,27 @@ export function StripCardTagCopy({
88
97
  onMouseLeave={() => setHover(false)}
89
98
  onFocus={() => setHover(true)}
90
99
  onBlur={() => setHover(false)}
91
- className="absolute flex cursor-pointer items-center justify-center border-0 p-0 outline-none focus-visible:ring-1 focus-visible:ring-ring"
100
+ className="absolute flex cursor-pointer items-center justify-center border-0 bg-transparent p-0 outline-none focus-visible:ring-1 focus-visible:ring-ring"
92
101
  style={{
93
- left,
94
- top,
95
- width: 12 * scale,
96
- height: 12 * scale,
97
- background: done ? 'var(--color-mc-bright)' : hover ? 'var(--color-mc-bright)' : 'var(--color-mc-panel)',
98
- boxShadow: `inset ${scale}px ${scale}px 0 rgba(255,255,255,0.65), inset -${scale}px -${scale}px 0 rgba(0,0,0,0.45)`,
99
- color: done ? 'var(--color-mc-done)' : hover ? 'var(--color-mc-arrow-dark)' : 'var(--color-mc-arrow)',
102
+ left: left - 4 * scale,
103
+ top: top - 4 * scale,
104
+ width: 20 * scale,
105
+ height: 20 * scale,
100
106
  }}
101
107
  >
102
- <Icon width={7 * scale} height={7 * scale} strokeWidth={2.5} />
108
+ <span
109
+ aria-hidden
110
+ className="flex items-center justify-center"
111
+ style={{
112
+ width: 12 * scale,
113
+ height: 12 * scale,
114
+ background: done ? 'var(--color-mc-bright)' : hover ? 'var(--color-mc-bright)' : 'var(--color-mc-panel)',
115
+ boxShadow: `inset ${scale}px ${scale}px 0 rgba(255,255,255,0.65), inset -${scale}px -${scale}px 0 rgba(0,0,0,0.45)`,
116
+ color: done ? 'var(--color-mc-done)' : hover ? 'var(--color-mc-arrow-dark)' : 'var(--color-mc-arrow)',
117
+ }}
118
+ >
119
+ <Icon width={7 * scale} height={7 * scale} strokeWidth={2.5} />
120
+ </span>
103
121
  </button>
104
122
  );
105
123
  }
@@ -31,7 +31,7 @@ export function AlloyStackBar({
31
31
  return (
32
32
  <div
33
33
  className={cn(
34
- 'flex h-3 w-full overflow-hidden rounded bg-secondary',
34
+ 'flex h-3 w-full overflow-hidden rounded bg-foreground/15',
35
35
  className,
36
36
  )}
37
37
  role={label ? 'img' : undefined}
@@ -268,7 +268,7 @@ export function RecipeCardGrid({
268
268
  <div
269
269
  ref={boxRef}
270
270
  {...swipe}
271
- className="flex min-h-0 flex-1 flex-col items-center justify-start gap-2 overflow-x-hidden"
271
+ className="flex min-h-0 flex-1 flex-col items-center justify-start gap-2 overflow-x-auto"
272
272
  >
273
273
  {body}
274
274
  </div>
@@ -83,7 +83,7 @@ export function ItemViewHeader({
83
83
  variant="ghost"
84
84
  tooltip={false}
85
85
  label={t('NBT', { note: 'recipe.nbt' })}
86
- className="size-7 rounded-lg text-muted-foreground hover:text-foreground [&_svg]:size-3.5"
86
+ className="size-8 rounded-lg text-muted-foreground hover:text-foreground [&_svg]:size-3.5"
87
87
  >
88
88
  <Braces />
89
89
  </IconButton>
@@ -115,7 +115,7 @@ export function ItemViewHeader({
115
115
  <IconButton
116
116
  variant="ghost"
117
117
  label={t('Add to calculator', { note: 'recipe.calc.add.title' })}
118
- className="size-7 rounded-lg text-muted-foreground hover:text-foreground [&_svg]:size-3.5"
118
+ className="size-8 rounded-lg text-muted-foreground hover:text-foreground [&_svg]:size-3.5"
119
119
  onClick={onAddToCalc}
120
120
  >
121
121
  <Calculator />
@@ -51,14 +51,18 @@ export function IconPicker({
51
51
  className={
52
52
  alwaysVisible
53
53
  ? undefined
54
- : 'opacity-0 transition-opacity group-hover:opacity-100'
54
+ : 'opacity-0 transition-opacity group-hover:opacity-100 [@media(hover:none)]:opacity-100'
55
55
  }
56
56
  />
57
57
  }
58
58
  >
59
59
  {icon ?? <Shapes className="size-3.5" />}
60
60
  </PopoverTrigger>
61
- <PopoverContent side="bottom" align="start" className="w-72 p-2">
61
+ <PopoverContent
62
+ side="bottom"
63
+ align="start"
64
+ className="w-[min(18rem,calc(100vw-2rem))] p-2"
65
+ >
62
66
  <Input
63
67
  autoFocus
64
68
  value={query}
@@ -66,7 +70,7 @@ export function IconPicker({
66
70
  placeholder={t('Search items', { note: 'recipe.search' })}
67
71
  className="h-7 px-2 text-xs"
68
72
  />
69
- <div className="mt-2 grid max-h-60 grid-cols-6 gap-1 overflow-y-auto">
73
+ <div className="mt-2 grid max-h-60 grid-cols-[repeat(auto-fill,minmax(2.5rem,1fr))] gap-1 overflow-x-clip overflow-y-auto">
70
74
  {results.map((item) => (
71
75
  <button
72
76
  key={`${item.kind}:${item.id}`}
@@ -78,7 +78,7 @@ export function CalcTrees({
78
78
  {t('Schemes', { note: 'recipe.calc.trees' })}
79
79
  </LeftSidebarFolderTrigger>
80
80
  <LeftSidebarFolderContent>
81
- <ul className="flex max-h-60 flex-col overflow-y-auto">
81
+ <ul className="flex max-h-60 flex-col overflow-x-clip overflow-y-auto">
82
82
  {tabs.map((tab) => (
83
83
  <TabRow
84
84
  key={tab.id}
@@ -95,7 +95,7 @@ export function CalcTrees({
95
95
  <button
96
96
  type="button"
97
97
  onClick={onNew}
98
- className={`${rowClass} ${rowIdle}`}
98
+ className={`${rowClass} ${rowIdle} w-full`}
99
99
  >
100
100
  <Plus className="size-4 shrink-0" />
101
101
  <span className="min-w-0 flex-1 text-start">
@@ -60,7 +60,7 @@ export function TabRow({
60
60
  <button
61
61
  type="button"
62
62
  onClick={() => onOpen(entry.id)}
63
- className={`${rowClass} ${
63
+ className={`${rowClass} flex-1 ${
64
64
  active
65
65
  ? 'bg-accent font-medium text-accent-foreground'
66
66
  : rowIdle
@@ -81,7 +81,7 @@ export function TabRow({
81
81
  ) : null}
82
82
  <IconButton
83
83
  label={t('Rename', { note: 'recipe.calc.rename' })}
84
- className="opacity-0 transition-opacity group-hover:opacity-100"
84
+ className="opacity-0 transition-opacity group-hover:opacity-100 [@media(hover:none)]:opacity-100"
85
85
  onClick={() => {
86
86
  setName(entry.name ?? '');
87
87
  setEditing(true);
@@ -91,7 +91,7 @@ export function TabRow({
91
91
  </IconButton>
92
92
  <IconButton
93
93
  label={t('Close scheme', { note: 'recipe.calc.close_tab' })}
94
- className="opacity-0 transition-opacity group-hover:opacity-100"
94
+ className="opacity-0 transition-opacity group-hover:opacity-100 [@media(hover:none)]:opacity-100"
95
95
  onClick={() => onClose(entry.id)}
96
96
  >
97
97
  <X className="size-3.5" />
@@ -119,7 +119,7 @@ export function HistoryRow({
119
119
  <button
120
120
  type="button"
121
121
  onClick={() => onOpen(entry)}
122
- className={`${rowClass} ${rowIdle}`}
122
+ className={`${rowClass} ${rowIdle} flex-1`}
123
123
  >
124
124
  <TreeIcon entry={entry} {...meta} />
125
125
  <TreeLabel entry={entry} {...meta} />
@@ -128,7 +128,7 @@ export function HistoryRow({
128
128
  {onRemove && (
129
129
  <IconButton
130
130
  label={t('Remove from history', { note: 'recipe.calc.remove.history' })}
131
- className="opacity-0 transition-opacity group-hover:opacity-100"
131
+ className="opacity-0 transition-opacity group-hover:opacity-100 [@media(hover:none)]:opacity-100"
132
132
  onClick={() => onRemove(entry.id)}
133
133
  >
134
134
  <X className="size-3.5" />
@@ -11,7 +11,7 @@ export type EntryMeta = {
11
11
  };
12
12
 
13
13
  export const rowClass =
14
- 'flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors';
14
+ 'flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors';
15
15
  export const rowIdle =
16
16
  'text-muted-foreground hover:bg-accent hover:text-accent-foreground';
17
17
 
@@ -145,11 +145,6 @@ export function removeCalcHistory(key: string, id: string): void {
145
145
  key,
146
146
  readCalcHistory(key).filter((entry) => entry.id !== id),
147
147
  );
148
- const tabs = readCalcTabs(key).filter((tab) => tab.id !== id);
149
- writeTabsRaw(key, tabs);
150
- if (readCalcActive(key) === id) {
151
- window.sessionStorage.setItem(activeKey(key), '');
152
- }
153
148
  } catch {
154
149
  return;
155
150
  }
package/styles/calc.css CHANGED
@@ -58,6 +58,12 @@
58
58
  cursor: default;
59
59
  }
60
60
 
61
+ .calc-port::before {
62
+ content: '';
63
+ position: absolute;
64
+ inset: -6px;
65
+ }
66
+
61
67
  .calc-rail .calc-port {
62
68
  position: relative;
63
69
  flex: none;
@@ -274,12 +280,12 @@
274
280
  }
275
281
 
276
282
  .calc-edge-label__input {
277
- width: 56px;
283
+ width: 68px;
278
284
  border-radius: 4px;
279
285
  border: 1px solid var(--color-primary);
280
286
  background: var(--color-card);
281
287
  padding: 1px 4px;
282
- font-size: 10px;
288
+ font-size: 11px;
283
289
  outline: none;
284
290
  }
285
291