@xosue-utils/services 0.1.0

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 (30) hide show
  1. package/README.md +70 -0
  2. package/config/services-config.d.ts +46 -0
  3. package/fesm2022/xosue-utils-services.mjs +1657 -0
  4. package/fesm2022/xosue-utils-services.mjs.map +1 -0
  5. package/index.d.ts +5 -0
  6. package/lib/ai-autofill-overlay-service/ai-autofill-overlay-service.component.d.ts +13 -0
  7. package/lib/ai-autofill-overlay-service/ai-autofill-overlay.service.d.ts +19 -0
  8. package/lib/alert-service/alert-service.component.d.ts +17 -0
  9. package/lib/alert-service/alert.service.d.ts +25 -0
  10. package/lib/browser-notification/browser-notification.service.d.ts +42 -0
  11. package/lib/context-menu-service/context-menu-service.component.d.ts +37 -0
  12. package/lib/context-menu-service/context-menu.service.d.ts +63 -0
  13. package/lib/field-help-tooltip/field-help-tooltip.component.d.ts +9 -0
  14. package/lib/global-loading-service/global-loading-service.component.d.ts +14 -0
  15. package/lib/global-loading-service/global-loading.service.d.ts +22 -0
  16. package/lib/index.d.ts +29 -0
  17. package/lib/media-viewer-service/items/audio-player/audio-player.component.d.ts +14 -0
  18. package/lib/media-viewer-service/items/image-viewer/image-viewer.component.d.ts +19 -0
  19. package/lib/media-viewer-service/items/video-player/video-player.component.d.ts +18 -0
  20. package/lib/media-viewer-service/media-viewer-service.component.d.ts +62 -0
  21. package/lib/media-viewer-service/media-viewer.service.d.ts +34 -0
  22. package/lib/navigation-loading/navigation-loading-service.component.d.ts +9 -0
  23. package/lib/navigation-loading/navigation-loading.service.d.ts +24 -0
  24. package/lib/session-request-service/session-request-service.component.d.ts +15 -0
  25. package/lib/session-request-service/session-request.service.d.ts +21 -0
  26. package/lib/toast-service/toast-service.component.d.ts +16 -0
  27. package/lib/toast-service/toast.service.d.ts +22 -0
  28. package/package.json +47 -0
  29. package/public-api.d.ts +4 -0
  30. package/vendor/lucide-icon/lucide-icon.component.d.ts +26 -0
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # @xosue-utils/services
2
+
3
+ Overlays de pantalla completa / root-level reutilizables (alert, toast, context-menu, media viewer, session request, loadings, AI autofill, browser notifications).
4
+
5
+ **Deben montarse una sola vez en el root del host** (`app.component.html`). Ocupan viewport completo vía `position: fixed`.
6
+
7
+ ## Instalación
8
+
9
+ ```json
10
+ "@xosue-utils/services": "file:../xosue-utils/services"
11
+ ```
12
+
13
+ Peers: `@angular/common|core|forms|platform-browser|router|animations` ^19, `@lucide/angular`, `rxjs`.
14
+
15
+ El host necesita `provideAnimations()` (o `BrowserAnimationsModule`) por alert/toast/session.
16
+
17
+ ## Configuración
18
+
19
+ ```ts
20
+ import { provideXosueUtilsServices } from '@xosue-utils/services';
21
+
22
+ providers: [
23
+ provideXosueUtilsServices({
24
+ alertAcceptLabel: 'OK',
25
+ sessionLoginPath: '/login',
26
+ toastSoundUrl: '/assets/sounds/toast.mp3',
27
+ mediaFileNameFallback: 'File',
28
+ }),
29
+ ]
30
+ ```
31
+
32
+ Defaults en español (paridad Caludy).
33
+
34
+ ## Mount en el host
35
+
36
+ ```html
37
+ <alert-service></alert-service>
38
+ <toast-service></toast-service>
39
+ <context-menu-service></context-menu-service>
40
+ <media-viewer-service></media-viewer-service>
41
+ <session-request-service></session-request-service>
42
+ <global-loading-service></global-loading-service>
43
+ <navigation-loading-service></navigation-loading-service>
44
+ <ai-autofill-overlay-service></ai-autofill-overlay-service>
45
+ ```
46
+
47
+ Importa los componentes standalone en `AppComponent`.
48
+
49
+ ## Context menu
50
+
51
+ Copia propia de `ContextMenuService` + `ContextMenuServiceComponent` (+ `FieldHelpTooltipComponent`).
52
+ `@xosue-utils/inputs` sigue exportando su copia en `vendor/`; más adelante inputs puede re-exportar desde aquí sin romper apps actuales.
53
+
54
+ ## Media viewer
55
+
56
+ API: `MediaViewerService.open()` / `close()` / `state$`.
57
+
58
+ El host pasa **URLs ya resueltas** (sin crypto/CDN decrypt en el paquete). Players de video/audio son nativos (sin `hls.js` / `wavesurfer.js`).
59
+
60
+ ## Colores
61
+
62
+ Sin `#hex` / `rgb()` / `rgba()` en Sass. Solo `var(--…)` y `color-mix(in srgb, var(--…) N%, transparent)`.
63
+
64
+ ## Build
65
+
66
+ ```bash
67
+ cd D:\apps\xosue-utils\services
68
+ npm install
69
+ npm run build
70
+ ```
@@ -0,0 +1,46 @@
1
+ import { InjectionToken, Provider } from '@angular/core';
2
+ export type ToastDurationKey = 'success' | 'warning' | 'error' | 'info';
3
+ export interface XosueUtilsServicesConfig {
4
+ /** i18n / labels */
5
+ alertAcceptLabel?: string;
6
+ alertCancelLabel?: string;
7
+ loadingDefaultMessage?: string;
8
+ sessionRegisterPath?: string;
9
+ sessionLoginPath?: string;
10
+ sessionRegisterLabel?: string;
11
+ sessionLoginLabel?: string;
12
+ /** toast assets (absolute or app-root relative) */
13
+ toastSoundUrl?: string;
14
+ toastErrorSoundUrl?: string;
15
+ toastSuccessGifUrl?: string;
16
+ toastDurationsMs?: Partial<Record<ToastDurationKey, number>>;
17
+ /** media viewer */
18
+ mediaFileNameFallback?: string;
19
+ /** browser notification */
20
+ browserNotificationIconUrl?: string;
21
+ browserNotificationSoundUrl?: string;
22
+ browserNotificationPermissionPrompt?: string;
23
+ }
24
+ export declare const XOSUE_UTILS_SERVICES_DEFAULTS: Required<Omit<XosueUtilsServicesConfig, 'toastDurationsMs' | 'toastSuccessGifUrl'>> & {
25
+ toastSuccessGifUrl: string;
26
+ toastDurationsMs: Record<ToastDurationKey, number>;
27
+ };
28
+ export type ResolvedXosueUtilsServicesConfig = typeof XOSUE_UTILS_SERVICES_DEFAULTS;
29
+ export declare const XOSUE_UTILS_SERVICES_CONFIG: InjectionToken<Required<Omit<XosueUtilsServicesConfig, "toastDurationsMs" | "toastSuccessGifUrl">> & {
30
+ toastSuccessGifUrl: string;
31
+ toastDurationsMs: Record<ToastDurationKey, number>;
32
+ }>;
33
+ export declare function resolveXosueUtilsServicesConfig(config?: XosueUtilsServicesConfig): ResolvedXosueUtilsServicesConfig;
34
+ /**
35
+ * Provide overlay services configuration in the host app.
36
+ *
37
+ * ```ts
38
+ * providers: [
39
+ * provideXosueUtilsServices({
40
+ * sessionLoginPath: '/login',
41
+ * toastSoundUrl: '/assets/sounds/toast.mp3',
42
+ * }),
43
+ * ]
44
+ * ```
45
+ */
46
+ export declare function provideXosueUtilsServices(config?: XosueUtilsServicesConfig): Provider[];