Reviste Clientes y le da una cámara a la foto del cliente
Las tres vistas y el buscador de Clientes pasan a ser herencias en modo primary atadas a la acción. Siguen siendo xpath sobre lo nativo, no vistas escritas de cero, pero el compromiso de no mostrar el correo aguanta por construcción y no por propagación de contexto: al registro se llega también desde una miga, un enlace o el POS, y ahí un invisible por contexto habría dejado el correo a la vista. Contactos nativo conserva su correo y su RFC, con test que lo fija. De la ficha sale el cuaderno de pestañas entero. Traía un segundo correo, un segundo bloque de dirección y una copia de las notas, y además ofrecía una pestaña de Facturación en un sistema que no factura (BRIEF §5.7). La caja de botones estadísticos se sustituye completa: media docena de módulos del core cuelgan los suyos ahí, y quitarlos uno por uno ataría la vista a qué módulos estén instalados. Quedan los dos del diseño. El widget de foto hereda del ImageField nativo, así que subir, limpiar y guardar siguen siendo los del core; lo que agrega es el menú del diseño y un diálogo de captura con la cámara TRASERA por defecto, que es el caso de uso —el mostrador retrata al cliente, no se hace una selfie—. El stream se libera al cerrar, al salir con Escape, al navegar dentro del cliente y al dejar la página; también si el diálogo se cierra antes de que la cámara termine de encender. Sin contexto seguro el navegador ni siquiera define navigator.mediaDevices, así que en las tablets no habrá diálogo de cámara hasta que producción tenga TLS. El widget no ofrece un botón que reventaría: oculta «Tomar fotografía» y deja «Subir archivo» con capture=environment, que abre la cámara nativa de Android sin exigir https. Queda anotado en despliegue.md. Las iniciales sobre durazno son un widget propio y no avatar_128: el mixin del core dibuja UNA letra sobre un color derivado del id, dentro de un SVG en base64 servido como imagen, así que ninguna hoja de estilo puede volverlo el durazno del diseño ni darle las dos letras. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
efa42e511a
commit
a9cd2ee3a9
14 files changed
+1305
-2
No files matched your search
@@ -0,0 +1,143 @@
|
||||
// =============================================================================
|
||||
// Panel General · widgets propios (ADR-013)
|
||||
//
|
||||
// The widgets themselves live in beyond_base, because Mis preferencias and the
|
||||
// customer form both use the camera one. Their LOOK lives here, with the rest
|
||||
// of the panel's tokens, for the same reason the navbar's does: beyond_base
|
||||
// cannot import variables from a module that depends on it.
|
||||
//
|
||||
// Today both widgets are only ever rendered inside the panel, so scoping them
|
||||
// under body.beyond_panel costs nothing. If one of them is ever reused outside
|
||||
// — the POS in Fase 2 is the obvious candidate — its styling moves out with
|
||||
// it, and that is a good moment to reconsider whether the peach graduates to a
|
||||
// token.
|
||||
// =============================================================================
|
||||
|
||||
body.beyond_panel {
|
||||
|
||||
// ── Foto con cámara ───────────────────────────────────────────────────
|
||||
.beyond_foto {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
aspect-ratio: 4 / 5; // el retrato del diseño, no un cuadrado
|
||||
border-radius: 26px;
|
||||
overflow: hidden;
|
||||
background: $beyond-panel-durazno;
|
||||
cursor: pointer;
|
||||
|
||||
.beyond_foto_img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.beyond_foto_velo {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(35, 32, 29, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
.beyond_foto_menu {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 30;
|
||||
min-width: 208px;
|
||||
margin-top: 8px;
|
||||
padding: 6px;
|
||||
background: #FFFFFF;
|
||||
border: 1px solid $beyond-surface-active;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 16px 36px rgba(35, 32, 29, 0.16);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.beyond_foto_opcion {
|
||||
all: unset;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
padding: 10px 12px;
|
||||
border-radius: 11px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: $beyond-ink;
|
||||
transition: background 140ms ease;
|
||||
|
||||
svg { color: $beyond-ink-softer; flex: none; }
|
||||
&:hover, &:focus-visible { background: $beyond-surface; }
|
||||
|
||||
&.beyond_foto_borrar {
|
||||
color: $beyond-panel-rojo;
|
||||
svg { color: $beyond-panel-rojo; }
|
||||
&:hover, &:focus-visible { background: $beyond-panel-rojo-suave; }
|
||||
}
|
||||
}
|
||||
|
||||
// ── Foto o iniciales ──────────────────────────────────────────────────
|
||||
// The size comes from wherever it is used (kanban card, list row), so
|
||||
// that one widget serves the 92px card and the 38px row.
|
||||
.beyond_avatar_img,
|
||||
.beyond_avatar_iniciales {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: inherit;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.beyond_avatar_img { object-fit: cover; }
|
||||
|
||||
.beyond_avatar_iniciales {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: $beyond-panel-durazno;
|
||||
color: $beyond-panel-acento-pressed;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.01em;
|
||||
// Scales with the box it is given: 92px card → 28px letters,
|
||||
// 38px row → 13px, which is what the design draws.
|
||||
font-size: 0.32em;
|
||||
}
|
||||
}
|
||||
|
||||
// El diálogo de la cámara se portaliza a <body>, fuera del alcance de la
|
||||
// clase del panel, así que se apunta por su propia clase.
|
||||
.beyond_camara_dialogo {
|
||||
.beyond_camara {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.beyond_camara_video {
|
||||
width: 100%;
|
||||
max-height: 60vh;
|
||||
border-radius: 18px;
|
||||
background: #23201D;
|
||||
// La vista previa se refleja como un espejo solo con la cámara
|
||||
// frontal; con la trasera, que es la de este flujo, se ve tal cual.
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.beyond_camara_espera,
|
||||
.beyond_camara_error {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #7A736A;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user