@acvl/mobile-components 0.0.0-stage → 0.0.2
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/README.md +147 -2
- package/assets/fonts/Inter_400Regular.ttf +0 -0
- package/assets/fonts/Inter_500Medium.ttf +0 -0
- package/assets/fonts/Inter_600SemiBold.ttf +0 -0
- package/assets/fonts/Inter_700Bold.ttf +0 -0
- package/assets/fonts/Inter_800ExtraBold.ttf +0 -0
- package/assets/fonts/Inter_900Black.ttf +0 -0
- package/assets/fonts/OFL.txt +93 -0
- package/lib/module/camara/CampoDeFotos.js +124 -0
- package/lib/module/camara/CampoDeFotos.js.map +1 -0
- package/lib/module/camara/elegir.js +104 -0
- package/lib/module/camara/elegir.js.map +1 -0
- package/lib/module/camara/index.js +10 -0
- package/lib/module/camara/index.js.map +1 -0
- package/lib/module/camara/reducir.js +93 -0
- package/lib/module/camara/reducir.js.map +1 -0
- package/lib/module/componentes/AccionesDelEncabezado.js +212 -0
- package/lib/module/componentes/AccionesDelEncabezado.js.map +1 -0
- package/lib/module/componentes/BotonDeAvatar.js +55 -0
- package/lib/module/componentes/BotonDeAvatar.js.map +1 -0
- package/lib/module/componentes/BotonGrande.js +105 -0
- package/lib/module/componentes/BotonGrande.js.map +1 -0
- package/lib/module/componentes/CabeceraEmpujada.js +101 -0
- package/lib/module/componentes/CabeceraEmpujada.js.map +1 -0
- package/lib/module/componentes/Chip.js +77 -0
- package/lib/module/componentes/Chip.js.map +1 -0
- package/lib/module/componentes/ContenidoDePantalla.js +56 -0
- package/lib/module/componentes/ContenidoDePantalla.js.map +1 -0
- package/lib/module/componentes/EstadoVacio.js +65 -0
- package/lib/module/componentes/EstadoVacio.js.map +1 -0
- package/lib/module/componentes/Foto.js +106 -0
- package/lib/module/componentes/Foto.js.map +1 -0
- package/lib/module/componentes/IconoDeRenglon.js +44 -0
- package/lib/module/componentes/IconoDeRenglon.js.map +1 -0
- package/lib/module/componentes/Logo.js +44 -0
- package/lib/module/componentes/Logo.js.map +1 -0
- package/lib/module/componentes/Nota.js +51 -0
- package/lib/module/componentes/Nota.js.map +1 -0
- package/lib/module/componentes/OpcionesExcluyentes.js +69 -0
- package/lib/module/componentes/OpcionesExcluyentes.js.map +1 -0
- package/lib/module/componentes/PantallaDeError.js +84 -0
- package/lib/module/componentes/PantallaDeError.js.map +1 -0
- package/lib/module/componentes/Pestanas.js +87 -0
- package/lib/module/componentes/Pestanas.js.map +1 -0
- package/lib/module/componentes/Rotulo.js +28 -0
- package/lib/module/componentes/Rotulo.js.map +1 -0
- package/lib/module/componentes/RotuloDeSeccion.js +87 -0
- package/lib/module/componentes/RotuloDeSeccion.js.map +1 -0
- package/lib/module/componentes/Tarjeta.js +63 -0
- package/lib/module/componentes/Tarjeta.js.map +1 -0
- package/lib/module/componentes/TarjetaDeDatos.js +79 -0
- package/lib/module/componentes/TarjetaDeDatos.js.map +1 -0
- package/lib/module/componentes/TiraDeFotos.js +184 -0
- package/lib/module/componentes/TiraDeFotos.js.map +1 -0
- package/lib/module/componentes/VisorDeFoto.js +171 -0
- package/lib/module/componentes/VisorDeFoto.js.map +1 -0
- package/lib/module/componentes/logos/bola-blanca.png +0 -0
- package/lib/module/componentes/logos/bola.png +0 -0
- package/lib/module/componentes/logos/logo-blanco.png +0 -0
- package/lib/module/componentes/logos/logo.png +0 -0
- package/lib/module/dialogos/HostDeDialogos.js +170 -0
- package/lib/module/dialogos/HostDeDialogos.js.map +1 -0
- package/lib/module/dialogos/dialogos.js +112 -0
- package/lib/module/dialogos/dialogos.js.map +1 -0
- package/lib/module/formularios/CampoDeSeleccion.js +72 -0
- package/lib/module/formularios/CampoDeSeleccion.js.map +1 -0
- package/lib/module/formularios/SelectorDeOpcion.js +406 -0
- package/lib/module/formularios/SelectorDeOpcion.js.map +1 -0
- package/lib/module/formularios/TextoDeAccesoControlado.js +73 -0
- package/lib/module/formularios/TextoDeAccesoControlado.js.map +1 -0
- package/lib/module/formularios/campos.js +501 -0
- package/lib/module/formularios/campos.js.map +1 -0
- package/lib/module/formularios/controlados.js +199 -0
- package/lib/module/formularios/controlados.js.map +1 -0
- package/lib/module/formularios/errores.js +91 -0
- package/lib/module/formularios/errores.js.map +1 -0
- package/lib/module/formularios/guardado.js +78 -0
- package/lib/module/formularios/guardado.js.map +1 -0
- package/lib/module/formularios/useBusqueda.js +22 -0
- package/lib/module/formularios/useBusqueda.js.map +1 -0
- package/lib/module/fotos/elegir.js +105 -0
- package/lib/module/fotos/elegir.js.map +1 -0
- package/lib/module/fotos/index.js +9 -0
- package/lib/module/fotos/index.js.map +1 -0
- package/lib/module/hoja/HojaDeLista.js +211 -0
- package/lib/module/hoja/HojaDeLista.js.map +1 -0
- package/lib/module/hoja/HojaInferior.js +112 -0
- package/lib/module/hoja/HojaInferior.js.map +1 -0
- package/lib/module/hoja/index.js +8 -0
- package/lib/module/hoja/index.js.map +1 -0
- package/lib/module/hoja/useMasDeLaFicha.js +48 -0
- package/lib/module/hoja/useMasDeLaFicha.js.map +1 -0
- package/lib/module/index.js +67 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/listas/HojaDeFiltros.js +270 -0
- package/lib/module/listas/HojaDeFiltros.js.map +1 -0
- package/lib/module/listas/ListaPaginada.js +103 -0
- package/lib/module/listas/ListaPaginada.js.map +1 -0
- package/lib/module/listas/TarjetaDeslizable.js +118 -0
- package/lib/module/listas/TarjetaDeslizable.js.map +1 -0
- package/lib/module/listas/paginado.js +11 -0
- package/lib/module/listas/paginado.js.map +1 -0
- package/lib/module/listas/piezas.js +666 -0
- package/lib/module/listas/piezas.js.map +1 -0
- package/lib/module/navegacion/BarraDePestanas.js +162 -0
- package/lib/module/navegacion/BarraDePestanas.js.map +1 -0
- package/lib/module/navegacion/BotonDeBarra.js +58 -0
- package/lib/module/navegacion/BotonDeBarra.js.map +1 -0
- package/lib/module/navegacion/encabezado.js +103 -0
- package/lib/module/navegacion/encabezado.js.map +1 -0
- package/lib/module/pantallas/PantallaDeAcceso.js +195 -0
- package/lib/module/pantallas/PantallaDeAcceso.js.map +1 -0
- package/lib/module/pantallas/PantallaDeEdicion.js +121 -0
- package/lib/module/pantallas/PantallaDeEdicion.js.map +1 -0
- package/lib/module/pantallas/PantallaDeFicha.js +94 -0
- package/lib/module/pantallas/PantallaDeFicha.js.map +1 -0
- package/lib/module/pantallas/PantallaDeHistorial.js +328 -0
- package/lib/module/pantallas/PantallaDeHistorial.js.map +1 -0
- package/lib/module/pantallas/PantallaDePerfil.js +137 -0
- package/lib/module/pantallas/PantallaDePerfil.js.map +1 -0
- package/lib/module/tema/ProveedorDeTema.js +122 -0
- package/lib/module/tema/ProveedorDeTema.js.map +1 -0
- package/lib/module/tema/estilos.js +54 -0
- package/lib/module/tema/estilos.js.map +1 -0
- package/lib/module/tema/fuentes.js +28 -0
- package/lib/module/tema/fuentes.js.map +1 -0
- package/lib/module/tema/index.js +8 -0
- package/lib/module/tema/index.js.map +1 -0
- package/lib/module/tema/paleta.js +107 -0
- package/lib/module/tema/paleta.js.map +1 -0
- package/lib/module/tema/tipografia.js +32 -0
- package/lib/module/tema/tipografia.js.map +1 -0
- package/lib/module/texto.js +48 -0
- package/lib/module/texto.js.map +1 -0
- package/lib/typescript/src/camara/CampoDeFotos.d.ts +30 -0
- package/lib/typescript/src/camara/CampoDeFotos.d.ts.map +1 -0
- package/lib/typescript/src/camara/elegir.d.ts +47 -0
- package/lib/typescript/src/camara/elegir.d.ts.map +1 -0
- package/lib/typescript/src/camara/index.d.ts +4 -0
- package/lib/typescript/src/camara/index.d.ts.map +1 -0
- package/lib/typescript/src/camara/reducir.d.ts +32 -0
- package/lib/typescript/src/camara/reducir.d.ts.map +1 -0
- package/lib/typescript/src/componentes/AccionesDelEncabezado.d.ts +34 -0
- package/lib/typescript/src/componentes/AccionesDelEncabezado.d.ts.map +1 -0
- package/lib/typescript/src/componentes/BotonDeAvatar.d.ts +17 -0
- package/lib/typescript/src/componentes/BotonDeAvatar.d.ts.map +1 -0
- package/lib/typescript/src/componentes/BotonGrande.d.ts +26 -0
- package/lib/typescript/src/componentes/BotonGrande.d.ts.map +1 -0
- package/lib/typescript/src/componentes/CabeceraEmpujada.d.ts +18 -0
- package/lib/typescript/src/componentes/CabeceraEmpujada.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Chip.d.ts +14 -0
- package/lib/typescript/src/componentes/Chip.d.ts.map +1 -0
- package/lib/typescript/src/componentes/ContenidoDePantalla.d.ts +17 -0
- package/lib/typescript/src/componentes/ContenidoDePantalla.d.ts.map +1 -0
- package/lib/typescript/src/componentes/EstadoVacio.d.ts +17 -0
- package/lib/typescript/src/componentes/EstadoVacio.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Foto.d.ts +41 -0
- package/lib/typescript/src/componentes/Foto.d.ts.map +1 -0
- package/lib/typescript/src/componentes/IconoDeRenglon.d.ts +25 -0
- package/lib/typescript/src/componentes/IconoDeRenglon.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Logo.d.ts +13 -0
- package/lib/typescript/src/componentes/Logo.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Nota.d.ts +7 -0
- package/lib/typescript/src/componentes/Nota.d.ts.map +1 -0
- package/lib/typescript/src/componentes/OpcionesExcluyentes.d.ts +14 -0
- package/lib/typescript/src/componentes/OpcionesExcluyentes.d.ts.map +1 -0
- package/lib/typescript/src/componentes/PantallaDeError.d.ts +23 -0
- package/lib/typescript/src/componentes/PantallaDeError.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Pestanas.d.ts +28 -0
- package/lib/typescript/src/componentes/Pestanas.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Rotulo.d.ts +6 -0
- package/lib/typescript/src/componentes/Rotulo.d.ts.map +1 -0
- package/lib/typescript/src/componentes/RotuloDeSeccion.d.ts +20 -0
- package/lib/typescript/src/componentes/RotuloDeSeccion.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Tarjeta.d.ts +25 -0
- package/lib/typescript/src/componentes/Tarjeta.d.ts.map +1 -0
- package/lib/typescript/src/componentes/TarjetaDeDatos.d.ts +13 -0
- package/lib/typescript/src/componentes/TarjetaDeDatos.d.ts.map +1 -0
- package/lib/typescript/src/componentes/TiraDeFotos.d.ts +36 -0
- package/lib/typescript/src/componentes/TiraDeFotos.d.ts.map +1 -0
- package/lib/typescript/src/componentes/VisorDeFoto.d.ts +23 -0
- package/lib/typescript/src/componentes/VisorDeFoto.d.ts.map +1 -0
- package/lib/typescript/src/dialogos/HostDeDialogos.d.ts +14 -0
- package/lib/typescript/src/dialogos/HostDeDialogos.d.ts.map +1 -0
- package/lib/typescript/src/dialogos/dialogos.d.ts +65 -0
- package/lib/typescript/src/dialogos/dialogos.d.ts.map +1 -0
- package/lib/typescript/src/formularios/CampoDeSeleccion.d.ts +24 -0
- package/lib/typescript/src/formularios/CampoDeSeleccion.d.ts.map +1 -0
- package/lib/typescript/src/formularios/SelectorDeOpcion.d.ts +59 -0
- package/lib/typescript/src/formularios/SelectorDeOpcion.d.ts.map +1 -0
- package/lib/typescript/src/formularios/TextoDeAccesoControlado.d.ts +18 -0
- package/lib/typescript/src/formularios/TextoDeAccesoControlado.d.ts.map +1 -0
- package/lib/typescript/src/formularios/campos.d.ts +113 -0
- package/lib/typescript/src/formularios/campos.d.ts.map +1 -0
- package/lib/typescript/src/formularios/controlados.d.ts +29 -0
- package/lib/typescript/src/formularios/controlados.d.ts.map +1 -0
- package/lib/typescript/src/formularios/errores.d.ts +36 -0
- package/lib/typescript/src/formularios/errores.d.ts.map +1 -0
- package/lib/typescript/src/formularios/guardado.d.ts +36 -0
- package/lib/typescript/src/formularios/guardado.d.ts.map +1 -0
- package/lib/typescript/src/formularios/useBusqueda.d.ts +7 -0
- package/lib/typescript/src/formularios/useBusqueda.d.ts.map +1 -0
- package/lib/typescript/src/fotos/elegir.d.ts +28 -0
- package/lib/typescript/src/fotos/elegir.d.ts.map +1 -0
- package/lib/typescript/src/fotos/index.d.ts +3 -0
- package/lib/typescript/src/fotos/index.d.ts.map +1 -0
- package/lib/typescript/src/hoja/HojaDeLista.d.ts +50 -0
- package/lib/typescript/src/hoja/HojaDeLista.d.ts.map +1 -0
- package/lib/typescript/src/hoja/HojaInferior.d.ts +21 -0
- package/lib/typescript/src/hoja/HojaInferior.d.ts.map +1 -0
- package/lib/typescript/src/hoja/index.d.ts +4 -0
- package/lib/typescript/src/hoja/index.d.ts.map +1 -0
- package/lib/typescript/src/hoja/useMasDeLaFicha.d.ts +27 -0
- package/lib/typescript/src/hoja/useMasDeLaFicha.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +46 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/listas/HojaDeFiltros.d.ts +76 -0
- package/lib/typescript/src/listas/HojaDeFiltros.d.ts.map +1 -0
- package/lib/typescript/src/listas/ListaPaginada.d.ts +39 -0
- package/lib/typescript/src/listas/ListaPaginada.d.ts.map +1 -0
- package/lib/typescript/src/listas/TarjetaDeslizable.d.ts +33 -0
- package/lib/typescript/src/listas/TarjetaDeslizable.d.ts.map +1 -0
- package/lib/typescript/src/listas/paginado.d.ts +16 -0
- package/lib/typescript/src/listas/paginado.d.ts.map +1 -0
- package/lib/typescript/src/listas/piezas.d.ts +157 -0
- package/lib/typescript/src/listas/piezas.d.ts.map +1 -0
- package/lib/typescript/src/navegacion/BarraDePestanas.d.ts +57 -0
- package/lib/typescript/src/navegacion/BarraDePestanas.d.ts.map +1 -0
- package/lib/typescript/src/navegacion/BotonDeBarra.d.ts +15 -0
- package/lib/typescript/src/navegacion/BotonDeBarra.d.ts.map +1 -0
- package/lib/typescript/src/navegacion/encabezado.d.ts +44 -0
- package/lib/typescript/src/navegacion/encabezado.d.ts.map +1 -0
- package/lib/typescript/src/pantallas/PantallaDeAcceso.d.ts +32 -0
- package/lib/typescript/src/pantallas/PantallaDeAcceso.d.ts.map +1 -0
- package/lib/typescript/src/pantallas/PantallaDeEdicion.d.ts +38 -0
- package/lib/typescript/src/pantallas/PantallaDeEdicion.d.ts.map +1 -0
- package/lib/typescript/src/pantallas/PantallaDeFicha.d.ts +35 -0
- package/lib/typescript/src/pantallas/PantallaDeFicha.d.ts.map +1 -0
- package/lib/typescript/src/pantallas/PantallaDeHistorial.d.ts +65 -0
- package/lib/typescript/src/pantallas/PantallaDeHistorial.d.ts.map +1 -0
- package/lib/typescript/src/pantallas/PantallaDePerfil.d.ts +19 -0
- package/lib/typescript/src/pantallas/PantallaDePerfil.d.ts.map +1 -0
- package/lib/typescript/src/tema/ProveedorDeTema.d.ts +32 -0
- package/lib/typescript/src/tema/ProveedorDeTema.d.ts.map +1 -0
- package/lib/typescript/src/tema/estilos.d.ts +31 -0
- package/lib/typescript/src/tema/estilos.d.ts.map +1 -0
- package/lib/typescript/src/tema/fuentes.d.ts +20 -0
- package/lib/typescript/src/tema/fuentes.d.ts.map +1 -0
- package/lib/typescript/src/tema/index.d.ts +6 -0
- package/lib/typescript/src/tema/index.d.ts.map +1 -0
- package/lib/typescript/src/tema/paleta.d.ts +86 -0
- package/lib/typescript/src/tema/paleta.d.ts.map +1 -0
- package/lib/typescript/src/tema/tipografia.d.ts +29 -0
- package/lib/typescript/src/tema/tipografia.d.ts.map +1 -0
- package/lib/typescript/src/texto.d.ts +16 -0
- package/lib/typescript/src/texto.d.ts.map +1 -0
- package/package.json +140 -5
- package/src/camara/CampoDeFotos.tsx +132 -0
- package/src/camara/elegir.ts +113 -0
- package/src/camara/index.ts +15 -0
- package/src/camara/reducir.ts +87 -0
- package/src/componentes/AccionesDelEncabezado.tsx +247 -0
- package/src/componentes/BotonDeAvatar.tsx +59 -0
- package/src/componentes/BotonGrande.tsx +100 -0
- package/src/componentes/CabeceraEmpujada.tsx +69 -0
- package/src/componentes/Chip.tsx +60 -0
- package/src/componentes/ContenidoDePantalla.tsx +53 -0
- package/src/componentes/EstadoVacio.tsx +45 -0
- package/src/componentes/Foto.tsx +92 -0
- package/src/componentes/IconoDeRenglon.tsx +42 -0
- package/src/componentes/Logo.tsx +34 -0
- package/src/componentes/Nota.tsx +37 -0
- package/src/componentes/OpcionesExcluyentes.tsx +62 -0
- package/src/componentes/PantallaDeError.tsx +76 -0
- package/src/componentes/Pestanas.tsx +86 -0
- package/src/componentes/Rotulo.tsx +21 -0
- package/src/componentes/RotuloDeSeccion.tsx +71 -0
- package/src/componentes/Tarjeta.tsx +58 -0
- package/src/componentes/TarjetaDeDatos.tsx +62 -0
- package/src/componentes/TiraDeFotos.tsx +189 -0
- package/src/componentes/VisorDeFoto.tsx +181 -0
- package/src/componentes/logos/bola-blanca.png +0 -0
- package/src/componentes/logos/bola.png +0 -0
- package/src/componentes/logos/logo-blanco.png +0 -0
- package/src/componentes/logos/logo.png +0 -0
- package/src/dialogos/HostDeDialogos.tsx +172 -0
- package/src/dialogos/dialogos.ts +148 -0
- package/src/formularios/CampoDeSeleccion.tsx +60 -0
- package/src/formularios/SelectorDeOpcion.tsx +407 -0
- package/src/formularios/TextoDeAccesoControlado.tsx +72 -0
- package/src/formularios/campos.tsx +497 -0
- package/src/formularios/controlados.tsx +200 -0
- package/src/formularios/errores.ts +105 -0
- package/src/formularios/guardado.ts +76 -0
- package/src/formularios/useBusqueda.ts +19 -0
- package/src/fotos/elegir.ts +116 -0
- package/src/fotos/index.ts +6 -0
- package/src/hoja/HojaDeLista.tsx +214 -0
- package/src/hoja/HojaInferior.tsx +103 -0
- package/src/hoja/index.ts +5 -0
- package/src/hoja/useMasDeLaFicha.tsx +63 -0
- package/src/index.ts +151 -0
- package/src/listas/HojaDeFiltros.tsx +286 -0
- package/src/listas/ListaPaginada.tsx +117 -0
- package/src/listas/TarjetaDeslizable.tsx +126 -0
- package/src/listas/paginado.ts +15 -0
- package/src/listas/piezas.tsx +670 -0
- package/src/navegacion/BarraDePestanas.tsx +198 -0
- package/src/navegacion/BotonDeBarra.tsx +61 -0
- package/src/navegacion/encabezado.tsx +88 -0
- package/src/pantallas/PantallaDeAcceso.tsx +184 -0
- package/src/pantallas/PantallaDeEdicion.tsx +116 -0
- package/src/pantallas/PantallaDeFicha.tsx +115 -0
- package/src/pantallas/PantallaDeHistorial.tsx +293 -0
- package/src/pantallas/PantallaDePerfil.tsx +126 -0
- package/src/tema/ProveedorDeTema.tsx +150 -0
- package/src/tema/estilos.ts +51 -0
- package/src/tema/fuentes.ts +20 -0
- package/src/tema/index.ts +10 -0
- package/src/tema/paleta.ts +147 -0
- package/src/tema/tipografia.ts +29 -0
- package/src/texto.tsx +44 -0
package/README.md
CHANGED
|
@@ -1,3 +1,148 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @acvl/mobile-components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
La librería de componentes de las apps móviles de ACV (Expo / React Native): tms, wms y suma. Es el
|
|
4
|
+
equivalente de [`@acvl/frontend-components`](https://github.com/ACV-Logistics/acv-frontend-components)
|
|
5
|
+
para las apps: lo que se ve igual en todas vive aquí, y cada app pone sólo lo suyo (su API, su
|
|
6
|
+
dominio).
|
|
7
|
+
|
|
8
|
+
El punto de partida es la app de tms, la más reciente. Su diseño es para quien usa la app de pie y
|
|
9
|
+
con prisa: **letra grande** (nada por debajo de `tipografia.etiqueta`), nada importante recortado a
|
|
10
|
+
un renglón, y todo listo para la letra del teléfono al 180%.
|
|
11
|
+
|
|
12
|
+
## Qué trae
|
|
13
|
+
|
|
14
|
+
| Área | Qué |
|
|
15
|
+
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| **Tema** | `ProveedorDeTema`, `usePreferenciaDeTema`, `PALETA_CLARA`/`PALETA_OSCURA`, `usePaleta`, `crearEstilos`, `useEsOscuro`, `tipografia`, `renglon`, `Text`, `TextInput` |
|
|
17
|
+
| **Componentes** | `BotonGrande`, `Chip` (con su tono `morado`), `EstadoVacio`, `IconoDeRenglon`, `Nota`, `OpcionesExcluyentes`, `Pestanas`, `Rotulo`, `RotuloDeSeccion` (con su `accion`), `Tarjeta`, `TarjetaDeDatos`, `Logo`, `LogoCompleto`, `ContenidoDePantalla` |
|
|
18
|
+
| **Navegación** | `useOpcionesDelEncabezado` (el header de las pestañas), `BarraDePestanas`, `CabeceraEmpujada`, `AccionesDelEncabezado` (con `insignia`), `BotonDeAvatar` |
|
|
19
|
+
| **Diálogos** | `mostrarDialogo`, `confirmar`, `avisar` y su `HostDeDialogos` |
|
|
20
|
+
| **Formularios** | `CampoDeTexto`, `CampoDeFecha`, `CampoDeFechaHora`, `CampoInterruptor`, `CampoDeOpciones`, `CampoDeTelefono`, `CampoDeSeleccion` (del servidor o de una lista fija), `CampoDeVarias`, `SelectorDeOpcion`, `SelectorDeVarias`, `Campo` (el marco de un campo propio), sus `…Controlado` de react-hook-form, `TextoDeAccesoControlado` (el login), `useGuardado`, `soloLoQueCambio`, `mensajeDeError`, `setErrors`, `useBusqueda` |
|
|
21
|
+
| **Listas y fichas** | `ListaPaginada` (con `Pagina` y `renglonesDe`), `CabeceraDeLista`, `Buscador`, `TarjetaDeLista`, `TarjetaDeslizable`, `HojaDeFiltros` y sus opciones (`OrdenDeLista` nombra los sentidos de cada campo), `SeccionDeFicha`, `RenglonDeLiga`, `FilaConContador`, `RenglonDeContacto`, `RenglonDeDireccion` (abre el mapa del teléfono), `RenglonDeHoja`, `EstadoDeHoja` |
|
|
22
|
+
| **Fotos** | `Foto`, `ProveedorDeFotos`, `TiraDeFotos`, `VisorDeFoto` |
|
|
23
|
+
| **Pantallas** | `PantallaDeAcceso` (el login), `PantallaDeFicha`, `PantallaDeHistorial` (la bitácora de un registro, con `TarjetaDeEvento`), `EsperaDeEdicion`/`FormularioDeEdicion`, `PantallaDePerfil`, `PantallaDeError` |
|
|
24
|
+
|
|
25
|
+
Y tres entradas aparte, para no obligar a cada app a instalar lo que no usa:
|
|
26
|
+
|
|
27
|
+
| Entrada | Qué | Pide |
|
|
28
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `@acvl/mobile-components/camara` | `tomarFoto` (con `alTomar` para guardar la original), `elegirDeGaleria`, `pedirPermisoDeCamara`, `reducirFoto`, y `CampoDeFotos` / `FotosControladas`, las fotos de un formulario | `expo-image-picker`, `expo-image-manipulator` |
|
|
30
|
+
| `@acvl/mobile-components/fotos` | Todo lo de `camara`, más `elegirDocumentos` y `elegirAdjunto` (cámara, galería o un documento) | `expo-image-picker`, `expo-image-manipulator`, `expo-document-picker`, `expo-file-system` |
|
|
31
|
+
| `@acvl/mobile-components/hoja` | `HojaInferior`, `useMasDeLaFicha` (la sección «Más» de una ficha: renglones con contador que abren su hoja), `HojaDeLista` (una lista con buscador, scroll infinito y sus acciones, que sube sobre la ficha) | `@gorhom/bottom-sheet` |
|
|
32
|
+
|
|
33
|
+
Cada componente lleva su documentación en el código: por qué es como es, y qué se probó antes.
|
|
34
|
+
|
|
35
|
+
## Instalar
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
npm install @acvl/mobile-components
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Lo que la librería usa lo pone la app (`peerDependencies`): `react-native-paper`, `expo-router`,
|
|
42
|
+
`react-native-reanimated`, `react-native-safe-area-context`, `react-native-keyboard-controller`,
|
|
43
|
+
`react-native-gesture-handler`, `@expo/vector-icons`, `@react-native-community/datetimepicker`,
|
|
44
|
+
`react-hook-form`, `dayjs`, `expo-haptics`, `expo-status-bar` y `expo-system-ui`. Sirve desde el
|
|
45
|
+
SDK 54 de Expo.
|
|
46
|
+
|
|
47
|
+
### Las fotos del servidor
|
|
48
|
+
|
|
49
|
+
Si las fotos del servidor piden la sesión, la app dice cómo bajarlas en el layout raíz: en Android
|
|
50
|
+
el `Image` no manda las `headers`, así que se bajan con `fetch` y se pinta el archivo.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<ProveedorDeFotos bajar={(ruta) => bajarConMiToken(ruta) /* → la uri local */}>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Sin proveedor, la `ruta` de una foto se pinta tal cual, como URL pública.
|
|
57
|
+
|
|
58
|
+
### La tipografía de Android
|
|
59
|
+
|
|
60
|
+
Android va con Inter (iOS se queda con San Francisco; ver `src/tema/fuentes.ts`). Los archivos
|
|
61
|
+
vienen en el paquete y cada app los registra en su `app.json`:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
["expo-font", {
|
|
65
|
+
"android": {
|
|
66
|
+
"fonts": [{
|
|
67
|
+
"fontFamily": "Inter",
|
|
68
|
+
"fontDefinitions": [
|
|
69
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_400Regular.ttf", "weight": 400 },
|
|
70
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_500Medium.ttf", "weight": 500 },
|
|
71
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_600SemiBold.ttf", "weight": 600 },
|
|
72
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_700Bold.ttf", "weight": 700 },
|
|
73
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_800ExtraBold.ttf", "weight": 800 },
|
|
74
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_900Black.ttf", "weight": 900 }
|
|
75
|
+
]
|
|
76
|
+
}]
|
|
77
|
+
}
|
|
78
|
+
}]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Cambiar esa lista obliga a reconstruir el binario.
|
|
82
|
+
|
|
83
|
+
## Armar una app
|
|
84
|
+
|
|
85
|
+
El layout raíz monta el tema y los diálogos, y exporta la pantalla de error:
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { HostDeDialogos, PantallaDeError, ProveedorDeTema } from "@acvl/mobile-components";
|
|
89
|
+
import * as SecureStore from "expo-secure-store";
|
|
90
|
+
|
|
91
|
+
const almacenDelTema = {
|
|
92
|
+
leer: () => SecureStore.getItemAsync("TEMA"),
|
|
93
|
+
guardar: (tema) => SecureStore.setItemAsync("TEMA", tema),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const ErrorBoundary = (props) => (
|
|
97
|
+
<PantallaDeError {...props} onError={(error) => Sentry.captureException(error)} />
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
export default function RootLayout() {
|
|
101
|
+
return (
|
|
102
|
+
<ProveedorDeTema almacen={almacenDelTema}>
|
|
103
|
+
<Stack screenOptions={{ headerShown: false }} />
|
|
104
|
+
<HostDeDialogos />
|
|
105
|
+
</ProveedorDeTema>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Las pestañas toman el header y la barra de la casa:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
const encabezado = useOpcionesDelEncabezado({
|
|
114
|
+
eyebrow: "Operador",
|
|
115
|
+
derecha: <BotonDeAvatar iniciales="JP" onPress={() => router.push("/perfil")} />,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
<Tabs screenOptions={encabezado} tabBar={(props) => <BarraDePestanas {...props} iconos={{ index: "assignment" }} />}>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Y una pantalla toma sus colores de la paleta, nunca hexadecimales:
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
const useStyles = crearEstilos((c) => ({
|
|
125
|
+
tarjeta: { backgroundColor: c.superficie, borderRadius: 14, padding: 14 },
|
|
126
|
+
titulo: { ...renglon(tipografia.subtitulo), fontWeight: "800", color: c.texto },
|
|
127
|
+
}));
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Desarrollar
|
|
131
|
+
|
|
132
|
+
```sh
|
|
133
|
+
npm install
|
|
134
|
+
npm run typecheck
|
|
135
|
+
npm test # la lógica pura: diálogos, errores del servidor
|
|
136
|
+
npm run build # bob: lib/module y lib/typescript
|
|
137
|
+
npm run format
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Para ver un cambio en una app sin publicar, la app de tms tiene `npm run start:lib`: Metro sirve
|
|
141
|
+
`src/` de este checkout (`../../acv-mobile-components`) en lugar del paquete de `node_modules`.
|
|
142
|
+
Tiene que estar junto a la app, en la misma carpeta que `acv-tms`.
|
|
143
|
+
|
|
144
|
+
## Publicar
|
|
145
|
+
|
|
146
|
+
Igual que la del portal: cada push a `main` corre el typecheck y las pruebas, sube el _patch_ si la
|
|
147
|
+
versión ya está en npm, publica y hace commit y tag del bump. Un bump a mano (un _minor_) se respeta.
|
|
148
|
+
Necesita el secret `NPM_TOKEN` en el repo.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Controller } from "react-hook-form";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import BotonGrande from "../componentes/BotonGrande";
|
|
7
|
+
import TiraDeFotos from "../componentes/TiraDeFotos";
|
|
8
|
+
import { Campo } from "../formularios/campos";
|
|
9
|
+
import { crearEstilos } from "../tema";
|
|
10
|
+
import { elegirDeGaleria, tomarFoto } from "./elegir";
|
|
11
|
+
|
|
12
|
+
/** El lado de cada miniatura: cabe un renglón de tres en un teléfono angosto. */
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
const LADO = 96;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fotos que se capturan con un formulario y suben al guardarlo (la evidencia de un alta, el cierre
|
|
18
|
+
* de una revisión): sus miniaturas, cada una con su «×» y abriendo el visor, y debajo **Tomar foto**
|
|
19
|
+
* y **De la galería**. Lo que se guarda es la lista de `ArchivoElegido` ya reducidos; subirlos es
|
|
20
|
+
* de quien guarda.
|
|
21
|
+
*
|
|
22
|
+
* Las que suben al momento, sin esperar a un formulario (las de una ficha que ya existe), no van
|
|
23
|
+
* aquí: ésas son una `TiraDeFotos` con sus botones.
|
|
24
|
+
*/
|
|
25
|
+
export function CampoDeFotos({
|
|
26
|
+
etiqueta,
|
|
27
|
+
ayuda,
|
|
28
|
+
error,
|
|
29
|
+
valor,
|
|
30
|
+
onCambiar,
|
|
31
|
+
permiso,
|
|
32
|
+
varias = true,
|
|
33
|
+
alTomar,
|
|
34
|
+
disabled
|
|
35
|
+
}) {
|
|
36
|
+
const styles = useStyles();
|
|
37
|
+
// Reducir una foto tarda (se decodifica completa): el botón gira mientras tanto.
|
|
38
|
+
const [eligiendo, setEligiendo] = React.useState(null);
|
|
39
|
+
const agregar = async de => {
|
|
40
|
+
setEligiendo(de);
|
|
41
|
+
try {
|
|
42
|
+
const nuevas = de === "camara" ? await tomarFoto(permiso, {
|
|
43
|
+
alTomar
|
|
44
|
+
}) : await elegirDeGaleria({
|
|
45
|
+
varias
|
|
46
|
+
});
|
|
47
|
+
if (nuevas.length) onCambiar(varias ? [...valor, ...nuevas] : nuevas.slice(0, 1));
|
|
48
|
+
} finally {
|
|
49
|
+
setEligiendo(null);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const fotos = valor.map((f, i) => ({
|
|
53
|
+
llave: `${f.uri}-${i}`,
|
|
54
|
+
esFoto: f.esFoto,
|
|
55
|
+
miniatura: {
|
|
56
|
+
uri: f.uri
|
|
57
|
+
},
|
|
58
|
+
nombre: f.nombre,
|
|
59
|
+
onQuitar: disabled ? undefined : () => onCambiar(valor.filter((_, j) => j !== i))
|
|
60
|
+
}));
|
|
61
|
+
return /*#__PURE__*/_jsx(Campo, {
|
|
62
|
+
etiqueta: etiqueta,
|
|
63
|
+
ayuda: ayuda,
|
|
64
|
+
error: error,
|
|
65
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
66
|
+
style: styles.contenido,
|
|
67
|
+
children: [/*#__PURE__*/_jsx(TiraDeFotos, {
|
|
68
|
+
fotos: fotos,
|
|
69
|
+
lado: LADO,
|
|
70
|
+
cuadricula: true
|
|
71
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
72
|
+
style: styles.botones,
|
|
73
|
+
children: [/*#__PURE__*/_jsx(BotonGrande, {
|
|
74
|
+
icono: "camera-outline",
|
|
75
|
+
modo: "contorno",
|
|
76
|
+
cargando: eligiendo === "camara",
|
|
77
|
+
disabled: disabled || eligiendo !== null,
|
|
78
|
+
onPress: () => void agregar("camara"),
|
|
79
|
+
children: "Tomar foto"
|
|
80
|
+
}), /*#__PURE__*/_jsx(BotonGrande, {
|
|
81
|
+
icono: "image-outline",
|
|
82
|
+
modo: "contorno",
|
|
83
|
+
cargando: eligiendo === "galeria",
|
|
84
|
+
disabled: disabled || eligiendo !== null,
|
|
85
|
+
onPress: () => void agregar("galeria"),
|
|
86
|
+
children: "De la galer\xEDa"
|
|
87
|
+
})]
|
|
88
|
+
})]
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** `CampoDeFotos` atado a react-hook-form: el valor es la lista de `ArchivoElegido`. */
|
|
94
|
+
export function FotosControladas({
|
|
95
|
+
control,
|
|
96
|
+
name,
|
|
97
|
+
...props
|
|
98
|
+
}) {
|
|
99
|
+
return /*#__PURE__*/_jsx(Controller, {
|
|
100
|
+
name: name,
|
|
101
|
+
control: control,
|
|
102
|
+
render: ({
|
|
103
|
+
field: {
|
|
104
|
+
value,
|
|
105
|
+
onChange
|
|
106
|
+
},
|
|
107
|
+
fieldState
|
|
108
|
+
}) => /*#__PURE__*/_jsx(CampoDeFotos, {
|
|
109
|
+
...props,
|
|
110
|
+
valor: value ?? [],
|
|
111
|
+
onCambiar: onChange,
|
|
112
|
+
error: fieldState.error?.message
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
const useStyles = crearEstilos(() => ({
|
|
117
|
+
contenido: {
|
|
118
|
+
gap: 12
|
|
119
|
+
},
|
|
120
|
+
botones: {
|
|
121
|
+
gap: 8
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
//# sourceMappingURL=CampoDeFotos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Controller","View","BotonGrande","TiraDeFotos","Campo","crearEstilos","elegirDeGaleria","tomarFoto","jsx","_jsx","jsxs","_jsxs","LADO","CampoDeFotos","etiqueta","ayuda","error","valor","onCambiar","permiso","varias","alTomar","disabled","styles","useStyles","eligiendo","setEligiendo","useState","agregar","de","nuevas","length","slice","fotos","map","f","i","llave","uri","esFoto","miniatura","nombre","onQuitar","undefined","filter","_","j","children","style","contenido","lado","cuadricula","botones","icono","modo","cargando","onPress","FotosControladas","control","name","props","render","field","value","onChange","fieldState","message","gap"],"sourceRoot":"../../../src","sources":["camara/CampoDeFotos.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAA0B,iBAAiB;AAC9D,SAASC,IAAI,QAAQ,cAAc;AACnC,OAAOC,WAAW,MAAM,4BAA4B;AACpD,OAAOC,WAAW,MAA6B,4BAA4B;AAC3E,SAASC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AAA,CACZ,CAAC;IAAA,CACL;EAAC,CACJ,CAAC;AAEhB;;AAEA;AACA,OAAO,SAASU,gBAAgBA,CAAwB;EACpDC,OAAO;EACPC,IAAI;EACJ,GAAGC;AAC8D,CAAC,EAAE;EACpE,oBACInD,IAAA,CAACT,UAAU;IACP2D,IAAI,EAAEA,IAAK;IACXD,OAAO,EAAEA,OAAQ;IACjBG,MAAM,EAAEA,CAAC;MAAEC,KAAK,EAAE;QAAEC,KAAK;QAAEC;MAAS,CAAC;MAAEC;IAAW,CAAC,kBAC/CxD,IAAA,CAACI,YAAY;MAAA,GACL+C,KAAK;MACT3C,KAAK,EAAG8C,KAAK,IAAgC,EAAG;MAChD7C,SAAS,EAAE8C,QAAS;MACpBhD,KAAK,EAAEiD,UAAU,CAACjD,KAAK,EAAEkD;IAAQ,CACpC;EACH,CACL,CAAC;AAEV;AAEA,MAAM1C,SAAS,GAAGnB,YAAY,CAAC,OAAO;EAClC4C,SAAS,EAAE;IAAEkB,GAAG,EAAE;EAAG,CAAC;EACtBf,OAAO,EAAE;IAAEe,GAAG,EAAE;EAAE;AACtB,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Tomar una foto o elegirla de la galería para subirla. Contesta lo elegido ya listo para el
|
|
4
|
+
// `FormData` (reducido a 1920 px); qué se hace con él —subirlo en el momento, guardarlo para una
|
|
5
|
+
// cola— es de quien llama. Los documentos (un PDF) están en `fotos/`, que pide expo-document-picker.
|
|
6
|
+
import * as ImagePicker from "expo-image-picker";
|
|
7
|
+
import { avisar } from "../dialogos/dialogos";
|
|
8
|
+
import { reducirFoto } from "./reducir";
|
|
9
|
+
|
|
10
|
+
/** Lo elegido: dónde está en el teléfono, su nombre, su tipo y si es una foto. */
|
|
11
|
+
|
|
12
|
+
/** Para qué se pide la cámara, dicho a quien la usa. */
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Lo que se hace con la foto **original** de la cámara antes de reducirla: guardarla en la galería
|
|
16
|
+
* del teléfono, por ejemplo, como respaldo de quien la tomó si la subida falla. Lo que falle aquí
|
|
17
|
+
* no detiene la foto.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* El permiso de la cámara. Si ya se negó para siempre, se dice dónde activarlo; si nunca se ha
|
|
22
|
+
* pedido, primero la explicación de la app (si hay) y luego el diálogo del sistema.
|
|
23
|
+
*/
|
|
24
|
+
export async function pedirPermisoDeCamara({
|
|
25
|
+
para,
|
|
26
|
+
explicacion
|
|
27
|
+
}) {
|
|
28
|
+
const actual = await ImagePicker.getCameraPermissionsAsync();
|
|
29
|
+
if (actual.granted) return true;
|
|
30
|
+
if (!actual.canAskAgain) {
|
|
31
|
+
await avisar({
|
|
32
|
+
titulo: "Sin permiso de cámara",
|
|
33
|
+
mensaje: `Para ${para}, activa la cámara para la app en los ajustes del teléfono.`,
|
|
34
|
+
icono: "camera-off-outline"
|
|
35
|
+
});
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (explicacion) {
|
|
39
|
+
await avisar({
|
|
40
|
+
titulo: "La cámara",
|
|
41
|
+
mensaje: explicacion,
|
|
42
|
+
icono: "camera-outline",
|
|
43
|
+
cancelable: false
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return (await ImagePicker.requestCameraPermissionsAsync()).granted;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Las imágenes elegidas, reducidas a 1920 px en JPEG (`reducirFoto`). Una por una y no con
|
|
51
|
+
* `Promise.all`: cada foto se decodifica completa en memoria, y veinte a la vez desde la galería
|
|
52
|
+
* pueden tumbar la app en un Android modesto.
|
|
53
|
+
*/
|
|
54
|
+
export async function deFotos(assets) {
|
|
55
|
+
const elegidos = [];
|
|
56
|
+
for (const asset of assets) {
|
|
57
|
+
const reducida = await reducirFoto(asset);
|
|
58
|
+
elegidos.push({
|
|
59
|
+
uri: reducida.uri,
|
|
60
|
+
nombre: reducida.fileName ?? "foto.jpg",
|
|
61
|
+
tipo: reducida.mimeType ?? "image/jpeg",
|
|
62
|
+
esFoto: true
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return elegidos;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Una foto con la cámara, con su permiso. Vacío si no hubo permiso o se canceló. */
|
|
69
|
+
export async function tomarFoto(permiso, {
|
|
70
|
+
alTomar
|
|
71
|
+
} = {}) {
|
|
72
|
+
if (!(await pedirPermisoDeCamara(permiso))) return [];
|
|
73
|
+
const resultado = await ImagePicker.launchCameraAsync({
|
|
74
|
+
mediaTypes: ["images"],
|
|
75
|
+
quality: 1
|
|
76
|
+
});
|
|
77
|
+
if (resultado.canceled) return [];
|
|
78
|
+
if (alTomar) {
|
|
79
|
+
for (const original of resultado.assets) {
|
|
80
|
+
try {
|
|
81
|
+
await alTomar(original);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.warn("No se pudo guardar la original de la foto.", error);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return deFotos(resultado.assets);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* De la galería. En Android el selector de fotos del sistema no pide permiso de almacenamiento,
|
|
92
|
+
* así que no hay explicación previa que dar.
|
|
93
|
+
*/
|
|
94
|
+
export async function elegirDeGaleria({
|
|
95
|
+
varias = false
|
|
96
|
+
} = {}) {
|
|
97
|
+
const resultado = await ImagePicker.launchImageLibraryAsync({
|
|
98
|
+
mediaTypes: ["images"],
|
|
99
|
+
allowsMultipleSelection: varias,
|
|
100
|
+
quality: 1
|
|
101
|
+
});
|
|
102
|
+
return resultado.canceled ? [] : deFotos(resultado.assets);
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=elegir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ImagePicker","avisar","reducirFoto","pedirPermisoDeCamara","para","explicacion","actual","getCameraPermissionsAsync","granted","canAskAgain","titulo","mensaje","icono","cancelable","requestCameraPermissionsAsync","deFotos","assets","elegidos","asset","reducida","push","uri","nombre","fileName","tipo","mimeType","esFoto","tomarFoto","permiso","alTomar","resultado","launchCameraAsync","mediaTypes","quality","canceled","original","error","console","warn","elegirDeGaleria","varias","launchImageLibraryAsync","allowsMultipleSelection"],"sourceRoot":"../../../src","sources":["camara/elegir.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAO,KAAKA,WAAW,MAAM,mBAAmB;AAChD,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,WAAW,QAAQ,WAAW;;AAEvC;;AAQA;;AAWA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,OAAO,eAAeC,oBAAoBA,CAAC;EACvCC,IAAI;EACJC;AACa,CAAC,EAAoB;EAClC,MAAMC,MAAM,GAAG,MAAMN,WAAW,CAACO,yBAAyB,CAAC,CAAC;EAC5D,IAAID,MAAM,CAACE,OAAO,EAAE,OAAO,IAAI;EAC/B,IAAI,CAACF,MAAM,CAACG,WAAW,EAAE;IACrB,MAAMR,MAAM,CAAC;MACTS,MAAM,EAAE,uBAAuB;MAC/BC,OAAO,EAAE,QAAQP,IAAI,6DAA6D;MAClFQ,KAAK,EAAE;IACX,CAAC,CAAC;IACF,OAAO,KAAK;EAChB;EACA,IAAIP,WAAW,EAAE;IACb,MAAMJ,MAAM,CAAC;MACTS,MAAM,EAAE,WAAW;MACnBC,OAAO,EAAEN,WAAW;MACpBO,KAAK,EAAE,gBAAgB;MACvBC,UAAU,EAAE;IAChB,CAAC,CAAC;EACN;EACA,OAAO,CAAC,MAAMb,WAAW,CAACc,6BAA6B,CAAC,CAAC,EAAEN,OAAO;AACtE;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeO,OAAOA,CAACC,MAAsC,EAA6B;EAC7F,MAAMC,QAA0B,GAAG,EAAE;EACrC,KAAK,M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F,MAAM;IAC/BP,OAAO,EAAE;EACb,CAAC,CAAC;EACF,OAAOH,SAAS,CAACI,QAAQ,GAAG,EAAE,GAAGnB,OAAO,CAACe,SAAS,CAACd,MAAM,CAAC;AAC9D","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// `@acvl/mobile-components/camara`: tomar fotos o elegirlas de la galería, y el campo de fotos de un
|
|
4
|
+
// formulario. Va aparte de la entrada principal porque usa expo-image-picker y
|
|
5
|
+
// expo-image-manipulator, que sólo instala la app que sube fotos; y aparte de `fotos` porque ésa
|
|
6
|
+
// además elige documentos, con expo-document-picker.
|
|
7
|
+
export { CampoDeFotos, FotosControladas } from "./CampoDeFotos";
|
|
8
|
+
export { deFotos, elegirDeGaleria, pedirPermisoDeCamara, tomarFoto } from "./elegir";
|
|
9
|
+
export { LADO_MAXIMO, reducirFoto, reducirImagenAdjunta } from "./reducir";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CampoDeFotos","FotosControladas","deFotos","elegirDeGaleria","pedirPermisoDeCamara","tomarFoto","LADO_MAXIMO","reducirFoto","reducirImagenAdjunta"],"sourceRoot":"../../../src","sources":["camara/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,gBAAgB,QAAQ,gBAAgB;AAC/D,SACIC,OAAO,EACPC,eAAe,EACfC,oBAAoB,EACpBC,SAAS,QAIN,UAAU;AACjB,SAASC,WAAW,EAAEC,WAAW,EAAEC,oBAAoB,QAAQ,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Achicar las fotos en el teléfono antes de subirlas.
|
|
4
|
+
import { ImageManipulator, SaveFormat } from "expo-image-manipulator";
|
|
5
|
+
import { Image } from "react-native";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lado más largo con el que se sube una foto. Es el mismo con el que el backend la guarda
|
|
9
|
+
* (`MAX_DIMENSION` en `core/shared/fields.py`): arriba de eso los píxeles viajan para que el
|
|
10
|
+
* servidor los tire.
|
|
11
|
+
*/
|
|
12
|
+
export const LADO_MAXIMO = 1920;
|
|
13
|
+
|
|
14
|
+
/** Calidad JPEG de la copia reducida; el backend recodifica a 82 al guardarla. */
|
|
15
|
+
const CALIDAD = 0.8;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* La foto con su lado más largo en `LADO_MAXIMO` y codificada en JPEG.
|
|
19
|
+
*
|
|
20
|
+
* Una foto de la cámara (12 MP o más) pesa de 2 a 5 MB, y se sube con la señal que haya en el
|
|
21
|
+
* camino o en el patio: reducida pesa unos cientos de KB, sale antes y no se pasa del tope
|
|
22
|
+
* de tamaño del servidor. El servidor no pierde nada, porque de todos modos la guarda a 1920 px.
|
|
23
|
+
*
|
|
24
|
+
* Falla en blando: si no se puede reducir, se guarda la original —pesa más, pero es mejor que
|
|
25
|
+
* perder la foto que se acaba de tomar—.
|
|
26
|
+
*/
|
|
27
|
+
export async function reducirFoto(asset) {
|
|
28
|
+
const {
|
|
29
|
+
width,
|
|
30
|
+
height
|
|
31
|
+
} = asset;
|
|
32
|
+
const cabe = width > 0 && height > 0 && Math.max(width, height) <= LADO_MAXIMO;
|
|
33
|
+
if (cabe && asset.mimeType === "image/jpeg") return asset;
|
|
34
|
+
try {
|
|
35
|
+
const contexto = ImageManipulator.manipulate(asset.uri);
|
|
36
|
+
if (!cabe) {
|
|
37
|
+
// Se da un solo lado y el otro sale de la proporción.
|
|
38
|
+
contexto.resize(width >= height ? {
|
|
39
|
+
width: LADO_MAXIMO
|
|
40
|
+
} : {
|
|
41
|
+
height: LADO_MAXIMO
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const imagen = await contexto.renderAsync();
|
|
45
|
+
const reducida = await imagen.saveAsync({
|
|
46
|
+
compress: CALIDAD,
|
|
47
|
+
format: SaveFormat.JPEG
|
|
48
|
+
});
|
|
49
|
+
const base = (asset.fileName ?? reducida.uri.split("/").pop() ?? "foto").replace(/\.[^.]+$/, "");
|
|
50
|
+
return {
|
|
51
|
+
...asset,
|
|
52
|
+
uri: reducida.uri,
|
|
53
|
+
width: reducida.width,
|
|
54
|
+
height: reducida.height,
|
|
55
|
+
fileName: `${base}.jpg`,
|
|
56
|
+
mimeType: "image/jpeg",
|
|
57
|
+
fileSize: undefined
|
|
58
|
+
};
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.warn("No se pudo reducir la foto; se sube la original.", error);
|
|
61
|
+
return asset;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Lo mismo para una imagen adjuntada como archivo (`DocumentPicker`), que no trae sus medidas: se
|
|
67
|
+
* leen del archivo y se reduce como una foto. Si no se pueden leer, se guarda la original.
|
|
68
|
+
*/
|
|
69
|
+
export async function reducirImagenAdjunta(archivo) {
|
|
70
|
+
try {
|
|
71
|
+
const {
|
|
72
|
+
width,
|
|
73
|
+
height
|
|
74
|
+
} = await Image.getSize(archivo.uri);
|
|
75
|
+
const reducida = await reducirFoto({
|
|
76
|
+
uri: archivo.uri,
|
|
77
|
+
width,
|
|
78
|
+
height,
|
|
79
|
+
fileName: archivo.nombre,
|
|
80
|
+
mimeType: archivo.tipo,
|
|
81
|
+
type: "image"
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
uri: reducida.uri,
|
|
85
|
+
nombre: reducida.fileName ?? archivo.nombre,
|
|
86
|
+
tipo: reducida.mimeType ?? archivo.tipo
|
|
87
|
+
};
|
|
88
|
+
} catch (error) {
|
|
89
|
+
console.warn("No se pudieron leer las medidas de la imagen; se sube la original.", error);
|
|
90
|
+
return archivo;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=reducir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ImageManipulator","SaveFormat","Image","LADO_MAXIMO","CALIDAD","reducirFoto","asset","width","height","cabe","Math","max","mimeType","contexto","manipulate","uri","resize","imagen","renderAsync","reducida","saveAsync","compress","format","JPEG","base","fileName","split","pop","replace","fileSize","undefined","error","console","warn","reducirImagenAdjunta","archivo","getSize","nombre","tipo","type"],"sourceRoot":"../../../src","sources":["camara/reducir.ts"],"mappings":";;AAAA;AACA,SAASA,gBAAgB,EAAEC,UAAU,QAAQ,wBAAwB;AAErE,SAASC,KAAK,QAAQ,cAAc;;AAEpC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAG,IAAI;;AAE/B;AACA,MAAMC,OAAO,GAAG,GAAG;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,WAAWA,CAACC,KAAuB,EAA6B;EAClF,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,KAAK;EAC/B,MAAMG,IAAI,GAAGF,KAAK,GAAG,CAAC,IAAIC,MAAM,GAAG,CAAC,IAAIE,IAAI,CAACC,GAAG,CAACJ,KAAK,EAAEC,MAAM,CAAC,IAAIL,WAAW;EAC9E,IAAIM,IAAI,IAAIH,KAAK,CAACM,QAAQ,KAAK,YAAY,EAAE,OAAON,KAAK;EAEzD,IAAI;IACA,MAAMO,QAAQ,GAAGb,gBAAgB,CAACc,UAAU,CAACR,KAAK,CAACS,GAAG,CAAC;IACvD,IAAI,CAACN,IAAI,EAAE;MACP;MACAI,QAAQ,CAACG,MAAM,CAACT,KAAK,IAAIC,MAAM,GAAG;QAAED,KAAK,EAAEJ;MAAY,CAAC,GAAG;QAAEK,MAAM,EAAEL;MAAY,CAAC,CAAC;IACvF;IACA,MAAMc,MAAM,GAAG,MAAMJ,QAAQ,CAACK,WAAW,CAAC,CAAC;IAC3C,MAAMC,QAAQ,GAAG,MAAMF,MAAM,CAACG,SAAS,CAAC;MAAEC,QAAQ,EAAEjB,OAAO;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