@asteby/metacore-runtime-react 30.0.4 → 30.0.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @asteby/metacore-runtime-react
2
2
 
3
+ ## 30.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 9604dc4: fix(runtime): OptionThumb cae a iniciales si el avatar 404 (no caja invisible)
8
+ - Updated dependencies [a0c3e39]
9
+ - @asteby/metacore-ui@2.14.3
10
+
3
11
  ## 30.0.4
4
12
 
5
13
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-select-field.d.ts","sourceRoot":"","sources":["../src/dynamic-select-field.tsx"],"names":[],"mappings":"AA0CA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,gDAAgD,CAAA;AAEjF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,IAAI,EACJ,IAAS,GACZ,EAAE;IACC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,+BA6BA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACvB,MAAM,EACN,IAAS,GACZ,EAAE;IACC,MAAM,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAA;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,sCA4BA;AAWD,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,GAAG,CAAA;IACV,QAAQ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AE;IACC,MAAM,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAA;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,sCA4BA;AAWD,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,GAAG,CAAA;IACV,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAC1B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;IAClC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,SAAS,cAAc,EAAE,GAAG,IAAI,CAAA;IAChD;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,WAAW,EACX,QAAgB,EAChB,aAAoB,EACpB,kBAA0B,EAC1B,UAAkB,GACrB,EAAE,uBAAuB,+BA8SzB;AAED,eAAe,kBAAkB,CAAA"}
@@ -46,8 +46,11 @@ export const DEFAULT_DEPENDS_HINT = 'Selecciona primero el campo del que depende
46
46
  * federated addon don't always survive the host's class scan.
47
47
  */
48
48
  export function OptionThumb({ image, name, size = 20, }) {
49
+ const [broken, setBroken] = useState(false);
49
50
  const box = { width: size, height: size };
50
- if (!image) {
51
+ // Missing or 404 image (bare avatar filenames often 404) → initials, never
52
+ // an invisible box that looks like "no avatar".
53
+ if (!image || broken) {
51
54
  return _jsx(InitialsAvatar, { name: name, size: size, rounded: "sm", tone: "neutral" });
52
55
  }
53
56
  // A lucide icon name stored where an image url/path is expected (the `icon`
@@ -55,12 +58,7 @@ export function OptionThumb({ image, name, size = 20, }) {
55
58
  if (isLucideIconName(image)) {
56
59
  return (_jsx("span", { className: "flex shrink-0 items-center justify-center rounded-sm bg-muted", style: box, "aria-hidden": true, children: _jsx(DynamicIcon, { name: image, className: "size-4" }) }));
57
60
  }
58
- return (_jsx("img", { src: image, alt: "", "aria-hidden": true, loading: "lazy", className: "shrink-0 rounded-sm object-cover", style: box,
59
- // A broken image url shouldn't leave a torn-icon glyph; collapse to
60
- // the neutral placeholder background instead.
61
- onError: (e) => {
62
- e.currentTarget.style.visibility = 'hidden';
63
- } }));
61
+ return (_jsx("img", { src: image, alt: "", "aria-hidden": true, loading: "lazy", className: "shrink-0 rounded-sm object-cover", style: box, onError: () => setBroken(true) }));
64
62
  }
65
63
  /**
66
64
  * Leading visual for an option: a photo thumbnail (FK relations with an image),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-runtime-react",
3
- "version": "30.0.4",
3
+ "version": "30.0.5",
4
4
  "description": "React runtime for metacore hosts — renders addon contributions dynamically",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,7 +38,7 @@
38
38
  "sonner": ">=1.7",
39
39
  "zustand": ">=5",
40
40
  "@asteby/metacore-sdk": "^3.4.0",
41
- "@asteby/metacore-ui": "^2.14.1"
41
+ "@asteby/metacore-ui": "^2.14.3"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "@tanstack/react-router": {
@@ -68,7 +68,7 @@
68
68
  "vitest": "^4.0.0",
69
69
  "zustand": "^5.0.0",
70
70
  "@asteby/metacore-sdk": "3.4.0",
71
- "@asteby/metacore-ui": "2.14.1"
71
+ "@asteby/metacore-ui": "2.14.3"
72
72
  },
73
73
  "scripts": {
74
74
  "build": "tsc -p tsconfig.json",
@@ -69,8 +69,11 @@ export function OptionThumb({
69
69
  name?: string | null
70
70
  size?: number
71
71
  }) {
72
+ const [broken, setBroken] = useState(false)
72
73
  const box = { width: size, height: size }
73
- if (!image) {
74
+ // Missing or 404 image (bare avatar filenames often 404) → initials, never
75
+ // an invisible box that looks like "no avatar".
76
+ if (!image || broken) {
74
77
  return <InitialsAvatar name={name} size={size} rounded="sm" tone="neutral" />
75
78
  }
76
79
  // A lucide icon name stored where an image url/path is expected (the `icon`
@@ -90,11 +93,7 @@ export function OptionThumb({
90
93
  loading="lazy"
91
94
  className="shrink-0 rounded-sm object-cover"
92
95
  style={box}
93
- // A broken image url shouldn't leave a torn-icon glyph; collapse to
94
- // the neutral placeholder background instead.
95
- onError={(e) => {
96
- e.currentTarget.style.visibility = 'hidden'
97
- }}
96
+ onError={() => setBroken(true)}
98
97
  />
99
98
  )
100
99
  }