valtech-components 2.0.445 → 2.0.446

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 (50) hide show
  1. package/esm2022/public-api.mjs +9 -6
  2. package/fesm2022/valtech-components.mjs +5 -3237
  3. package/fesm2022/valtech-components.mjs.map +1 -1
  4. package/lib/components/organisms/article/article.component.d.ts +5 -5
  5. package/package.json +1 -1
  6. package/public-api.d.ts +0 -5
  7. package/esm2022/lib/components/molecules/feedback-form/feedback-form.component.mjs +0 -352
  8. package/esm2022/lib/components/molecules/feedback-form/types.mjs +0 -2
  9. package/esm2022/lib/services/auth/auth-state.service.mjs +0 -173
  10. package/esm2022/lib/services/auth/auth.service.mjs +0 -454
  11. package/esm2022/lib/services/auth/config.mjs +0 -76
  12. package/esm2022/lib/services/auth/guards.mjs +0 -194
  13. package/esm2022/lib/services/auth/index.mjs +0 -70
  14. package/esm2022/lib/services/auth/interceptor.mjs +0 -98
  15. package/esm2022/lib/services/auth/storage.service.mjs +0 -138
  16. package/esm2022/lib/services/auth/sync.service.mjs +0 -146
  17. package/esm2022/lib/services/auth/token.service.mjs +0 -113
  18. package/esm2022/lib/services/auth/types.mjs +0 -29
  19. package/esm2022/lib/services/content/content-types/blog.mjs +0 -275
  20. package/esm2022/lib/services/content/content-types/documentation.mjs +0 -303
  21. package/esm2022/lib/services/content/content-types/news.mjs +0 -277
  22. package/esm2022/lib/services/content/index.mjs +0 -51
  23. package/esm2022/lib/services/content/transformer.mjs +0 -265
  24. package/esm2022/lib/services/content/types.mjs +0 -41
  25. package/esm2022/lib/services/feedback/config.mjs +0 -49
  26. package/esm2022/lib/services/feedback/feedback.service.mjs +0 -174
  27. package/esm2022/lib/services/feedback/index.mjs +0 -44
  28. package/esm2022/lib/services/feedback/types.mjs +0 -30
  29. package/lib/components/molecules/feedback-form/feedback-form.component.d.ts +0 -56
  30. package/lib/components/molecules/feedback-form/types.d.ts +0 -54
  31. package/lib/services/auth/auth-state.service.d.ts +0 -85
  32. package/lib/services/auth/auth.service.d.ts +0 -146
  33. package/lib/services/auth/config.d.ts +0 -38
  34. package/lib/services/auth/guards.d.ts +0 -123
  35. package/lib/services/auth/index.d.ts +0 -63
  36. package/lib/services/auth/interceptor.d.ts +0 -22
  37. package/lib/services/auth/storage.service.d.ts +0 -48
  38. package/lib/services/auth/sync.service.d.ts +0 -49
  39. package/lib/services/auth/token.service.d.ts +0 -51
  40. package/lib/services/auth/types.d.ts +0 -315
  41. package/lib/services/content/content-types/blog.d.ts +0 -148
  42. package/lib/services/content/content-types/documentation.d.ts +0 -183
  43. package/lib/services/content/content-types/news.d.ts +0 -162
  44. package/lib/services/content/index.d.ts +0 -49
  45. package/lib/services/content/transformer.d.ts +0 -96
  46. package/lib/services/content/types.d.ts +0 -220
  47. package/lib/services/feedback/config.d.ts +0 -35
  48. package/lib/services/feedback/feedback.service.d.ts +0 -76
  49. package/lib/services/feedback/index.d.ts +0 -40
  50. package/lib/services/feedback/types.d.ts +0 -107
