valtech-components 2.0.942 → 2.0.944

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.
@@ -2,3 +2,4 @@
2
2
  * Shared configuration exports
3
3
  */
4
4
  export * from './company-footer.config';
5
+ export * from './site-links.config';
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Standard cross-app site links (env-aware)
3
+ *
4
+ * En el factory MyValtech cada producto satélite (showcase, sigify, …) enlaza a
5
+ * `web` —la landing de marca— para soporte, contacto y contenido legal. `web`
6
+ * es el dueño canónico de esas rutas. Este módulo centraliza:
7
+ *
8
+ * 1. El mapa ambiente → base URL de `web` (`VALTECH_WEB_BASE_URLS`).
9
+ * 2. El catálogo de paths estándar que viven en `web` (`VALTECH_SITE_PATHS`).
10
+ *
11
+ * El ambiente se decide en BUILD TIME (campo `valtechEnv` en el `environment*.ts`
12
+ * de cada app), igual que `apiUrl`. Es el mecanismo más confiable: detectar por
13
+ * hostname en runtime se rompe con dominios custom / `web.app` / variantes de
14
+ * localhost.
15
+ *
16
+ * La resolución real (join baseUrl + path, abrir en tab nueva, `?lang=`) la hace
17
+ * `LegalLinkService`; este módulo solo le entrega el `baseUrl` correcto por env.
18
+ *
19
+ * @see provideValtechSite — wiring de una sola línea para apps satélite.
20
+ */
21
+ /** Ambientes del factory. Coincide con los `environment*.ts` de cada app. */
22
+ export type ValtechEnv = 'local' | 'dev' | 'prod';
23
+ /**
24
+ * Base URL de `web` (landing de marca) por ambiente.
25
+ *
26
+ * - `local` → `ng serve` de `web` (puerto 8100).
27
+ * - `dev` → proyecto Firebase `myvaltech-dev`.
28
+ * - `prod` → dominio custom de producción.
29
+ *
30
+ * Sin trailing slash (lo asume `LegalLinkService`).
31
+ */
32
+ export declare const VALTECH_WEB_BASE_URLS: Record<ValtechEnv, string>;
33
+ /**
34
+ * Resuelve la base URL de `web` para un ambiente.
35
+ *
36
+ * Fallback a `prod` cuando el env es desconocido o falta: ante la duda, apuntar
37
+ * a producción es lo seguro (nunca enlaza a un host local/dev inexistente).
38
+ */
39
+ export declare function resolveWebBaseUrl(env?: ValtechEnv | string | null): string;
40
+ /**
41
+ * Catálogo de paths estándar que viven en `web`. Las apps resuelven estos
42
+ * contra la base URL del ambiente vía `LegalLinkService.resolve(path)`.
43
+ *
44
+ * Mantener alineado con las rutas reales de `web/src/app/app.routes.ts` y con
45
+ * `VALTECH_COMPANY_LINKS` (footer).
46
+ */
47
+ export declare const VALTECH_SITE_PATHS: {
48
+ readonly home: "/";
49
+ readonly support: "/contact";
50
+ readonly contact: "/contact";
51
+ readonly faq: "/faq";
52
+ readonly about: "/legal/about";
53
+ readonly terms: "/legal/terms";
54
+ readonly privacy: "/legal/privacy";
55
+ readonly cookies: "/legal/cookies";
56
+ readonly legalNotice: "/legal/legal-notice";
57
+ };
58
+ /** Clave de un link estándar del sitio (`'home' | 'support' | …`). */
59
+ export type ValtechSitePathKey = keyof typeof VALTECH_SITE_PATHS;
@@ -1,4 +1,5 @@
1
1
  import { InjectionToken, Provider } from '@angular/core';
2
+ import { ValtechEnv } from '../../config/site-links.config';
2
3
  import * as i0 from "@angular/core";
3
4
  /**
4
5
  * Config for cross-app legal/site link resolution.
@@ -71,3 +72,23 @@ export declare class LegalLinkService {
71
72
  * }),
72
73
  */
73
74
  export declare function provideValtechLegal(config: ValtechLegalConfig): Provider;
75
+ /**
76
+ * Wiring de una sola línea para que una app satélite apunte sus links de sitio
77
+ * (legal, soporte, contacto, …) a `web` —la landing de marca— en el ambiente
78
+ * correcto. Resuelve el `baseUrl` desde `VALTECH_WEB_BASE_URLS` según el `env`
79
+ * baked en build-time (`environment.valtechEnv`) y delega en `provideValtechLegal`.
80
+ *
81
+ * Ambiente desconocido/ausente → fallback a `prod` (ver `resolveWebBaseUrl`).
82
+ * El main site (`web`) NO llama esto — sus links quedan relativos.
83
+ *
84
+ * @example
85
+ * // main.ts de showcase / sigify / …
86
+ * import { environment } from './environments/environment';
87
+ * provideValtechSite(environment.valtechEnv), // 'local' | 'dev' | 'prod'
88
+ *
89
+ * @see resolveWebBaseUrl
90
+ * @see VALTECH_SITE_PATHS — catálogo de paths estándar que viven en `web`.
91
+ */
92
+ export declare function provideValtechSite(env?: ValtechEnv | string | null, options?: {
93
+ openInNewTab?: boolean;
94
+ }): Provider;
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.942";
5
+ export declare const VERSION = "2.0.944";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.942",
3
+ "version": "2.0.944",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"