@asteby/metacore-runtime-react 30.0.2 → 30.0.3

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,11 @@
1
1
  # @asteby/metacore-runtime-react
2
2
 
3
+ ## 30.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 05d1cef: Permisos: labels de acciones sin truncate (wrap) y grid a 2 columnas; soporta description en PermissionActionDef.
8
+
3
9
  ## 30.0.2
4
10
 
5
11
  ### Patch Changes
@@ -4,6 +4,11 @@ export interface PermissionActionDef {
4
4
  key: string;
5
5
  /** Localized label ("Listar", "Pagar", "Acceder"). */
6
6
  label: string;
7
+ /**
8
+ * Optional secondary line under the label (e.g. action name when the label
9
+ * is the module — used by screen → API shortcut checkboxes).
10
+ */
11
+ description?: string;
7
12
  /** Lucide icon name from the manifest action (optional). */
8
13
  icon?: string;
9
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"permissions-manager.d.ts","sourceRoot":"","sources":["../src/permissions-manager.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA6D9B,MAAM,WAAW,mBAAmB;IAChC,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAA;IACX,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAA;IACb,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAA;IAC3D;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,mBAAmB;IAChC;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAA;IACX,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAA;IACb,6DAA6D;I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;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG,kBAAkB,EAAE,CAwBvF;AAED,oEAAoE;AACpE,wBAAgB,qBAAqB,CACjC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,mBAAmB,GAC5B,MAAM,CAER;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAI3F;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAsB1E;AAoCD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,EAAE,CA0BjF;AAED,gEAAgE;AAChE,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,mBAAmB,EAAE,CAE1E;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,CAYtF;AAmHD,wBAAgB,kBAAkB,CAAC,EAC/B,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAA0B,EAC1B,SAAS,GACZ,EAAE,uBAAuB,qBAguBzB"}
@@ -210,7 +210,7 @@ function CapabilityCheck({ checked, disabled, onToggle, icon, label, description
210
210
  e.preventDefault();
211
211
  onToggle();
212
212
  }
213
- }, className: cn('flex items-start gap-2.5 rounded-md border border-border/60 bg-card px-3 py-2.5 text-sm transition-colors', disabled ? 'opacity-50' : 'cursor-pointer hover:bg-muted/40', checked && 'border-primary/40 bg-primary/5'), children: [_jsx(Checkbox, { checked: checked, "aria-hidden": "true", tabIndex: -1, className: "pointer-events-none mt-0.5 shrink-0" }), icon && (_jsx(DynamicIcon, { name: icon, className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" })), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "block truncate font-medium text-foreground", children: label }), description && (_jsx("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: description }))] })] }));
213
+ }, className: cn('flex items-start gap-2.5 rounded-md border border-border/60 bg-card px-3 py-2.5 text-sm transition-colors', disabled ? 'opacity-50' : 'cursor-pointer hover:bg-muted/40', checked && 'border-primary/40 bg-primary/5'), children: [_jsx(Checkbox, { checked: checked, "aria-hidden": "true", tabIndex: -1, className: "pointer-events-none mt-0.5 shrink-0" }), icon && (_jsx(DynamicIcon, { name: icon, className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" })), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block break-words font-medium leading-snug text-foreground", children: label }), description && (_jsx("span", { className: "mt-0.5 block break-words text-xs leading-snug text-muted-foreground", children: description }))] })] }));
214
214
  }
215
215
  /** One clickable module row in the flat list (mirrors a sidebar item). */