@@ -1,220 +0,0 @@
1
- /**
2
- * Content Types System
3
- *
4
- * This module provides a content abstraction layer that transforms
5
- * structured content documents (blog posts, documentation, news articles)
6
- * into ArticleMetadata for rendering with val-article component.
7
- */
8
- /**
9
- * Author information for content documents
10
- */
11
- export interface ContentAuthor {
12
- /** Author's display name */
13
- name: string;
14
- /** URL to author's avatar image */
15
- avatar?: string;
16
- /** Author's role or title */
17
- role?: string;
18
- /** Link to author's profile */
19
- profileUrl?: string;
20
- }
21
- /**
22
- * Common metadata for all content documents
23
- */
24
- export interface ContentMeta {
25
- /** Unique identifier */
26
- id?: string;
27
- /** URL-friendly slug */
28
- slug?: string;
29
- /** Creation date */
30
- createdAt?: Date | string;
31
- /** Last update date */
32
- updatedAt?: Date | string;
33
- /** Publication date */
34
- publishedAt?: Date | string;
35
- /** Content author */
36
- author?: ContentAuthor;
37
- /** Tags for categorization */
38
- tags?: string[];
39
- /** Primary category */
40
- category?: string;
41
- /** Content locale (e.g., 'es', 'en') */
42
- locale?: string;
43
- }
44
- /**
45
- * Heading block - renders as title or subtitle
46
- */
47
- export interface HeadingBlock {
48
- type: 'heading';
49
- /** Heading level: 1 = title, 2-3 = subtitle */
50
- level: 1 | 2 | 3;
51
- /** Heading text */
52
- text: string;
53
- }
54
- /**
55
- * Paragraph block - renders as text
56
- */
57
- export interface ParagraphBlock {
58
- type: 'paragraph';
59
- /** Paragraph text content */
60
- text: string;
61
- /** Apply emphasis styling */
62
- emphasis?: boolean;
63
- }
64
- /**
65
- * Quote block - renders as blockquote
66
- */
67
- export interface QuoteBlock {
68
- type: 'quote';
69
- /** Quote text */
70
- text: string;
71
- /** Quote author name */
72
- author?: string;
73
- /** Quote source */
74
- source?: string;
75
- }
76
- /**
77
- * Code block - renders as syntax-highlighted code
78
- */
79
- export interface CodeBlock {
80
- type: 'code';
81
- /** Code content */
82
- code: string;
83
- /** Programming language for syntax highlighting */
84
- language?: string;
85
- /** Code block title/filename */
86
- title?: string;
87
- }
88
- /**
89
- * List block - renders as ordered, unordered, or checklist
90
- */
91
- export interface ListBlock {
92
- type: 'list';
93
- /** List items (simple strings) */
94
- items: string[];
95
- /** Render as numbered list */
96
- ordered?: boolean;
97
- /** Render as checklist with checkmarks */
98
- checklist?: boolean;
99
- }
100
- /**
101
- * Image block - renders as image with optional caption
102
- */
103
- export interface ImageBlock {
104
- type: 'image';
105
- /** Image source URL */
106
- src: string;
107
- /** Alt text for accessibility */
108
- alt: string;
109
- /** Image caption */
110
- caption?: string;
111
- /** Image alignment */
112
- alignment?: 'left' | 'center' | 'right';
113
- }
114
- /**
115
- * Callout block - renders as highlighted note/warning
116
- */
117
- export interface CalloutBlock {
118
- type: 'callout';
119
- /** Callout text content */
120
- text: string;
121
- /** Callout variant determines styling */
122
- variant: 'info' | 'warning' | 'success' | 'error';
123
- /** Optional title/prefix */
124
- title?: string;
125
- }
126
- /**
127
- * Divider block - renders as separator line
128
- */
129
- export interface DividerBlock {
130
- type: 'divider';
131
- /** Divider style */
132
- style?: 'line' | 'dots' | 'space';
133
- }
134
- /**
135
- * Button block - renders as call-to-action button
136
- */
137
- export interface ButtonBlock {
138
- type: 'button';
139
- /** Button text */
140
- text: string;
141
- /** Link URL (for navigation) */
142
- href?: string;
143
- /** Action identifier (for event handling) */
144
- action?: string;
145
- /** Button color */
146
- color?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
147
- /** Button alignment */
148
- alignment?: 'left' | 'center' | 'right';
149
- }
150
- /**
151
- * Command block - renders as terminal/CLI command
152
- */
153
- export interface CommandBlock {
154
- type: 'command';
155
- /** Command to display */
156
- command: string;
157
- /** Show copy button */
158
- copyable?: boolean;
159
- }
160
- /**
161
- * Union type of all content blocks
162
- */
163
- export type ContentBlock = HeadingBlock | ParagraphBlock | QuoteBlock | CodeBlock | ListBlock | ImageBlock | CalloutBlock | DividerBlock | ButtonBlock | CommandBlock;
164
- /**
165
- * Configuration options for content rendering
166
- */
167
- export interface ContentConfig {
168
- /** Article theme */
169
- theme?: 'light' | 'dark' | 'auto';
170
- /** Maximum width of the content container */
171
- maxWidth?: string;
172
- /** Show metadata (author, date, etc.) */
173
- showMeta?: boolean;
174
- /** Show table of contents */
175
- showTableOfContents?: boolean;
176
- /** Center the content container */
177
- centered?: boolean;
178
- }
179
- /**
180
- * Base interface for all content documents.
181
- * Generic type T represents the document type discriminator.
182
- *
183
- * @example
184
- * ```typescript
185
- * interface BlogPost extends ContentDocument<'blog'> {
186
- * title: string;
187
- * excerpt: string;
188
- * }
189
- * ```
190
- */
191
- export interface ContentDocument<T extends string = string> {
192
- /** Document type discriminator */
193
- type: T;
194
- /** Document metadata */
195
- meta: ContentMeta;
196
- /** Array of content blocks */
197
- content: ContentBlock[];
198
- /** Rendering configuration */
199
- config?: ContentConfig;
200
- }
201
- /**
202
- * Type guard to check if a block is a heading
203
- */
204
- export declare function isHeadingBlock(block: ContentBlock): block is HeadingBlock;
205
- /**
206
- * Type guard to check if a block is a paragraph
207
- */
208
- export declare function isParagraphBlock(block: ContentBlock): block is ParagraphBlock;
209
- /**
210
- * Type guard to check if a block is a code block
211
- */
212
- export declare function isCodeBlock(block: ContentBlock): block is CodeBlock;
213
- /**
214
- * Type guard to check if a block is a list
215
- */
216
- export declare function isListBlock(block: ContentBlock): block is ListBlock;
217
- /**
218
- * Type guard to check if a block is a callout
219
- */
220
- export declare function isCalloutBlock(block: ContentBlock): block is CalloutBlock;
@@ -1,35 +0,0 @@
1
- import { EnvironmentProviders, InjectionToken } from '@angular/core';
2
- import { ValtechFeedbackConfig } from './types';
3
- /**
4
- * Token de inyección para la configuración de Feedback.
5
- */
6
- export declare const VALTECH_FEEDBACK_CONFIG: InjectionToken<ValtechFeedbackConfig>;
7
- /**
8
- * Configuración por defecto.
9
- */
10
- export declare const DEFAULT_FEEDBACK_CONFIG: Partial<ValtechFeedbackConfig>;
11
- /**
12
- * Provee el servicio de feedback a la aplicación Angular.
13
- *
14
- * @param config - Configuración de feedback
15
- * @returns EnvironmentProviders para usar en bootstrapApplication
16
- *
17
- * @example
18
- * ```typescript
19
- * // main.ts
20
- * import { bootstrapApplication } from '@angular/platform-browser';
21
- * import { provideValtechFeedback } from 'valtech-components';
22
- * import { environment } from './environments/environment';
23
- *
24
- * bootstrapApplication(AppComponent, {
25
- * providers: [
26
- * provideValtechAuth({ apiUrl: environment.apiUrl }),
27
- * provideValtechFeedback({
28
- * apiUrl: environment.apiUrl,
29
- * appId: 'my-app-name',
30
- * }),
31
- * ],
32
- * });
33
- * ```
34
- */
35
- export declare function provideValtechFeedback(config: ValtechFeedbackConfig): EnvironmentProviders;
@@ -1,76 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { CreateFeedbackResponse, GetFeedbackResponse, DeviceContext, FeedbackType, ContentRef } from './types';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * Servicio para gestionar feedback de usuarios.
6
- *
7
- * @example
8
- * ```typescript
9
- * @Component({...})
10
- * export class MyComponent {
11
- * private feedbackService = inject(FeedbackService);
12
- *
13
- * async submitFeedback() {
14
- * const response = await this.feedbackService.createAsync(
15
- * 'feedback',
16
- * 'Mi comentario',
17
- * 'Descripción detallada...'
18
- * );
19
- * console.log('Feedback enviado:', response.feedbackId);
20
- * }
21
- * }
22
- * ```
23
- */
24
- export declare class FeedbackService {
25
- private config;
26
- private http;
27
- /**
28
- * URL base para endpoints de feedback.
29
- */
30
- private get baseUrl();
31
- /**
32
- * Captura el contexto del dispositivo automáticamente.
33
- */
34
- captureDeviceContext(): DeviceContext;
35
- /**
36
- * Crea un nuevo feedback.
37
- *
38
- * @param type - Tipo de feedback
39
- * @param title - Título del feedback
40
- * @param description - Descripción detallada
41
- * @param attachments - URLs de archivos adjuntos (opcional)
42
- * @param contentRef - Referencia a contenido específico (opcional)
43
- * @returns Observable con la respuesta
44
- */
45
- create(type: FeedbackType, title: string, description: string, attachments?: string[], contentRef?: ContentRef): Observable<CreateFeedbackResponse>;
46
- /**
47
- * Crea un nuevo feedback (versión async/await).
48
- */
49
- createAsync(type: FeedbackType, title: string, description: string, attachments?: string[], contentRef?: ContentRef): Promise<CreateFeedbackResponse>;
50
- /**
51
- * Obtiene un feedback por ID (solo el propietario).
52
- *
53
- * @param feedbackId - ID del feedback
54
- * @returns Observable con la respuesta
55
- */
56
- getById(feedbackId: string): Observable<GetFeedbackResponse>;
57
- /**
58
- * Obtiene un feedback por ID (versión async/await).
59
- */
60
- getByIdAsync(feedbackId: string): Promise<GetFeedbackResponse>;
61
- /**
62
- * Valida si un archivo cumple con las restricciones.
63
- */
64
- validateFile(file: File): {
65
- valid: boolean;
66
- error?: string;
67
- };
68
- /**
69
- * Obtiene la configuración actual del servicio.
70
- */
71
- getConfig(): Readonly<typeof this.config>;
72
- private detectBrowser;
73
- private detectOS;
74
- static ɵfac: i0.ɵɵFactoryDeclaration<FeedbackService, never>;
75
- static ɵprov: i0.ɵɵInjectableDeclaration<FeedbackService>;
76
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * Valtech Feedback Service
3
- *
4
- * Servicio para gestionar feedback de usuarios a nivel de plataforma.
5
- *
6
- * @example
7
- * ```typescript
8
- * // main.ts - Configuración
9
- * import { provideValtechFeedback } from 'valtech-components';
10
- *
11
- * bootstrapApplication(AppComponent, {
12
- * providers: [
13
- * provideValtechAuth({ apiUrl: environment.apiUrl }),
14
- * provideValtechFeedback({
15
- * apiUrl: environment.apiUrl,
16
- * appId: 'my-app-name',
17
- * }),
18
- * ],
19
- * });
20
- *
21
- * // component.ts - Uso
22
- * import { FeedbackService } from 'valtech-components';
23
- *
24
- * @Component({...})
25
- * export class MyComponent {
26
- * private feedbackService = inject(FeedbackService);
27
- *
28
- * async submitFeedback() {
29
- * const response = await this.feedbackService.createAsync(
30
- * 'feedback',
31
- * 'Título',
32
- * 'Descripción...'
33
- * );
34
- * }
35
- * }
36
- * ```
37
- */
38
- export { VALTECH_FEEDBACK_CONFIG, provideValtechFeedback, DEFAULT_FEEDBACK_CONFIG } from './config';
39
- export { FeedbackService } from './feedback.service';
40
- export { ValtechFeedbackConfig, FeedbackType, FeedbackStatus, ContentType, ContentRef, DeviceContext, Feedback, CreateFeedbackRequest, CreateFeedbackResponse, GetFeedbackResponse, FeedbackTypeOption, DEFAULT_FEEDBACK_TYPE_OPTIONS, } from './types';
@@ -1,107 +0,0 @@
1
- /**
2
- * Configuración del servicio de Feedback.
3
- */
4
- export interface ValtechFeedbackConfig {
5
- /** URL base de la API */
6
- apiUrl: string;
7
- /** ID de la aplicación (ej: 'my-valtech-app') */
8
- appId: string;
9
- /** Prefijo para endpoints (default: '/v1/feedback') */
10
- feedbackPrefix?: string;
11
- /** Número máximo de adjuntos (default: 5) */
12
- maxAttachments?: number;
13
- /** Tamaño máximo por archivo en bytes (default: 10MB) */
14
- maxFileSize?: number;
15
- /** Tipos de archivo permitidos (default: ['image/*', 'video/*', 'application/pdf']) */
16
- allowedFileTypes?: string[];
17
- /** Ruta en Firebase Storage para adjuntos (default: 'feedback') */
18
- storagePath?: string;
19
- }
20
- /**
21
- * Tipos de feedback disponibles.
22
- */
23
- export type FeedbackType = 'issue' | 'poor-content' | 'feedback' | 'suggestion';
24
- /**
25
- * Estado de un feedback.
26
- */
27
- export type FeedbackStatus = 'new' | 'reviewed' | 'resolved';
28
- /**
29
- * Tipos de contenido para referencia.
30
- */
31
- export type ContentType = 'article' | 'faq' | 'news' | 'page' | 'product' | 'event' | 'other';
32
- /**
33
- * Referencia a contenido específico.
34
- */
35
- export interface ContentRef {
36
- contentId: string;
37
- contentType: ContentType;
38
- }
39
- /**
40
- * Contexto del dispositivo del usuario.
41
- */
42
- export interface DeviceContext {
43
- browser: string;
44
- os: string;
45
- viewport: string;
46
- language: string;
47
- userAgent: string;
48
- pageUrl: string;
49
- }
50
- /**
51
- * Entrada de feedback completa.
52
- */
53
- export interface Feedback {
54
- feedbackId: string;
55
- appId: string;
56
- userId: string;
57
- type: FeedbackType;
58
- title: string;
59
- description: string;
60
- attachments: string[];
61
- contentRef?: ContentRef;
62
- deviceContext: DeviceContext;
63
- status: FeedbackStatus;
64
- createdAt: string;
65
- updatedAt: string;
66
- }
67
- /**
68
- * Request para crear feedback.
69
- */
70
- export interface CreateFeedbackRequest {
71
- type: FeedbackType;
72
- title: string;
73
- description: string;
74
- attachments?: string[];
75
- contentRef?: ContentRef;
76
- deviceContext: DeviceContext;
77
- appId: string;
78
- }
79
- /**
80
- * Response al crear feedback.
81
- */
82
- export interface CreateFeedbackResponse {
83
- operationId: string;
84
- feedbackId: string;
85
- status: FeedbackStatus;
86
- createdAt: string;
87
- }
88
- /**
89
- * Response al obtener feedback.
90
- */
91
- export interface GetFeedbackResponse {
92
- operationId: string;
93
- feedback: Feedback;
94
- }
95
- /**
96
- * Opciones de tipo de feedback para UI.
97
- */
98
- export interface FeedbackTypeOption {
99
- value: FeedbackType;
100
- label: string;
101
- description?: string;
102
- icon?: string;
103
- }
104
- /**
105
- * Configuración por defecto de tipos de feedback.
106
- */
107
- export declare const DEFAULT_FEEDBACK_TYPE_OPTIONS: FeedbackTypeOption[];