@asteby/metacore-runtime-react 26.0.0 → 27.0.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @asteby/metacore-runtime-react
|
|
2
2
|
|
|
3
|
+
## 27.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9bd4d4e: Relation avatars render monochrome instead of one color per row.
|
|
8
|
+
|
|
9
|
+
`InitialsAvatar` gains a `tone` prop. `auto` (the default, unchanged) keeps the
|
|
10
|
+
per-name palette hash, which is meaningful for a small stable value set such as
|
|
11
|
+
a category or a status. The three relation surfaces — the dynamic-table relation
|
|
12
|
+
cell, the select options and the read-only detail dialog — now pass `neutral`,
|
|
13
|
+
which paints every imageless avatar the same muted surface. For open-ended
|
|
14
|
+
references like products or warehouses the derived color carried no meaning and
|
|
15
|
+
a listing rendered as a rainbow. Records that have an image are unaffected.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [9bd4d4e]
|
|
20
|
+
- @asteby/metacore-ui@2.12.0
|
|
21
|
+
|
|
3
22
|
## 26.0.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/dynamic-columns.js
CHANGED
|
@@ -376,7 +376,7 @@ const RelationCell = ({ col, row, getImageUrl }) => {
|
|
|
376
376
|
// alive yet stay visually distinct from option/status badges. Inline style
|
|
377
377
|
// (hex-derived) bypasses the host tailwind safelist.
|
|
378
378
|
const chipStyles = relationChipStyles(display, { isDark });
|
|
379
|
-
return (_jsxs("span", { className: "inline-flex max-w-[220px] items-center gap-1.5 rounded-md px-2 py-0.5 text-sm font-medium", style: chipStyles, title: subtitle ? `${display} · ${subtitle}` : display, children: [image ? (_jsx(RelationThumbnail, { src: image, alt: display, getImageUrl: getImageUrl, size: subtitle ? 24 : 18 })) : (_jsx(InitialsAvatar, { name: display, size: subtitle ? 24 : 18, rounded: "sm" })), subtitle ? (_jsxs("span", { className: "flex flex-col leading-tight min-w-0", children: [_jsx("span", { className: "truncate", children: display }), _jsx("span", { className: "truncate text-[0.7rem] opacity-70", children: subtitle })] })) : (_jsx("span", { className: "truncate", children: display }))] }));
|
|
379
|
+
return (_jsxs("span", { className: "inline-flex max-w-[220px] items-center gap-1.5 rounded-md px-2 py-0.5 text-sm font-medium", style: chipStyles, title: subtitle ? `${display} · ${subtitle}` : display, children: [image ? (_jsx(RelationThumbnail, { src: image, alt: display, getImageUrl: getImageUrl, size: subtitle ? 24 : 18 })) : (_jsx(InitialsAvatar, { name: display, size: subtitle ? 24 : 18, rounded: "sm", tone: "neutral" })), subtitle ? (_jsxs("span", { className: "flex flex-col leading-tight min-w-0", children: [_jsx("span", { className: "truncate", children: display }), _jsx("span", { className: "truncate text-[0.7rem] opacity-70", children: subtitle })] })) : (_jsx("span", { className: "truncate", children: display }))] }));
|
|
380
380
|
};
|
|
381
381
|
/**
|
|
382
382
|
* Renders a SAP-style polymorphic source-document reference as a navigable
|
|
@@ -47,7 +47,7 @@ export const DEFAULT_DEPENDS_HINT = 'Selecciona primero el campo del que depende
|
|
|
47
47
|
export function OptionThumb({ image, name, size = 20, }) {
|
|
48
48
|
const box = { width: size, height: size };
|
|
49
49
|
if (!image) {
|
|
50
|
-
return _jsx(InitialsAvatar, { name: name, size: size, rounded: "sm" });
|
|
50
|
+
return _jsx(InitialsAvatar, { name: name, size: size, rounded: "sm", tone: "neutral" });
|
|
51
51
|
}
|
|
52
52
|
return (_jsx("img", { src: image, alt: "", "aria-hidden": true, loading: "lazy", className: "shrink-0 rounded-sm object-cover", style: box,
|
|
53
53
|
// A broken image url shouldn't leave a torn-icon glyph; collapse to
|
|
@@ -76,7 +76,7 @@ export function OptionLead({ option, size = 20, }) {
|
|
|
76
76
|
// (shared InitialsAvatar) so it stays visually aligned with the sibling
|
|
77
77
|
// options that DO carry a thumbnail, rather than a blank gap.
|
|
78
78
|
if (option.label)
|
|
79
|
-
return _jsx(InitialsAvatar, { name: option.label, size: size, rounded: "sm" });
|
|
79
|
+
return _jsx(InitialsAvatar, { name: option.label, size: size, rounded: "sm", tone: "neutral" });
|
|
80
80
|
return null;
|
|
81
81
|
}
|
|
82
82
|
/** True when any option (or the selected one) carries a renderable visual. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asteby/metacore-runtime-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.0.0",
|
|
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.3.0",
|
|
41
|
-
"@asteby/metacore-ui": "^2.
|
|
41
|
+
"@asteby/metacore-ui": "^2.12.0"
|
|
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.3.0",
|
|
71
|
-
"@asteby/metacore-ui": "2.
|
|
71
|
+
"@asteby/metacore-ui": "2.12.0"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "tsc -p tsconfig.json",
|
package/src/dynamic-columns.tsx
CHANGED
|
@@ -518,7 +518,7 @@ const RelationCell: React.FC<{
|
|
|
518
518
|
// (shared InitialsAvatar) keyed on the label, so the "producto"-style
|
|
519
519
|
// cross-addon relation reads as a colored badge instead of text-only —
|
|
520
520
|
// matching the picker and detail surfaces.
|
|
521
|
-
<InitialsAvatar name={display} size={subtitle ? 24 : 18} rounded="sm" />
|
|
521
|
+
<InitialsAvatar name={display} size={subtitle ? 24 : 18} rounded="sm" tone="neutral" />
|
|
522
522
|
)}
|
|
523
523
|
{subtitle ? (
|
|
524
524
|
<span className="flex flex-col leading-tight min-w-0">
|
|
@@ -69,7 +69,7 @@ export function OptionThumb({
|
|
|
69
69
|
}) {
|
|
70
70
|
const box = { width: size, height: size }
|
|
71
71
|
if (!image) {
|
|
72
|
-
return <InitialsAvatar name={name} size={size} rounded="sm" />
|
|
72
|
+
return <InitialsAvatar name={name} size={size} rounded="sm" tone="neutral" />
|
|
73
73
|
}
|
|
74
74
|
return (
|
|
75
75
|
<img
|
|
@@ -125,7 +125,7 @@ export function OptionLead({
|
|
|
125
125
|
// No image/icon/color: an imageless reference option. Show its initials
|
|
126
126
|
// (shared InitialsAvatar) so it stays visually aligned with the sibling
|
|
127
127
|
// options that DO carry a thumbnail, rather than a blank gap.
|
|
128
|
-
if (option.label) return <InitialsAvatar name={option.label} size={size} rounded="sm" />
|
|
128
|
+
if (option.label) return <InitialsAvatar name={option.label} size={size} rounded="sm" tone="neutral" />
|
|
129
129
|
return null
|
|
130
130
|
}
|
|
131
131
|
|