216
216
  function ModuleRow({ module, active, granted, total, onSelect, }) {
@@ -481,7 +481,7 @@ export function PermissionsManager({ loadModules, loadRoles, loadRolePermissions
481
481
  0 && (_jsxs(Badge, { variant: "secondary", className: "ml-auto shrink-0 tabular-nums", children: [grantedCountForModule(draft, mod), "/", mod.actions.length] })), mod.key === activeModuleKey && (_jsx(Check, { className: "ml-2 h-4 w-4 shrink-0" }))] }, mod.key))) }, group.title || `__untitled_${gi}`)))] })] }) })] }) })] })] }), _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [activeModule && (_jsx(DynamicIcon, { name: activeModule.icon ||
482
482
  (activeModule.kind === 'screen' ? 'Eye' : 'Square'), className: "h-4 w-4 shrink-0 text-primary" })), _jsx("span", { className: "truncate", children: activeModule ? activeModule.label : 'Acciones permitidas' })] }), _jsx(CardDescription, { children: activeModule
483
483
  ? `${activeModuleGroupTitle || 'Sistema'} · configura las acciones permitidas`
484
- : 'Configura los permisos del módulo seleccionado.' })] }), activeRole && activeModule && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", className: "tabular-nums", children: [moduleGranted, "/", moduleTotal] }), _jsxs(Button, { variant: "outline", size: "sm", className: "h-8", disabled: checksDisabled || moduleGranted === moduleTotal, onClick: () => setModuleAll(true), children: [_jsx(CheckCheck, { className: "mr-1.5 h-3.5 w-3.5" }), " Marcar todo"] }), _jsxs(Button, { variant: "outline", size: "sm", className: "h-8", disabled: checksDisabled || moduleGranted === 0, onClick: () => setModuleAll(false), children: [_jsx(Eraser, { className: "mr-1.5 h-3.5 w-3.5" }), " Limpiar"] })] }))] }) }), _jsx(CardContent, { children: !activeRole ? (_jsx(EmptyHint, { text: "Selecciona un rol para configurar sus permisos." })) : loadingPerms ? (_jsx("div", { className: "grid gap-2 sm:grid-cols-2 xl:grid-cols-3", children: Array.from({ length: 6 }).map((_, i) => (_jsx(Skeleton, { className: "h-11 w-full" }, i))) })) : !activeModule ? (_jsx(EmptyHint, { text: "Selecciona un m\u00F3dulo de la lista para ver sus acciones." })) : (_jsx(ModuleActionsPanel, { module: activeModule, draft: draft, checksDisabled: checksDisabled, onToggle: toggleCapability })) })] })] }), _jsx(AlertDialog, { open: pendingRoleId !== null, onOpenChange: (open) => !open && setPendingRoleId(null), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Cambios sin guardar" }), _jsx(AlertDialogDescription, { children: "Tienes cambios sin guardar en este rol. Si cambias de rol se descartar\u00E1n." })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancelar" }), _jsx(AlertDialogAction, { onClick: () => {
484
+ : 'Configura los permisos del módulo seleccionado.' })] }), activeRole && activeModule && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", className: "tabular-nums", children: [moduleGranted, "/", moduleTotal] }), _jsxs(Button, { variant: "outline", size: "sm", className: "h-8", disabled: checksDisabled || moduleGranted === moduleTotal, onClick: () => setModuleAll(true), children: [_jsx(CheckCheck, { className: "mr-1.5 h-3.5 w-3.5" }), " Marcar todo"] }), _jsxs(Button, { variant: "outline", size: "sm", className: "h-8", disabled: checksDisabled || moduleGranted === 0, onClick: () => setModuleAll(false), children: [_jsx(Eraser, { className: "mr-1.5 h-3.5 w-3.5" }), " Limpiar"] })] }))] }) }), _jsx(CardContent, { children: !activeRole ? (_jsx(EmptyHint, { text: "Selecciona un rol para configurar sus permisos." })) : loadingPerms ? (_jsx("div", { className: "grid gap-2 sm:grid-cols-2", children: Array.from({ length: 6 }).map((_, i) => (_jsx(Skeleton, { className: "h-14 w-full" }, i))) })) : !activeModule ? (_jsx(EmptyHint, { text: "Selecciona un m\u00F3dulo de la lista para ver sus acciones." })) : (_jsx(ModuleActionsPanel, { module: activeModule, draft: draft, checksDisabled: checksDisabled, onToggle: toggleCapability })) })] })] }), _jsx(AlertDialog, { open: pendingRoleId !== null, onOpenChange: (open) => !open && setPendingRoleId(null), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Cambios sin guardar" }), _jsx(AlertDialogDescription, { children: "Tienes cambios sin guardar en este rol. Si cambias de rol se descartar\u00E1n." })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancelar" }), _jsx(AlertDialogAction, { onClick: () => {
485
485
  setActiveRoleId(pendingRoleId);
486
486
  setPendingRoleId(null);
487
487
  }, children: "Descartar y cambiar" })] })] }) }), _jsx(Dialog, { open: roleDialog.open, onOpenChange: (open) => setRoleDialog((d) => ({ ...d, open })), children: _jsxs(DialogContent, { className: "sm:max-w-md", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: roleDialog.mode === 'create' ? 'Nuevo rol' : 'Editar rol' }) }), _jsxs("div", { className: "flex flex-col gap-4 py-2", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { htmlFor: "pm-role-name", children: "Nombre del rol" }), _jsx(Input, { id: "pm-role-name", value: roleDialog.label, placeholder: "Ej. Cajero", onChange: (e) => setRoleDialog((d) => ({ ...d, label: e.target.value })) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: "Color" }), _jsx("div", { className: "flex flex-wrap gap-2", children: ROLE_COLORS.map((c) => (_jsx("button", { type: "button", "aria-label": `Color ${c}`, onClick: () => setRoleDialog((d) => ({ ...d, color: c })), className: cn('h-7 w-7 rounded-full border-2 transition-transform', roleDialog.color === c
@@ -496,9 +496,9 @@ export function PermissionsManager({ loadModules, loadRoles, loadRolePermissions
496
496
  }, children: deleting ? 'Eliminando…' : 'Eliminar' })] })] }) })] }));
