@asteby/metacore-runtime-react 26.0.0 → 27.1.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,35 @@
1
1
  # @asteby/metacore-runtime-react
2
2
 
3
+ ## 27.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 056e231: La celda de relación en tablas dinámicas queda PLANA: se elimina la cápsula
8
+ redondeada con tinte por label alrededor de [avatar + nombre + subtítulo]. Una
9
+ referencia es dato, no estado — la pastilla hacía que un listado de productos o
10
+ almacenes se lea como una pared de badges. Identifica al registro el thumb
11
+ cuadrado-redondeado (imagen del registro, o inicial neutra como fallback) junto
12
+ a texto plano. Los badges de enum/estado conservan su pastilla de color.
13
+
14
+ ## 27.0.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 9bd4d4e: Relation avatars render monochrome instead of one color per row.
19
+
20
+ `InitialsAvatar` gains a `tone` prop. `auto` (the default, unchanged) keeps the
21
+ per-name palette hash, which is meaningful for a small stable value set such as
22
+ a category or a status. The three relation surfaces — the dynamic-table relation
23
+ cell, the select options and the read-only detail dialog — now pass `neutral`,
24
+ which paints every imageless avatar the same muted surface. For open-ended
25
+ references like products or warehouses the derived color carried no meaning and
26
+ a listing rendered as a rainbow. Records that have an image are unaffected.
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [9bd4d4e]
31
+ - @asteby/metacore-ui@2.12.0
32
+
3
33
  ## 26.0.0
4
34
 
5
35
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-columns.d.ts","sourceRoot":"","sources":["../src/dynamic-columns.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAwC9C,OAAO,KAAK,EAAiB,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE9D,OAAO,KAAK,EAER,iBAAiB,EACpB,MAAM,wBAAwB,CAAA;AAE/B,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ier, brand, …) without per-addon code.
366
366
  */
367
367
  const RelationCell = ({ col, row, getImageUrl }) => {
368
- const isDark = useIsDarkTheme();
369
368
  const display = resolveRelationLabel(col, row);
370
369
  if (!display)
371
370
  return _jsx(EmptyCell, {});
372
371
  const image = resolveRelationImage(col, row);
373
372
  const subtitle = resolveRelationSubtitle(col, row);
374
- // Deterministic, SUBTLE color keyed on the resolved label lighter than
375
- // enum badges (soft tint, no heavy fill) so category/brand chips read as
376
- // alive yet stay visually distinct from option/status badges. Inline style
377
- // (hex-derived) bypasses the host tailwind safelist.
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 }))] }));
373
+ // FLAT reference cell: no tinted capsule around the pair. A reference is
374
+ // data, not a status the pill treatment (and its per-label tint) made a
375
+ // products/warehouses listing read as a wall of badges. What identifies the
376
+ // record is the ROUNDED-SQUARE thumb (the record's image, or the neutral
377
+ // initials fallback) next to plain text; enum/status badges keep their
378
+ // colored pill so the two vocabularies stay distinct.
379
+ return (_jsxs("span", { className: "inline-flex max-w-[220px] items-center gap-1.5 text-sm font-medium", 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": "26.0.0",
3
+ "version": "27.1.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.11.0"
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.11.0"
71
+ "@asteby/metacore-ui": "2.12.0"
72
72
  },
73
73
  "scripts": {
74
74
  "build": "tsc -p tsconfig.json",
@@ -495,30 +495,25 @@ const RelationCell: React.FC<{
495
495
  row: any
496
496
  getImageUrl?: (path: string) => string
497
497
  }> = ({ col, row, getImageUrl }) => {
498
- const isDark = useIsDarkTheme()
499
498
  const display = resolveRelationLabel(col, row)
500
499
  if (!display) return <EmptyCell />
501
500
  const image = resolveRelationImage(col, row)
502
501
  const subtitle = resolveRelationSubtitle(col, row)
503
- // Deterministic, SUBTLE color keyed on the resolved label lighter than
504
- // enum badges (soft tint, no heavy fill) so category/brand chips read as
505
- // alive yet stay visually distinct from option/status badges. Inline style
506
- // (hex-derived) bypasses the host tailwind safelist.
507
- const chipStyles = relationChipStyles(display, { isDark })
502
+ // FLAT reference cell: no tinted capsule around the pair. A reference is
503
+ // data, not a status the pill treatment (and its per-label tint) made a
504
+ // products/warehouses listing read as a wall of badges. What identifies the
505
+ // record is the ROUNDED-SQUARE thumb (the record's image, or the neutral
506
+ // initials fallback) next to plain text; enum/status badges keep their
507
+ // colored pill so the two vocabularies stay distinct.
508
508
  return (
509
509
  <span
510
- className="inline-flex max-w-[220px] items-center gap-1.5 rounded-md px-2 py-0.5 text-sm font-medium"
511
- style={chipStyles}
510
+ className="inline-flex max-w-[220px] items-center gap-1.5 text-sm font-medium"
512
511
  title={subtitle ? `${display} · ${subtitle}` : display}
513
512
  >
514
513
  {image ? (
515
514
  <RelationThumbnail src={image} alt={display} getImageUrl={getImageUrl} size={subtitle ? 24 : 18} />
516
515
  ) : (
517
- // No image on the resolved sibling: a deterministic initials avatar
518
- // (shared InitialsAvatar) keyed on the label, so the "producto"-style
519
- // cross-addon relation reads as a colored badge instead of text-only —
520
- // matching the picker and detail surfaces.
521
- <InitialsAvatar name={display} size={subtitle ? 24 : 18} rounded="sm" />
516
+ <InitialsAvatar name={display} size={subtitle ? 24 : 18} rounded="sm" tone="neutral" />
522
517
  )}
523
518
  {subtitle ? (
524
519
  <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