@terrafirmagreg-team/game 1.2.7 → 1.2.8

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/game",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "type": "module",
5
5
  "description": "Game-data components and catalogs",
6
6
  "license": "LGPL-3.0-only",
@@ -25,13 +25,13 @@
25
25
  "./styles.css": "./styles.css"
26
26
  },
27
27
  "dependencies": {
28
- "@terrafirmagreg-team/data": "^1.2.5",
29
- "@terrafirmagreg-team/dump": "^1.2.12",
30
- "@terrafirmagreg-team/kit": "^1.2.18",
31
- "@terrafirmagreg-team/search": "^1.2.6",
28
+ "@terrafirmagreg-team/data": "^1.2.6",
29
+ "@terrafirmagreg-team/dump": "^1.2.13",
30
+ "@terrafirmagreg-team/kit": "^1.2.19",
31
+ "@terrafirmagreg-team/search": "^1.2.7",
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.10",
34
+ "@terrafirmagreg-team/ui": "^1.2.13",
35
35
  "lucide-react": "^1.70.0",
36
36
  "server-only": "^0.0.1"
37
37
  },
@@ -1,6 +1,13 @@
1
1
  import { FormatText } from '@terrafirmagreg-team/ui/components/blocks/text/format-text';
2
+ import type { ColorSurface } from '@terrafirmagreg-team/ui/lib/color';
2
3
  import { MC_FORMAT } from '@terrafirmagreg-team/dump/lib/dump/contract/text';
3
4
 
4
- export function McText({ text }: { text: string }) {
5
- return <FormatText text={text} format={MC_FORMAT} />;
5
+ export function McText({
6
+ text,
7
+ surface = 'normal',
8
+ }: {
9
+ text: string;
10
+ surface?: ColorSurface;
11
+ }) {
12
+ return <FormatText text={text} format={MC_FORMAT} surface={surface} />;
6
13
  }
@@ -8,6 +8,7 @@ import { LazyTooltip } from '@terrafirmagreg-team/ui/components/blocks/tooltip/l
8
8
  import { stackTooltip } from '@terrafirmagreg-team/game/lib/entry/tooltip';
9
9
  import { formulaRuns } from '@terrafirmagreg-team/game/lib/entry/formula';
10
10
  import { McText } from '@terrafirmagreg-team/game/components/entry/mc-text';
11
+ import { readableColor } from '@terrafirmagreg-team/ui/lib/color';
11
12
  import { stripMcFormat } from '@terrafirmagreg-team/dump/lib/dump/assets/lang/names';
12
13
 
13
14
  const ENCHANTED_TEXT_COLOR = 'var(--color-mc-enchant)';
@@ -21,12 +22,15 @@ export type EntryTooltipLevel =
21
22
 
22
23
  function TooltipLine({ text }: { text: string }) {
23
24
  const runs = formulaRuns(stripMcFormat(text));
24
- if (!runs) return <McText text={text} />;
25
+ if (!runs) return <McText text={text} surface="inverted" />;
25
26
  return (
26
27
  <>
27
28
  {runs.map((run, index) =>
28
29
  run.color ? (
29
- <span key={index} style={{ color: run.color }}>
30
+ <span
31
+ key={index}
32
+ style={{ color: readableColor(run.color, 'inverted') }}
33
+ >
30
34
  {run.text}
31
35
  </span>
32
36
  ) : (