valtech-components 2.0.730 → 2.0.732

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.
Files changed (29) hide show
  1. package/esm2022/lib/components/atoms/glow/glow.component.mjs +95 -0
  2. package/esm2022/lib/components/atoms/glow/types.mjs +2 -0
  3. package/esm2022/lib/components/organisms/bottom-nav/bottom-nav.component.mjs +4 -4
  4. package/esm2022/lib/components/organisms/bottom-nav/types.mjs +2 -2
  5. package/esm2022/lib/components/organisms/login/login.component.mjs +3 -3
  6. package/esm2022/lib/config/company-footer.config.mjs +34 -20
  7. package/esm2022/lib/services/devices/devices.service.mjs +259 -0
  8. package/esm2022/lib/services/devices/index.mjs +3 -0
  9. package/esm2022/lib/services/devices/types.mjs +8 -0
  10. package/esm2022/lib/services/legal-link/legal-link.service.mjs +68 -0
  11. package/esm2022/lib/version.mjs +2 -2
  12. package/esm2022/public-api.mjs +10 -1
  13. package/fesm2022/valtech-components.mjs +458 -28
  14. package/fesm2022/valtech-components.mjs.map +1 -1
  15. package/lib/components/atoms/glow/glow.component.d.ts +42 -0
  16. package/lib/components/atoms/glow/types.d.ts +40 -0
  17. package/lib/components/atoms/rights-footer/rights-footer.component.d.ts +1 -1
  18. package/lib/components/molecules/features-list/features-list.component.d.ts +1 -1
  19. package/lib/components/organisms/article/article.component.d.ts +3 -3
  20. package/lib/components/organisms/bottom-nav/types.d.ts +1 -1
  21. package/lib/components/organisms/toolbar/toolbar.component.d.ts +1 -1
  22. package/lib/config/company-footer.config.d.ts +24 -4
  23. package/lib/services/devices/devices.service.d.ts +73 -0
  24. package/lib/services/devices/index.d.ts +2 -0
  25. package/lib/services/devices/types.d.ts +11 -0
  26. package/lib/services/legal-link/legal-link.service.d.ts +59 -0
  27. package/lib/version.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/public-api.d.ts +4 -0
