valtech-components 2.0.437 → 2.0.438

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.
@@ -1581,7 +1581,13 @@ class LinkProcessorService {
1581
1581
  let processedText = text;
1582
1582
  // 1. Procesar enlaces estilo Markdown [texto](url) primero
1583
1583
  if (processMarkdownLinks) {
1584
- const markdownMatches = Array.from(processedText.matchAll(this.markdownLinkRegex));
1584
+ // Usar exec en bucle (compatible con ES2018)
1585
+ const markdownMatches = [];
1586
+ this.markdownLinkRegex.lastIndex = 0;
1587
+ let mdMatch;
1588
+ while ((mdMatch = this.markdownLinkRegex.exec(processedText)) !== null) {
1589
+ markdownMatches.push(mdMatch);
1590
+ }
1585
1591
  // Procesar de atrás hacia adelante para mantener las posiciones
1586
1592
  for (let i = markdownMatches.length - 1; i >= 0; i--) {
1587
1593
  const match = markdownMatches[i];
@@ -1603,7 +1609,13 @@ class LinkProcessorService {
1603
1609
  }
1604
1610
  }
1605
1611
  // 2. Procesar URLs externas directas
1606
- const urlMatches = Array.from(processedText.matchAll(this.urlRegex));
1612
+ // Usar exec en bucle (compatible con ES2018)
1613
+ const urlMatches = [];
1614
+ this.urlRegex.lastIndex = 0;
1615
+ let urlMatch;
1616
+ while ((urlMatch = this.urlRegex.exec(processedText)) !== null) {
1617
+ urlMatches.push(urlMatch);
1618
+ }
1607
1619
  // Procesar de atrás hacia adelante para mantener las posiciones
1608
1620
  for (let i = urlMatches.length - 1; i >= 0; i--) {
1609
1621
  const match = urlMatches[i];
@@ -1632,7 +1644,13 @@ class LinkProcessorService {
1632
1644
  processedText.substring(0, startIndex) + replacement + processedText.substring(endIndex);
1633
1645
  }
1634
1646
  // 3. Procesar rutas internas
1635
- const internalMatches = Array.from(processedText.matchAll(this.internalRouteRegex));
1647
+ // Usar exec en bucle (compatible con ES2018)
1648
+ const internalMatches = [];
1649
+ this.internalRouteRegex.lastIndex = 0;
1650
+ let internalMatch;
1651
+ while ((internalMatch = this.internalRouteRegex.exec(processedText)) !== null) {
1652
+ internalMatches.push(internalMatch);
1653
+ }
1636
1654
  // Procesar de atrás hacia adelante para mantener las posiciones
1637
1655
  for (let i = internalMatches.length - 1; i >= 0; i--) {
1638
1656
  const match = internalMatches[i];
@@ -21108,6 +21126,7 @@ function hasEmulators(config) {
21108
21126
  * Los secrets (apiKey, appId) se inyectan en build time via environment.
21109
21127
  */
21110
21128
  const APP_IDS = {
21129
+ DEMO: 'demo',
21111
21130
  SHOWCASE: 'showcase',
21112
21131
  ADMIN_PORTAL: 'admin-portal',
21113
21132
  APP: 'app',
@@ -21161,27 +21180,34 @@ const storagePaths = {
21161
21180
  public: (...paths) => `public/${paths.join('/')}`,
21162
21181
  },
21163
21182
  /** Carpetas de desarrollo (acceso libre en emuladores) */
21164
- demo: (...paths) => `demo-uploads/${paths.join('/')}`,
21183
+ demo: (...paths) => `demo/${paths.join('/')}`,
21165
21184
  };
21166
21185
  // ============================================================================
21167
21186
  // FIRESTORE COLLECTION BUILDERS
21168
21187
  // ============================================================================
21169
21188
  /**
21170
- * Genera nombres de colecciones con namespace por app.
21189
+ * Genera paths de colecciones con namespace por app.
21190
+ *
21191
+ * IMPORTANTE: La estructura es /apps/{appId}/{collection}/{docId}
21192
+ * Firestore requiere número impar de segmentos para paths de colección.
21171
21193
  *
21172
21194
  * @example
21173
21195
  * // Colección específica de la app
21174
21196
  * collections.forApp('showcase', 'items')
21175
- * // => 'showcase-items'
21197
+ * // => 'apps/showcase/items'
21198
+ *
21199
+ * // Colección de desarrollo
21200
+ * collections.forApp('demo', 'items')
21201
+ * // => 'apps/demo/items'
21176
21202
  *
21177
21203
  * // Colección compartida
21178
21204
  * collections.shared.users
21179
21205
  * // => 'users'
21180
21206
  */
21181
21207
  const collections = {
21182
- /** Colección específica de la app: {appId}-{collection} */
21183
- forApp: (appId, collectionName) => `${appId}-${collectionName}`,
21184
- /** Colecciones compartidas (sin namespace) */
21208
+ /** Colección específica de la app: apps/{appId}/{collection} */
21209
+ forApp: (appId, collectionName) => `apps/${appId}/${collectionName}`,
21210
+ /** Colecciones compartidas (sin namespace, nivel raíz) */
21185
21211
  shared: {
21186
21212
  /** Usuarios del sistema */
21187
21213
  users: 'users',
@@ -21190,8 +21216,6 @@ const collections = {
21190
21216
  /** Notificaciones de usuarios */
21191
21217
  notifications: 'notifications',
21192
21218
  },
21193
- /** Colecciones de desarrollo (acceso libre en emuladores) */
21194
- demo: (collectionName) => `demo-${collectionName}`,
21195
21219
  };
21196
21220
  /**
21197
21221
  * Crea la configuración completa de Firebase desde variables de entorno.
@@ -24478,6 +24502,29 @@ class AuthService {
24478
24502
  .post(`${this.baseUrl}/signup`, request)
24479
24503
  .pipe(catchError((error) => this.handleAuthError(error)));
24480
24504
  }
24505
+ /**
24506
+ * Verifica email con código de 6 dígitos.
24507
+ * Si es exitoso, hace auto-login y retorna tokens.
24508
+ */
24509
+ verifyEmail(request) {
24510
+ this.stateService.clearError();
24511
+ return this.http
24512
+ .post(`${this.baseUrl}/verify-email`, request)
24513
+ .pipe(tap((response) => {
24514
+ if (response.verified && response.accessToken) {
24515
+ // Auto-login: guardar tokens y actualizar estado
24516
+ this.handleSuccessfulAuth(response);
24517
+ }
24518
+ }), catchError((error) => this.handleAuthError(error)));
24519
+ }
24520
+ /**
24521
+ * Reenvía código de verificación al email.
24522
+ */
24523
+ resendCode(request) {
24524
+ return this.http
24525
+ .post(`${this.baseUrl}/resend-code`, request)
24526
+ .pipe(catchError((error) => this.handleAuthError(error)));
24527
+ }
24481
24528
  /**
24482
24529
  * Verifica código MFA.
24483
24530
  */