valtech-components 2.0.1004 → 2.0.1006

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.
@@ -0,0 +1,88 @@
1
+ import { ActionCardMetadata } from '../../molecules/action-card/types';
2
+ import { TitleMetadata } from '../../atoms/title/types';
3
+ import { AboutAction, AboutViewConfig } from './types';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * `val-about-view` — vista About full-feature autocontenida (organism).
7
+ * Promovida desde `showcase` bajo el proceso de ADR-021. Reúne:
8
+ * - **HERO** — logo + nombre de marca + tagline + pill de versión (copiable).
9
+ * - **Descripción** — título + cuerpo.
10
+ * - **Acciones** — action-card de rating built-in (abre `val-content-reaction`
11
+ * DIRECTAMENTE vía `ModalService`, sin wrapper local — decisión CTO) + las
12
+ * acciones genéricas que el consumer aporte por `config.actions`.
13
+ * - **Redes** — links sociales (`config.socialLinks`); sección oculta si vacía.
14
+ * - **Footer** — copyright con el año actual.
15
+ *
16
+ * Lo app-specific (logo, nombre, versión, redes, acciones share/faq) viaja como
17
+ * DATA de config — NO como slots (ADR-021). La versión la pasa el consumer
18
+ * (`config.version` = su `APP_VERSION`); la lib NO importa el `version.ts` de la
19
+ * app. Si no se pasa versión, el pill se oculta.
20
+ *
21
+ * NO renderiza ion-content — vive dentro de val-page-wrapper. `ActivatedRoute`
22
+ * se inyecta `{ optional: true }` solo para leer el route data de config.
23
+ *
24
+ * Auto-registra sus defaults i18n (es/en) en el constructor si el consumer no
25
+ * proveyó el namespace configurado (default `Settings.About`).
26
+ *
27
+ * GOTCHA i18n ContentReaction: `val-content-reaction` exige su namespace
28
+ * `ContentReaction` registrado donde se use (key faltante en binding + CD =
29
+ * navegador congelado en dev). `ContentReactionComponent` se auto-registra ese
30
+ * namespace en SU constructor, y como se abre vía `ModalService` ese constructor
31
+ * corre antes de que su template binde — queda cubierto. Igual lo importamos
32
+ * como dependencia explícita de esta vista para que la garantía sea local.
33
+ */
34
+ export declare class AboutViewComponent {
35
+ private nav;
36
+ private i18n;
37
+ private modalService;
38
+ private toast;
39
+ private route;
40
+ /**
41
+ * Config vía @Input (object-first). Si no se pasa, se cae al route data
42
+ * `aboutConfig` (poblado por `provideValtechAboutRoutes`). `resolvedConfig`
43
+ * mergea con los defaults — `@Input` gana sobre route data.
44
+ */
45
+ config?: AboutViewConfig;
46
+ readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<AboutViewConfig, "onRated">> & Pick<AboutViewConfig, "onRated">>;
47
+ /** Namespace i18n resuelto (capturado para llamadas no-reactivas). */
48
+ private get ns();
49
+ readonly brandName: import("@angular/core").Signal<string>;
50
+ readonly logoSrc: import("@angular/core").Signal<string>;
51
+ readonly version: import("@angular/core").Signal<string>;
52
+ readonly socialLinks: import("@angular/core").Signal<{
53
+ icon: string;
54
+ url: string;
55
+ label: string;
56
+ }[]>;
57
+ readonly showRating: import("@angular/core").Signal<boolean>;
58
+ readonly actions: import("@angular/core").Signal<AboutAction[]>;
59
+ /** Copyright del footer — año actual interpolado en `copyrightText`. */
60
+ readonly copyright: import("@angular/core").Signal<string>;
61
+ /** Title metadata para secciones — bold + size small. */
62
+ readonly rateActionCard: import("@angular/core").Signal<ActionCardMetadata>;
63
+ constructor();
64
+ /** Helper i18n bound al namespace resuelto. Reactivo vía `lang()`. */
65
+ protected tt(key: string): string;
66
+ /** Title metadata para secciones — bold + size small. */
67
+ protected sectionTitle(key: string): TitleMetadata;
68
+ /** ActionCardMetadata para una acción genérica del consumer. */
69
+ protected extraActionCard(action: AboutAction): ActionCardMetadata;
70
+ /** Copia la versión al portapapeles + toast (color dark). */
71
+ copyVersion(): Promise<void>;
72
+ /** Abre una URL externa en nueva tab. `mailto:` queda en la misma tab. */
73
+ openUrl(url: string): void;
74
+ /**
75
+ * "Calificar la app" — abre `val-content-reaction` DIRECTAMENTE como sheet
76
+ * modal (sin wrapper local — decisión CTO). El componente persiste la reacción
77
+ * contra el backend de feedback y muestra su propio estado de "gracias"; el
78
+ * sheet se cierra arrastrando (breakpoint 0). El namespace i18n
79
+ * `ContentReaction` lo auto-registra `ContentReactionComponent` en su
80
+ * constructor, que corre al crear el modal — sin riesgo de key faltante.
81
+ *
82
+ * Sheet (bottom sheet): el contenido scrollea dentro y el botón "Enviar" queda
83
+ * siempre alcanzable, también en viewports chicos.
84
+ */
85
+ openRating(): Promise<void>;
86
+ static ɵfac: i0.ɵɵFactoryDeclaration<AboutViewComponent, never>;
87
+ static ɵcmp: i0.ɵɵComponentDeclaration<AboutViewComponent, "val-about-view", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
88
+ }
@@ -0,0 +1,14 @@
1
+ import { LanguagesContent } from '../../../services/i18n/types';
2
+ /**
3
+ * Defaults i18n (es/en) embebidos en `val-about-view`. Auto-registrados en el
4
+ * constructor del componente si el consumer no proveyó el namespace
5
+ * (`Settings.About` por default). SOLO incluye las keys que la vista usa.
6
+ *
7
+ * Textos portados EXACTOS del override `Settings.About` de showcase
8
+ * (`frontend/showcase/src/i18n/index.ts`). Las keys de las acciones
9
+ * showcase-specific (`feedback*`, `share*`, `faq*`, `donate*`) NO se incluyen:
10
+ * esas acciones se modelan ahora como `actions[]` de la config (el consumer
11
+ * aporta sus propios textos). `copyrightText` se incluye aquí (antes salía del
12
+ * namespace `Layout`) para que la vista sea autocontenida.
13
+ */
14
+ export declare const ABOUT_VIEW_I18N: LanguagesContent;
@@ -0,0 +1,31 @@
1
+ import { Routes } from '@angular/router';
2
+ import { AboutViewConfig } from './types';
3
+ /**
4
+ * Helper para montar la vista About (`val-about-view`) como ruta en una app del
5
+ * factory. El `config` se pasa por route `data` (`aboutConfig`) y el componente
6
+ * lo lee como fallback de su `@Input() config` (el `@Input` gana).
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // settings.routes.ts
11
+ * import { APP_VERSION } from '../version';
12
+ *
13
+ * export const settingsRoutes: Routes = [
14
+ * ...provideValtechAboutRoutes({ config: { version: APP_VERSION } }), // → /app/about
15
+ * { path: 'preferences', loadComponent: () => ... },
16
+ * ];
17
+ *
18
+ * // con redes y acciones extra:
19
+ * ...provideValtechAboutRoutes({
20
+ * config: {
21
+ * version: APP_VERSION,
22
+ * socialLinks: VALTECH_SOCIAL_LINKS.map(s => ({ icon: s.icon, url: s.url, label: s.name })),
23
+ * actions: [{ label: 'Compartir', icon: 'share-social-outline', onClick: () => share() }],
24
+ * },
25
+ * }),
26
+ * ```
27
+ */
28
+ export declare function provideValtechAboutRoutes(opts?: {
29
+ path?: string;
30
+ config?: AboutViewConfig;
31
+ }): Routes;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Configuración acotada de `val-about-view` (object-first). La vista About es
3
+ * app-specific por naturaleza (logo, nombre, versión, redes, acciones extra),
4
+ * así que lo propio de cada app se parametriza como **DATA de config** — NO como
5
+ * slots arbitrarios (ADR-021: una vista full-feature no abre slots; si falta
6
+ * algo, se promueve un nuevo punto de extensión).
7
+ *
8
+ * Ejes de variación permitidos:
9
+ * - **branding** — `brand.name` / `brand.logoSrc` (qué muestra el HERO).
10
+ * - **versión** — `version` la pasa el consumer (la lib NO puede importar el
11
+ * `version.ts` de la app). Si no se pasa, se oculta el pill de versión.
12
+ * - **redes** — `socialLinks`; si está vacío se oculta la sección social.
13
+ * - **rating** — `showRating` + `ratingEntityId` + `onRated`.
14
+ * - **acciones extra** — `actions[]` genéricas que el consumer agrega junto a
15
+ * la acción de rating built-in.
16
+ * - **branding i18n** — `i18nNamespace` (default `'Settings.About'`).
17
+ */
18
+ /** Marca a mostrar en el HERO (logo + nombre). */
19
+ export interface AboutBrand {
20
+ /** Nombre de la marca. Default `'Valtech'`. */
21
+ name?: string;
22
+ /** Ruta del logo. Default `'assets/images/main-icon.png'`. */
23
+ logoSrc?: string;
24
+ }
25
+ /**
26
+ * Acción genérica extra de la sección "Acciones" (además del rating built-in).
27
+ * El consumer la modela completa (label/descripción/ícono + handler). Las
28
+ * acciones share/faq de showcase NO son genéricas (Web Share API y ruta interna
29
+ * de la app), por eso se exponen como `actions` para que cada app aporte las
30
+ * suyas en vez de hardcodearlas en la lib.
31
+ */
32
+ export interface AboutAction {
33
+ /** Texto principal de la action-card. */
34
+ label: string;
35
+ /** Texto secundario (opcional). */
36
+ description?: string;
37
+ /** Ionicon name (ej. `'share-social-outline'`). */
38
+ icon?: string;
39
+ /** Handler del click. */
40
+ onClick: () => void;
41
+ }
42
+ export interface AboutViewConfig {
43
+ /** Marca del HERO (logo + nombre). Default Valtech. */
44
+ brand?: AboutBrand;
45
+ /**
46
+ * Versión a mostrar en el pill (el consumer pasa su `APP_VERSION`). La lib NO
47
+ * importa el `version.ts` de la app. Si no se pasa, el pill de versión se
48
+ * oculta.
49
+ */
50
+ version?: string;
51
+ /**
52
+ * Redes sociales. Si está vacío (o no se pasa), la sección social se oculta.
53
+ * `icon` = ionicon name; `url` = destino; `label` = aria-label.
54
+ */
55
+ socialLinks?: {
56
+ icon: string;
57
+ url: string;
58
+ label: string;
59
+ }[];
60
+ /** Muestra la action-card de rating built-in. Default `true`. */
61
+ showRating?: boolean;
62
+ /**
63
+ * `entityId` del `entityRef` que recibe `val-content-reaction` al calificar
64
+ * (el `entityType` es siempre `'app'`). Default `'experience'`.
65
+ */
66
+ ratingEntityId?: string;
67
+ /** Acciones genéricas extra de la sección "Acciones". Default `[]`. */
68
+ actions?: AboutAction[];
69
+ /**
70
+ * Namespace i18n con el que la vista resuelve sus textos.
71
+ * Default `'Settings.About'`.
72
+ */
73
+ i18nNamespace?: string;
74
+ /** Hook tras enviar la calificación (rating) desde `val-content-reaction`. */
75
+ onRated?: () => void;
76
+ }
package/lib/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "2.0.1004";
5
+ export declare const VERSION = "2.0.1006";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.1004",
3
+ "version": "2.0.1006",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
package/public-api.d.ts CHANGED
@@ -293,6 +293,9 @@ export * from './lib/components/organisms/notification-preferences-view/notifica
293
293
  export * from './lib/components/organisms/permissions-view/permissions-view.component';
294
294
  export * from './lib/components/organisms/permissions-view/types';
295
295
  export * from './lib/components/organisms/permissions-view/permissions.routes';
296
+ export * from './lib/components/organisms/about-view/about-view.component';
297
+ export * from './lib/components/organisms/about-view/types';
298
+ export * from './lib/components/organisms/about-view/about.routes';
296
299
  export * from './lib/services/org/permission-catalog.service';
297
300
  export * from './lib/components/organisms/delete-account-modal/delete-account-modal.component';
298
301
  export * from './lib/components/organisms/switch-org-modal/switch-org-modal.component';