@@ -0,0 +1,42 @@
1
+ import { GlowIntensity, GlowMetadata, GlowPosition, GlowShape, GlowSize } from './types';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * `val-glow` — wrapper that paints a colored radial or linear gradient behind its
5
+ * projected content. Uses Ionic color tokens, so it respects light/dark theme.
6
+ *
7
+ * @example
8
+ * <val-glow [props]="{ color: 'primary', position: 'top', size: 'large' }">
9
+ * <h1>Hero title</h1>
10
+ * <p>Body copy...</p>
11
+ * </val-glow>
12
+ *
13
+ * @example Two-tone radial
14
+ * <val-glow [props]="{ color: 'primary', secondaryColor: 'tertiary', position: 'center' }">
15
+ * ...
16
+ * </val-glow>
17
+ *
18
+ * @example Linear sweep from top
19
+ * <val-glow [props]="{ color: 'success', shape: 'linear', position: 'top', intensity: 'strong' }">
20
+ * ...
21
+ * </val-glow>
22
+ */
23
+ export declare class GlowComponent {
24
+ props: import("@angular/core").InputSignal<GlowMetadata>;
25
+ protected color: import("@angular/core").Signal<import("@ionic/core").Color>;
26
+ protected secondaryColor: import("@angular/core").Signal<import("@ionic/core").Color>;
27
+ protected hasSecondary: import("@angular/core").Signal<boolean>;
28
+ protected position: import("@angular/core").Signal<GlowPosition>;
29
+ protected size: import("@angular/core").Signal<GlowSize>;
30
+ protected intensity: import("@angular/core").Signal<GlowIntensity>;
31
+ protected shape: import("@angular/core").Signal<GlowShape>;
32
+ protected animated: import("@angular/core").Signal<boolean>;
33
+ protected blendMode: import("@angular/core").Signal<"normal" | "multiply" | "screen" | "overlay" | "soft-light" | "hard-light" | "color-dodge">;
34
+ protected colorRgbVar: import("@angular/core").Signal<string>;
35
+ protected secondaryColorRgbVar: import("@angular/core").Signal<string>;
36
+ protected positionCss: import("@angular/core").Signal<string>;
37
+ protected sizeCss: import("@angular/core").Signal<string>;
38
+ protected intensityValue: import("@angular/core").Signal<string>;
39
+ protected angleCss: import("@angular/core").Signal<string>;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<GlowComponent, never>;
41
+ static ɵcmp: i0.ɵɵComponentDeclaration<GlowComponent, "val-glow", never, { "props": { "alias": "props"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
42
+ }
@@ -0,0 +1,40 @@
1
+ import { Color } from '@ionic/core';
2
+ /**
3
+ * Origin point of the glow.
4
+ * Maps to a CSS background-position value.
5
+ */
6
+ export type GlowPosition = 'top-left' | 'top' | 'top-right' | 'left' | 'center' | 'right' | 'bottom-left' | 'bottom' | 'bottom-right';
7
+ /** Radius preset of the glow halo. */
8
+ export type GlowSize = 'small' | 'medium' | 'large' | 'xlarge';
9
+ /** Alpha multiplier applied to the glow color(s). */
10
+ export type GlowIntensity = 'subtle' | 'medium' | 'strong';
11
+ /**
12
+ * Gradient shape:
13
+ * - `radial` — circular halo at `position` (default; matches the showcase / AWS look)
14
+ * - `linear` — directional sweep from `position` outwards (good for full-band backdrops)
15
+ */
16
+ export type GlowShape = 'radial' | 'linear';
17
+ /**
18
+ * Configuration for `val-glow`.
19
+ */
20
+ export interface GlowMetadata {
21
+ /** Primary Ionic color of the glow. Default `'primary'`. */
22
+ color?: Color;
23
+ /**
24
+ * Optional second Ionic color for two-tone gradients. When set, the gradient
25
+ * blends `color` → `secondaryColor` → transparent.
26
+ */
27
+ secondaryColor?: Color;
28
+ /** Where the halo originates. Default `'center'`. */
29
+ position?: GlowPosition;
30
+ /** Halo radius preset. Default `'large'`. */
31
+ size?: GlowSize;
32
+ /** Opacity preset of the color stops. Default `'medium'`. */
33
+ intensity?: GlowIntensity;
34
+ /** Gradient shape. Default `'radial'`. */
35
+ shape?: GlowShape;
36
+ /** Subtle drifting animation. Default `false`. */
37
+ animated?: boolean;
38
+ /** Custom CSS background-blend-mode for the glow layer. Optional advanced tweak. */
39
+ blendMode?: 'normal' | 'multiply' | 'screen' | 'overlay' | 'soft-light' | 'hard-light' | 'color-dodge';
40
+ }
@@ -39,7 +39,7 @@ export declare class RightsFooterComponent {
39
39
  /**
40
40
  * Computed helper for align prop in template.
41
41
  */
42
- propsAlign: import("@angular/core").Signal<"center" | "left" | "right">;
42
+ propsAlign: import("@angular/core").Signal<"left" | "center" | "right">;
43
43
  /**
44
44
  * Computed helper for color prop in template.
45
45
  */
@@ -49,7 +49,7 @@ export declare class FeaturesListComponent {
49
49
  iconSize: number;
50
50
  mode: "horizontal" | "vertical";
51
51
  gap: "small" | "medium" | "large";
52
- alignment: "start" | "center";
52
+ alignment: "center" | "start";
53
53
  }>;
54
54
  /** Resolved icon color (handles Ionic colors and CSS colors) */
55
55
  iconColorStyle: import("@angular/core").Signal<string>;
@@ -57,7 +57,7 @@ export declare class ArticleComponent implements OnInit {
57
57
  linkConfig?: import("valtech-components").LinkProcessorConfig;
58
58
  allowPartialBold?: boolean;
59
59
  authorColor?: import("@ionic/core").Color;
60
- alignment?: "center" | "left" | "right";
60
+ alignment?: "left" | "center" | "right";
61
61
  showQuoteMark?: boolean;
62
62
  };
63
63
  getHighlightTextProps(element: ArticleElement): {
@@ -90,9 +90,9 @@ export declare class ArticleComponent implements OnInit {
90
90
  contentInterpolation?: Record<string, string | number>;
91
91
  icon?: import("valtech-components").IconMetada;
92
92
  shape?: "round";
93
- size?: "small" | "large" | "default";
93
+ size?: "default" | "small" | "large";
94
94
  fill?: "default" | "clear" | "outline" | "solid";
95
- type: "button" | "submit" | "reset";
95
+ type: "reset" | "submit" | "button";
96
96
  token?: string;
97
97
  ref?: any;
98
98
  handler?: (value: any) => any;
@@ -109,7 +109,7 @@ export interface BottomNavMetadata {
109
109
  safeArea?: boolean;
110
110
  /** Animation style */
111
111
  animation?: 'fade' | 'scale' | 'slide' | 'none';
112
- /** Cap del ancho de la barra. Token sm|md|lg|xl|full o valor CSS crudo. Default: 'xl' (1100px) — alinea con `--val-container-xl` del repo */
112
+ /** Cap del ancho de la barra. Token sm|md|lg|xl|full o valor CSS crudo. Default: 'md' (720px) — bottom-nav típicamente tiene pocos tabs y se ve mejor estrecho aunque el contenido use 'xl' */
113
113
  maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | 'full' | string;
114
114
  }
115
115
  /**
@@ -72,7 +72,7 @@ export declare class ToolbarComponent implements OnInit {
72
72
  };
73
73
  showFlags?: boolean;
74
74
  color: import("@ionic/core").Color;
75
- size?: "small" | "large" | "default";
75
+ size?: "default" | "small" | "large";
76
76
  fill?: "default" | "clear" | "outline" | "solid";
77
77
  shape?: "round";
78
78
  expand?: "full" | "block";
@@ -31,9 +31,19 @@ export declare const VALTECH_FOOTER_LOGO: {
31
31
  export interface CompanyLink {
32
32
  /** i18n key for the link text */
33
33
  key: string;
34
- /** URL path or external URL */
34
+ /** URL path (relative) or absolute URL */
35
35
  url: string;
36
- /** Whether the link opens in a new tab */
36
+ /**
37
+ * Hint for `LegalLinkService` about which app owns this link in a multi-app factory:
38
+ * - `'legal'` — canonical legal content (terms, privacy, …) — lives on main site
39
+ * - `'site'` — marketing/info pages (about, blog, …) — lives on main site
40
+ * - `'support'` — support/help — typically per-app (each product has own support)
41
+ *
42
+ * In satellite apps with `provideValtechLegal({ baseUrl })`, links with kind
43
+ * `'legal'` or `'site'` get rewritten to the main site URL.
44
+ */
45
+ kind?: 'legal' | 'site' | 'support';
46
+ /** Force opens in a new tab. Resolver may also set this when rewriting cross-origin. */
37
47
  external?: boolean;
38
48
  }
39
49
  /**
@@ -82,12 +92,22 @@ export declare const VALTECH_LANGUAGE_SELECTOR: {
82
92
  size: "default";
83
93
  };
84
94
  /**
85
- * Helper to build footer links from company links config
95
+ * Optional URL resolver applied per link (e.g. `LegalLinkService.resolve.bind(svc)`).
96
+ * Returns `{ url, external? }` to allow cross-origin rewrites.
97
+ */
98
+ export type CompanyLinkResolver = (link: CompanyLink) => {
99
+ url: string;
100
+ external?: boolean;
101
+ };
102
+ /**
103
+ * Helper to build footer links from company links config.
104
+ *
86
105
  * @param links - Array of company links
87
106
  * @param t - Translation function (key: string) => string
107
+ * @param resolver - Optional resolver — typically `(link) => ({ url: legalLink.resolve(link.url), external: legalLink.isExternal(link.url) && (link.kind === 'legal' || link.kind === 'site') })` to point cross-app legal/site links to the main site.
88
108
  * @returns Array of link objects ready for FooterLinksMetadata
89
109
  */
90
- export declare function buildFooterLinks(links: CompanyLink[], t: (key: string) => string): Array<{
110
+ export declare function buildFooterLinks(links: CompanyLink[], t: (key: string) => string, resolver?: CompanyLinkResolver): Array<{
91
111
  url: string;
92
112
  text: string;
93
113
  color: string;
@@ -0,0 +1,73 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { AuthService } from '../auth/auth.service';
3
+ import { DeviceInfo, ValtechAuthConfig } from '../auth/types';
4
+ import { MessagingService } from '../firebase/messaging.service';
5
+ import { NotificationPermission } from '../firebase/types';
6
+ import { PreferencesService } from '../preferences/preferences.service';
7
+ import { DeviceRegistrationStatus } from './types';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * DeviceRegistrationService — orquesta el flow combinado de:
11
+ * - `PreferencesService.notificationsMaster` (flag user)
12
+ * - `Notification.permission` del browser
13
+ * - `MessagingService` (FCM: requestPermission, getToken, deleteToken)
14
+ * - Backend `/v2/users/me/devices` (POST/GET/DELETE)
15
+ *
16
+ * Auto-sync:
17
+ * - master=true & permission=granted & sin token → auto-register (silent, sin prompt).
18
+ * - master=false & device registrado → auto-unregister (FCM deleteToken + DELETE backend).
19
+ * - permission=denied → status='error', requiere acción manual del user.
20
+ *
21
+ * Cliente:
22
+ * - `requestAndRegister()` para CTA "permitir notificaciones" (dispara browser prompt).
23
+ * - `unregister()` para "olvidar este dispositivo".
24
+ * - `refreshPermission()` tras volver al tab (focus) — el browser puede haber cambiado el estado.
25
+ */
26
+ export declare class DeviceRegistrationService {
27
+ private config;
28
+ private platformId;
29
+ private http;
30
+ private messaging;
31
+ private prefs;
32
+ private auth;
33
+ private readonly _permission;
34
+ private readonly _status;
35
+ private readonly _currentToken;
36
+ private readonly _currentDeviceId;
37
+ private readonly _lastError;
38
+ private readonly _isSupported;
39
+ readonly permission: import("@angular/core").Signal<NotificationPermission>;
40
+ readonly status: import("@angular/core").Signal<DeviceRegistrationStatus>;
41
+ readonly currentToken: import("@angular/core").Signal<string>;
42
+ readonly currentDeviceId: import("@angular/core").Signal<string>;
43
+ readonly lastError: import("@angular/core").Signal<string>;
44
+ readonly isSupported: import("@angular/core").Signal<boolean>;
45
+ /** true si el browser puede recibir push y el user ya autorizó */
46
+ readonly canReceive: import("@angular/core").Signal<boolean>;
47
+ private autoSyncInFlight;
48
+ constructor(config: ValtechAuthConfig, platformId: Object, http: HttpClient, messaging: MessagingService, prefs: PreferencesService, auth: AuthService);
49
+ /**
50
+ * CTA explícito del user: dispara `Notification.requestPermission()` + registro.
51
+ * Único método que puede generar el browser prompt.
52
+ */
53
+ requestAndRegister(): Promise<void>;
54
+ /**
55
+ * Unregister: borra token FCM + DELETE backend del device actual.
56
+ * Idempotente: si no hay device, no hace nada.
57
+ */
58
+ unregister(): Promise<void>;
59
+ /** Refresca `permission` desde `Notification.permission` del browser. */
60
+ refreshPermission(): void;
61
+ /** Lista devices del user actual desde backend. Útil para vista Seguridad. */
62
+ listDevices(): Promise<DeviceInfo[]>;
63
+ /** Reintenta el último flow fallido. */
64
+ retry(): Promise<void>;
65
+ /** Register sin prompt — asume permission ya granted. */
66
+ private registerSilent;
67
+ private registerDeviceBackend;
68
+ private detectSupport;
69
+ private detectEnv;
70
+ private errorMessage;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<DeviceRegistrationService, never>;
72
+ static ɵprov: i0.ɵɵInjectableDeclaration<DeviceRegistrationService>;
73
+ }
@@ -0,0 +1,2 @@
1
+ export * from './devices.service';
2
+ export * from './types';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Devices types específicos del `DeviceRegistrationService`.
3
+ * Los contratos base (`RegisterDeviceRequest`, `RegisterDeviceResponse`,
4
+ * `ListDevicesResponse`, `DeviceInfo`, `DevicePlatform`) viven en `auth/types.ts`
5
+ * — este archivo solo agrega lo que falta.
6
+ */
7
+ export type DeviceRegistrationStatus = 'idle' | 'registering' | 'registered' | 'unregistering' | 'error';
8
+ export interface DeleteDeviceResponse {
9
+ operationId: string;
10
+ deleted: boolean;
11
+ }
@@ -0,0 +1,59 @@
1
+ import { InjectionToken, Provider } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Config for cross-app legal/site link resolution.
5
+ *
6
+ * Used by satellite apps (showcase, sigify, admin-portal, …) to point their legal
7
+ * and site links (terms, privacy, about, contact, …) to the main marketing site,
8
+ * which owns the canonical legal content. The main site itself does NOT call
9
+ * `provideValtechLegal` — its links stay relative.
10
+ */
11
+ export interface ValtechLegalConfig {
12
+ /**
13
+ * Absolute base URL of the main site (no trailing slash).
14
+ * @example 'https://myvaltech.com'
15
+ */
16
+ baseUrl?: string;
17
+ /** Open resolved external links in a new tab. Defaults to `true` when `baseUrl` is set. */
18
+ openInNewTab?: boolean;
19
+ }
20
+ export declare const VALTECH_LEGAL_CONFIG: InjectionToken<ValtechLegalConfig>;
21
+ /**
22
+ * Resolves legal/site paths against a configurable main-site base URL.
23
+ *
24
+ * - **Main site mode**: no `provideValtechLegal` called → `resolve('/legal/terms')` returns `/legal/terms` (relative).
25
+ * - **Satellite mode**: `provideValtechLegal({ baseUrl: 'https://myvaltech.com' })` → `resolve('/legal/terms')` returns `'https://myvaltech.com/legal/terms'` and `isExternal('/legal/terms')` returns `true`.
26
+ *
27
+ * Absolute URLs passed in are returned unchanged (no double-prefix).
28
+ */
29
+ export declare class LegalLinkService {
30
+ private readonly config;
31
+ /** Effective base URL (null if running as main site). */
32
+ get baseUrl(): string | null;
33
+ /** Whether resolved external links should open in a new tab. */
34
+ get openInNewTab(): boolean;
35
+ /**
36
+ * Returns the URL to use for a given internal path. Absolute URLs pass through.
37
+ * @example
38
+ * resolve('/legal/terms') // main site: '/legal/terms'
39
+ * // satellite: 'https://myvaltech.com/legal/terms'
40
+ * resolve('https://x.com/y') // unchanged
41
+ */
42
+ resolve(path: string): string;
43
+ /** `true` if the path would be resolved to a cross-origin URL. */
44
+ isExternal(path: string): boolean;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<LegalLinkService, never>;
46
+ static ɵprov: i0.ɵɵInjectableDeclaration<LegalLinkService>;
47
+ }
48
+ /**
49
+ * Wires `LegalLinkService` for satellite apps. Omit in the main site (the one
50
+ * that hosts the canonical /legal/* routes) so links stay relative.
51
+ *
52
+ * @example
53
+ * // main.ts of showcase / sigify / etc.
54
+ * provideValtechLegal({
55
+ * baseUrl: 'https://myvaltech.com',
56
+ * openInNewTab: true,
57
+ * }),
58
+ */
59
+ export declare function provideValtechLegal(config: ValtechLegalConfig): 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.730";
5
+ export declare const VERSION = "2.0.732";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.730",
3
+ "version": "2.0.732",
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
@@ -3,6 +3,8 @@ export * from './lib/components/atoms/avatar/avatar.component';
3
3
  export * from './lib/components/atoms/avatar/types';
4
4
  export * from './lib/components/atoms/box/box.component';
5
5
  export * from './lib/components/atoms/box/types';
6
+ export * from './lib/components/atoms/glow/glow.component';
7
+ export * from './lib/components/atoms/glow/types';
6
8
  export * from './lib/components/atoms/container/container.component';
7
9
  export * from './lib/components/atoms/container/types';
8
10
  export * from './lib/components/atoms/button/button.component';
@@ -242,10 +244,12 @@ export * from './lib/services/meta';
242
244
  export * from './lib/services/markdown-article/markdown-article-parser';
243
245
  export * from './lib/services/markdown-article/markdown-article-parser.service';
244
246
  export * from './lib/services/markdown-article/legal-content.service';
247
+ export * from './lib/services/legal-link/legal-link.service';
245
248
  export * from './lib/services/firebase';
246
249
  export * from './lib/services/auth';
247
250
  export * from './lib/services/i18n';
248
251
  export * from './lib/services/preferences';
252
+ export * from './lib/services/devices';
249
253
  export * from './lib/services/app-config';
250
254
  export * from './lib/services/presets';
251
255
  export * from './lib/services/skeleton';