valtech-components 2.0.712 → 2.0.714

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 (54) hide show
  1. package/esm2022/lib/components/organisms/cards-carousel/cards-carousel.component.mjs +63 -16
  2. package/esm2022/lib/components/organisms/cards-carousel/types.mjs +1 -1
  3. package/esm2022/lib/components/templates/simple/simple.component.mjs +7 -9
  4. package/esm2022/lib/services/auth/auth.service.mjs +33 -17
  5. package/esm2022/lib/services/content/content-types/blog.mjs +275 -0
  6. package/esm2022/lib/services/content/content-types/documentation.mjs +303 -0
  7. package/esm2022/lib/services/content/content-types/news.mjs +277 -0
  8. package/esm2022/lib/services/content/index.mjs +51 -0
  9. package/esm2022/lib/services/content/transformer.mjs +265 -0
  10. package/esm2022/lib/services/content/types.mjs +41 -0
  11. package/esm2022/lib/services/firebase/firestore-collection.mjs +4 -5
  12. package/esm2022/lib/services/firebase/firestore.service.mjs +23 -9
  13. package/esm2022/lib/services/firebase/notifications.service.mjs +23 -18
  14. package/esm2022/lib/version.mjs +2 -2
  15. package/esm2022/public-api.mjs +2 -14
  16. package/fesm2022/valtech-components.mjs +9559 -10275
  17. package/fesm2022/valtech-components.mjs.map +1 -1
  18. package/lib/components/organisms/bottom-nav/bottom-nav.component.d.ts +1 -1
  19. package/lib/components/organisms/cards-carousel/cards-carousel.component.d.ts +12 -6
  20. package/lib/components/organisms/cards-carousel/types.d.ts +32 -3
  21. package/lib/services/content/content-types/blog.d.ts +148 -0
  22. package/lib/services/content/content-types/documentation.d.ts +183 -0
  23. package/lib/services/content/content-types/news.d.ts +162 -0
  24. package/lib/services/content/index.d.ts +49 -0
  25. package/lib/services/content/transformer.d.ts +96 -0
  26. package/lib/services/content/types.d.ts +220 -0
  27. package/lib/services/firebase/firestore-collection.d.ts +2 -2
  28. package/lib/services/firebase/firestore.service.d.ts +5 -0
  29. package/lib/services/firebase/notifications.service.d.ts +3 -2
  30. package/lib/version.d.ts +1 -1
  31. package/package.json +5 -5
  32. package/public-api.d.ts +1 -11
  33. package/esm2022/lib/components/molecules/participant-card/participant-card.component.mjs +0 -514
  34. package/esm2022/lib/components/molecules/participant-card/types.mjs +0 -21
  35. package/esm2022/lib/components/molecules/raffle-status-card/raffle-status-card.component.mjs +0 -476
  36. package/esm2022/lib/components/molecules/raffle-status-card/types.mjs +0 -23
  37. package/esm2022/lib/components/molecules/recap-card/recap-card.component.mjs +0 -78
  38. package/esm2022/lib/components/molecules/recap-card/types.mjs +0 -2
  39. package/esm2022/lib/components/molecules/ticket-grid/ticket-grid.component.mjs +0 -489
  40. package/esm2022/lib/components/molecules/ticket-grid/types.mjs +0 -11
  41. package/esm2022/lib/components/molecules/winner-display/types.mjs +0 -9
  42. package/esm2022/lib/components/molecules/winner-display/winner-display.component.mjs +0 -359
  43. package/esm2022/lib/components/templates/layout/layout.component.mjs +0 -19
  44. package/lib/components/molecules/participant-card/participant-card.component.d.ts +0 -34
  45. package/lib/components/molecules/participant-card/types.d.ts +0 -132
  46. package/lib/components/molecules/raffle-status-card/raffle-status-card.component.d.ts +0 -21
  47. package/lib/components/molecules/raffle-status-card/types.d.ts +0 -108
  48. package/lib/components/molecules/recap-card/recap-card.component.d.ts +0 -36
  49. package/lib/components/molecules/recap-card/types.d.ts +0 -30
  50. package/lib/components/molecules/ticket-grid/ticket-grid.component.d.ts +0 -40
  51. package/lib/components/molecules/ticket-grid/types.d.ts +0 -122
  52. package/lib/components/molecules/winner-display/types.d.ts +0 -103
  53. package/lib/components/molecules/winner-display/winner-display.component.d.ts +0 -36
  54. package/lib/components/templates/layout/layout.component.d.ts +0 -5
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Content Transformer
3
+ *
4
+ * Transforms ContentDocument instances into ArticleMetadata
5
+ * for rendering with the val-article component.
6
+ */
7
+ import { ArticleMetadata } from '../../components/organisms/article/types';
8
+ import { ContentDocument } from './types';
9
+ /**
10
+ * ContentTransformer converts ContentDocument objects into ArticleMetadata
11
+ * that can be rendered by the val-article component.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const doc: BlogPost = { ... };
16
+ * const article = ContentTransformer.toArticle(doc);
17
+ * // Use article with <val-article [props]="article">
18
+ * ```
19
+ */
20
+ export declare class ContentTransformer {
21
+ /**
22
+ * Transforms a ContentDocument into ArticleMetadata
23
+ *
24
+ * @param doc - The content document to transform
25
+ * @returns ArticleMetadata ready for val-article component
26
+ */
27
+ static toArticle(doc: ContentDocument): ArticleMetadata;
28
+ /**
29
+ * Adds header elements based on document type and metadata
30
+ */
31
+ private static addHeader;
32
+ /**
33
+ * Adds footer elements based on document type
34
+ */
35
+ private static addFooter;
36
+ /**
37
+ * Adds author information block
38
+ */
39
+ private static addAuthorBlock;
40
+ /**
41
+ * Transforms a single content block and adds it to the builder
42
+ */
43
+ private static addBlock;
44
+ /**
45
+ * Adds a heading block
46
+ */
47
+ private static addHeading;
48
+ /**
49
+ * Adds a paragraph block
50
+ */
51
+ private static addParagraph;
52
+ /**
53
+ * Adds a quote block
54
+ */
55
+ private static addQuote;
56
+ /**
57
+ * Adds a code block
58
+ */
59
+ private static addCode;
60
+ /**
61
+ * Adds a list block
62
+ */
63
+ private static addList;
64
+ /**
65
+ * Adds an image block
66
+ */
67
+ private static addImage;
68
+ /**
69
+ * Adds a callout/note block
70
+ */
71
+ private static addCallout;
72
+ /**
73
+ * Adds a divider/separator block
74
+ */
75
+ private static addDivider;
76
+ /**
77
+ * Adds a button block
78
+ */
79
+ private static addButton;
80
+ /**
81
+ * Adds a command/terminal block
82
+ */
83
+ private static addCommand;
84
+ }
85
+ /**
86
+ * Convenience function to transform a ContentDocument to ArticleMetadata
87
+ *
88
+ * @param doc - The content document to transform
89
+ * @returns ArticleMetadata ready for val-article component
90
+ *
91
+ * @example
92
+ * ```typescript
93
+ * const article = toArticle(myBlogPost);
94
+ * ```
95
+ */
96
+ export declare function toArticle(doc: ContentDocument): ArticleMetadata;
@@ -0,0 +1,220 @@
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;
@@ -99,8 +99,8 @@ export declare class TypedCollection<T extends FirestoreDocument> {
99
99
  */
100
100
  getFirst(options?: QueryOptions): Promise<T | null>;
101
101
  /**
102
- * Cuenta los documentos que coinciden con la query.
103
- * Nota: Esto carga todos los documentos, usar con cuidado en colecciones grandes.
102
+ * Cuenta los documentos que coinciden con la query (server-side aggregation).
103
+ * No descarga documentos usa getCountFromServer() de Firestore.
104
104
  */
105
105
  count(options?: QueryOptions): Promise<number>;
106
106
  /**
@@ -80,6 +80,11 @@ export declare class FirestoreService {
80
80
  * ```
81
81
  */
82
82
  getDocs<T extends FirestoreDocument>(collectionPath: string, options?: QueryOptions): Promise<T[]>;
83
+ /**
84
+ * Cuenta documentos usando aggregation query del servidor.
85
+ * No descarga los documentos — mucho más eficiente para conteos y badges.
86
+ */
87
+ countDocs(collectionPath: string, options?: QueryOptions): Promise<number>;
83
88
  /**
84
89
  * Obtiene documentos con paginación basada en cursores.
85
90
  *
@@ -54,6 +54,7 @@ export declare class NotificationsService {
54
54
  private collectionFactory;
55
55
  private collection;
56
56
  private currentUserId;
57
+ private collectionReady$;
57
58
  private authService;
58
59
  constructor(injector: Injector, collectionFactory: FirestoreCollectionFactory);
59
60
  /**
@@ -98,8 +99,8 @@ export declare class NotificationsService {
98
99
  */
99
100
  getUnread(limit?: number): Observable<NotificationDocument[]>;
100
101
  /**
101
- * Cuenta notificaciones no leídas (real-time, filtrado server-side).
102
- * Útil para badges en UI.
102
+ * Cuenta notificaciones no leídas usando server-side aggregation query.
103
+ * No descarga documentos — eficiente para badges en UI.
103
104
  */
104
105
  getUnreadCount(): Observable<number>;
105
106
  /**
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.712";
5
+ export declare const VERSION = "2.0.714";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.712",
3
+ "version": "2.0.714",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
@@ -19,10 +19,7 @@
19
19
  "@ionic/angular": "^8.0.0",
20
20
  "firebase": "^10.0.0",
21
21
  "ionicons": "^7.2.1",
22
- "prismjs": "^1.30.0",
23
- "qr-code-styling": "^1.9.0",
24
- "rxjs": "~7.8.0",
25
- "swiper": "^11.2.8"
22
+ "rxjs": "~7.8.0"
26
23
  },
27
24
  "peerDependenciesMeta": {
28
25
  "@capacitor/app": {
@@ -33,6 +30,9 @@
33
30
  "@capacitor/browser": "^6.0.3",
34
31
  "ng-otp-input": "^1.9.3",
35
32
  "ngx-image-cropper": "^9.0.0",
33
+ "prismjs": "^1.30.0",
34
+ "qr-code-styling": "^1.9.0",
35
+ "swiper": "^11.2.8",
36
36
  "tslib": "^2.3.0"
37
37
  },
38
38
  "sideEffects": false,
package/public-api.d.ts CHANGED
@@ -137,22 +137,12 @@ export * from './lib/components/molecules/date-range-input/date-range-input.comp
137
137
  export * from './lib/components/molecules/date-range-input/types';
138
138
  export * from './lib/components/molecules/number-stepper/number-stepper.component';
139
139
  export * from './lib/components/molecules/number-stepper/types';
140
- export * from './lib/components/molecules/ticket-grid/ticket-grid.component';
141
- export * from './lib/components/molecules/ticket-grid/types';
142
140
  export * from './lib/components/molecules/share-buttons/share-buttons.component';
143
141
  export * from './lib/components/molecules/share-buttons/types';
144
- export * from './lib/components/molecules/winner-display/winner-display.component';
145
- export * from './lib/components/molecules/winner-display/types';
146
- export * from './lib/components/molecules/raffle-status-card/raffle-status-card.component';
147
- export * from './lib/components/molecules/raffle-status-card/types';
148
- export * from './lib/components/molecules/participant-card/participant-card.component';
149
- export * from './lib/components/molecules/participant-card/types';
150
142
  export * from './lib/components/molecules/glow-card/glow-card.component';
151
143
  export * from './lib/components/molecules/glow-card/types';
152
144
  export * from './lib/components/molecules/swipe-carousel/swipe-carousel.component';
153
145
  export * from './lib/components/molecules/swipe-carousel/types';
154
- export * from './lib/components/molecules/recap-card/recap-card.component';
155
- export * from './lib/components/molecules/recap-card/types';
156
146
  export * from './lib/components/molecules/testimonial-card/testimonial-card.component';
157
147
  export * from './lib/components/molecules/testimonial-card/types';
158
148
  export * from './lib/components/molecules/features-list/features-list.component';
@@ -218,7 +208,6 @@ export * from './lib/components/organisms/bottom-nav/bottom-nav.component';
218
208
  export * from './lib/components/organisms/bottom-nav/types';
219
209
  export * from './lib/components/organisms/avatar-upload/avatar-upload.component';
220
210
  export * from './lib/components/organisms/avatar-upload/types';
221
- export * from './lib/components/templates/layout/layout.component';
222
211
  export * from './lib/components/templates/simple/simple.component';
223
212
  export * from './lib/components/templates/simple/types';
224
213
  export * from './lib/components/templates/page-template/page-template.component';
@@ -258,6 +247,7 @@ export * from './lib/services/pagination';
258
247
  export * from './lib/services/image';
259
248
  export * from './lib/services/ads';
260
249
  export * from './lib/components/molecules/ad-slot/ad-slot.component';
250
+ export * from './lib/services/content';
261
251
  export * from './lib/services/feedback';
262
252
  export * from './lib/components/molecules/feedback-form/feedback-form.component';
263
253
  export * from './lib/components/molecules/feedback-form/types';