valtech-components 2.0.501 → 2.0.503

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.
@@ -12,17 +12,24 @@ export declare class LanguageSelectorComponent implements OnInit {
12
12
  * Emits the selected language code.
13
13
  */
14
14
  languageChange: EventEmitter<string>;
15
- /** Popover selector configuration */
15
+ /** Popover selector configuration (for default mode) */
16
16
  popoverProps: PopoverSelectorMetadata;
17
+ /** Unique ID for the icon mode popover trigger */
18
+ popoverId: string;
19
+ /** Available languages (exposed for icon mode template) */
20
+ availableLanguages: string[];
21
+ /** Current language (exposed for icon mode template) */
22
+ currentLanguage: string;
17
23
  private i18n;
18
24
  /** Default language display names */
19
- private readonly defaultLanguageNames;
25
+ readonly defaultLanguageNames: Record<string, string>;
20
26
  /** Default flag icons for languages */
21
- private readonly defaultLanguageFlags;
27
+ readonly defaultLanguageFlags: Record<string, string>;
22
28
  constructor();
23
29
  ngOnInit(): void;
24
30
  private initializePopoverProps;
25
- private getLanguageDisplayName;
31
+ /** Get display name for a language code (public for template access) */
32
+ getLanguageDisplayName(languageCode: string): string;
26
33
  /**
27
34
  * Handle language selection change.
28
35
  * @param selectedLanguage - The selected language code(s)
@@ -1,8 +1,16 @@
1
1
  import { Color } from '@ionic/core';
2
+ /**
3
+ * Display mode for the language selector.
4
+ * - 'default': Shows button with label and/or current language
5
+ * - 'icon': Compact mode showing only a globe icon (ideal for headers)
6
+ */
7
+ export type LanguageSelectorMode = 'default' | 'icon';
2
8
  /**
3
9
  * Props for val-language-selector component.
4
10
  * A specialized component for language selection.
5
11
  *
12
+ * @property mode - Display mode: 'default' or 'icon' (compact for headers).
13
+ * @property icon - Custom icon name for icon mode (default: 'globe-outline').
6
14
  * @property currentLanguage - Currently selected language code.
7
15
  * @property availableLanguages - Array of available language codes.
8
16
  * @property showLabel - Whether to show the label.
@@ -18,6 +26,18 @@ import { Color } from '@ionic/core';
18
26
  * @property customLanguageNames - Custom display names for languages.
19
27
  */
20
28
  export interface LanguageSelectorMetadata {
29
+ /**
30
+ * Display mode for the selector.
31
+ * - 'default': Full button with label/dropdown
32
+ * - 'icon': Compact globe icon only (ideal for headers/toolbars)
33
+ * @default 'default'
34
+ */
35
+ mode?: LanguageSelectorMode;
36
+ /**
37
+ * Icon name for icon mode.
38
+ * @default 'globe-outline'
39
+ */
40
+ icon?: string;
21
41
  /** Currently selected language code */
22
42
  currentLanguage?: string;
23
43
  /** Array of available language codes */
@@ -90,7 +90,7 @@ 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" | "default" | "large";
93
+ size?: "default" | "small" | "large";
94
94
  fill?: "default" | "clear" | "outline" | "solid";
95
95
  type: "button" | "submit" | "reset";
96
96
  token?: string;
@@ -37,9 +37,9 @@ export declare class AdsService implements OnDestroy {
37
37
  private router;
38
38
  private loaderService;
39
39
  private consentService;
40
+ private readonly authStateService;
40
41
  private readonly _isInitialized;
41
42
  private readonly _isEnabled;
42
- private readonly _isPremiumUser;
43
43
  private readonly _isDebugMode;
44
44
  private readonly _slots;
45
45
  private readonly _slotStates;
@@ -48,7 +48,7 @@ export declare class AdsService implements OnDestroy {
48
48
  readonly isInitialized: import("@angular/core").Signal<boolean>;
49
49
  /** Indica si los ads estan habilitados (consent + no premium) */
50
50
  readonly isEnabled: import("@angular/core").Signal<boolean>;
51
- /** Indica si el usuario es premium (no ve ads) */
51
+ /** Indica si el usuario es premium (no ve ads) - lee de AuthStateService */
52
52
  readonly isPremiumUser: import("@angular/core").Signal<boolean>;
53
53
  /** Indica si esta en modo debug */
54
54
  readonly isDebugMode: import("@angular/core").Signal<boolean>;
@@ -98,15 +98,9 @@ export declare class AdsService implements OnDestroy {
98
98
  * @returns Estado actual del slot
99
99
  */
100
100
  getSlotState(slotId: string): AdSlotState;
101
- /**
102
- * Actualiza el estado premium del usuario.
103
- * Llamar cuando cambie el estado de suscripcion.
104
- *
105
- * @param isPremium - Nuevo estado premium
106
- */
107
- updatePremiumStatus(isPremium: boolean): void;
108
101
  /**
109
102
  * Destruye todos los slots activos.
103
+ * Llamar cuando el usuario se vuelve premium o cambia de página.
110
104
  */
111
105
  destroyAllSlots(): void;
112
106
  private resolveSizes;
@@ -17,8 +17,6 @@ export interface ValtechAdsConfig {
17
17
  lazyLoad?: boolean;
18
18
  /** Configuracion de lazy loading */
19
19
  lazyLoadConfig?: LazyLoadConfig;
20
- /** Funcion para determinar si el usuario es premium (sin ads) */
21
- isPremiumUser?: () => boolean;
22
20
  /** Configuracion por defecto para ad slots */
23
21
  defaultSlotConfig?: Partial<AdSlotConfig>;
24
22
  /** Targeting global (aplica a todos los slots) */
@@ -23,6 +23,8 @@ export declare class AuthStateService {
23
23
  readonly permissions: import("@angular/core").Signal<string[]>;
24
24
  /** Usuario es super admin */
25
25
  readonly isSuperAdmin: import("@angular/core").Signal<boolean>;
26
+ /** Usuario tiene suscripción premium activa (no ve ads) */
27
+ readonly isPremium: import("@angular/core").Signal<boolean>;
26
28
  /** Error actual */
27
29
  readonly error: import("@angular/core").Signal<AuthError>;
28
30
  /** Información del usuario */
@@ -42,6 +44,7 @@ export declare class AuthStateService {
42
44
  roles: string[];
43
45
  permissions: string[];
44
46
  isSuperAdmin: boolean;
47
+ isPremium?: boolean;
45
48
  expiresAt: number;
46
49
  }): void;
47
50
  /**
@@ -41,6 +41,12 @@ export declare class TokenService {
41
41
  * @returns Email o null
42
42
  */
43
43
  getEmail(token: string): string | null;
44
+ /**
45
+ * Extrae el estado premium del token.
46
+ * @param token - Token JWT
47
+ * @returns true si el usuario es premium
48
+ */
49
+ isPremium(token: string): boolean;
44
50
  /**
45
51
  * Decodifica base64url a string.
46
52
  * Base64url usa - y _ en lugar de + y /
@@ -49,6 +49,8 @@ export interface AuthState {
49
49
  permissions: string[];
50
50
  /** Usuario es super admin */
51
51
  isSuperAdmin: boolean;
52
+ /** Usuario tiene suscripción premium activa (no ve ads) */
53
+ isPremium: boolean;
52
54
  /** Timestamp de expiración del accessToken (ms) */
53
55
  expiresAt: number | null;
54
56
  /** Error de autenticación (si existe) */
@@ -454,6 +456,8 @@ export interface JWTClaims {
454
456
  email: string;
455
457
  /** Session ID */
456
458
  sid?: string;
459
+ /** Usuario tiene suscripción premium activa */
460
+ premium?: boolean;
457
461
  /** Issued at */
458
462
  iat: number;
459
463
  /** Expiration */
@@ -468,6 +472,7 @@ export interface StoredAuthState {
468
472
  roles: string[];
469
473
  permissions: string[];
470
474
  isSuperAdmin: boolean;
475
+ isPremium?: boolean;
471
476
  expiresAt?: number;
472
477
  }
473
478
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.501",
3
+ "version": "2.0.503",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"