497
497
  }
498
498
  function ActionCheckGrid({ moduleKey, actions, draft, checksDisabled, onToggle, }) {
499
- return (_jsx("div", { className: "grid gap-2 sm:grid-cols-2 xl:grid-cols-3", children: actions.map((action) => {
499
+ return (_jsx("div", { className: "grid gap-2 sm:grid-cols-2", children: actions.map((action) => {
500
500
  const cap = moduleActionCapability(moduleKey, action.key, action.capability);
501
- return (_jsx(CapabilityCheck, { checked: draft?.has(cap) ?? false, disabled: checksDisabled, onToggle: () => onToggle(cap), icon: action.icon || defaultActionIcon(action.key, action.kind), label: action.label }, action.capability ?? action.key));
501
+ return (_jsx(CapabilityCheck, { checked: draft?.has(cap) ?? false, disabled: checksDisabled, onToggle: () => onToggle(cap), icon: action.icon || defaultActionIcon(action.key, action.kind), label: action.label, description: action.description }, action.capability ?? action.key));
502
502
  }) }));
503
503
  }
504
504
  /** Flat grid, or collapsible sections when actions declare `group`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-runtime-react",
3
- "version": "30.0.2",
3
+ "version": "30.0.3",
4
4
  "description": "React runtime for metacore hosts — renders addon contributions dynamically",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,8 +37,8 @@
37
37
  "react-i18next": ">=13",
38
38
  "sonner": ">=1.7",
39
39
  "zustand": ">=5",
40
- "@asteby/metacore-sdk": "^3.4.0",
41
- "@asteby/metacore-ui": "^2.14.0"
40
+ "@asteby/metacore-ui": "^2.14.1",
41
+ "@asteby/metacore-sdk": "^3.4.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.4.0",
71
- "@asteby/metacore-ui": "2.14.0"
71
+ "@asteby/metacore-ui": "2.14.1"
72
72
  },
73
73
  "scripts": {
74
74
  "build": "tsc -p tsconfig.json",
@@ -89,6 +89,11 @@ export interface PermissionActionDef {
89
89
  key: string
90
90
  /** Localized label ("Listar", "Pagar", "Acceder"). */
91
91
  label: string
92
+ /**
93
+ * Optional secondary line under the label (e.g. action name when the label
94
+ * is the module — used by screen → API shortcut checkboxes).
95
+ */
96
+ description?: string
92
97
  /** Lucide icon name from the manifest action (optional). */
93
98
  icon?: string
94
99
  /**
@@ -446,10 +451,14 @@ function CapabilityCheck({
446
451
  {icon && (
447
452
  <DynamicIcon name={icon} className="mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" />
448
453
  )}
449
- <span className="min-w-0">
450
- <span className="block truncate font-medium text-foreground">{label}</span>
454
+ <span className="min-w-0 flex-1">
455
+ <span className="block break-words font-medium leading-snug text-foreground">
456
+ {label}
457
+ </span>
451
458
  {description && (
452
- <span className="mt-0.5 block text-xs text-muted-foreground">{description}</span>
459
+ <span className="mt-0.5 block break-words text-xs leading-snug text-muted-foreground">
460
+ {description}
461
+ </span>
453
462
  )}
454
463
  </span>
455
464
  </div>
@@ -1107,9 +1116,9 @@ export function PermissionsManager({
1107
1116
  {!activeRole ? (
1108
1117
  <EmptyHint text="Selecciona un rol para configurar sus permisos." />
1109
1118
  ) : loadingPerms ? (
1110
- <div className="grid gap-2 sm:grid-cols-2 xl:grid-cols-3">
1119
+ <div className="grid gap-2 sm:grid-cols-2">
1111
1120
  {Array.from({ length: 6 }).map((_, i) => (
1112
- <Skeleton key={i} className="h-11 w-full" />
1121
+ <Skeleton key={i} className="h-14 w-full" />
1113
1122
  ))}
1114
1123
  </div>
1115
1124
  ) : !activeModule ? (
@@ -1265,7 +1274,7 @@ function ActionCheckGrid({
1265
1274
  onToggle: (cap: string) => void
1266
1275
  }) {
1267
1276
  return (
1268
- <div className="grid gap-2 sm:grid-cols-2 xl:grid-cols-3">
1277
+ <div className="grid gap-2 sm:grid-cols-2">
1269
1278
  {actions.map((action) => {
1270
1279
  const cap = moduleActionCapability(moduleKey, action.key, action.capability)
1271
1280
  return (
@@ -1276,6 +1285,7 @@ function ActionCheckGrid({
1276
1285
  onToggle={() => onToggle(cap)}
1277
1286
  icon={action.icon || defaultActionIcon(action.key, action.kind)}
1278
1287
  label={action.label}
1288
+ description={action.description}
1279
1289
  />
1280
1290
  )
1281
1291
  })}