limbo-component 1.0.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 (107) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/LICENSE +15 -0
  3. package/README.md +153 -0
  4. package/dist/favicon.ico +0 -0
  5. package/dist/index.d.ts +239 -0
  6. package/dist/limbo.cjs.js +31 -0
  7. package/dist/limbo.cjs.map +1 -0
  8. package/dist/limbo.css +1 -0
  9. package/dist/limbo.es.js +40021 -0
  10. package/dist/limbo.es.map +1 -0
  11. package/dist/limbo.min.js +49 -0
  12. package/dist/limbo.min.js.map +1 -0
  13. package/dist/limbo.umd.js +58 -0
  14. package/dist/limbo.umd.js.map +1 -0
  15. package/dist/types/App.d.ts +18 -0
  16. package/dist/types/App.d.ts.map +1 -0
  17. package/dist/types/components/CropperView.d.ts +10 -0
  18. package/dist/types/components/CropperView.d.ts.map +1 -0
  19. package/dist/types/components/Gallery.d.ts +19 -0
  20. package/dist/types/components/Gallery.d.ts.map +1 -0
  21. package/dist/types/components/ImageCard.d.ts +16 -0
  22. package/dist/types/components/ImageCard.d.ts.map +1 -0
  23. package/dist/types/components/ImageManager.d.ts +5 -0
  24. package/dist/types/components/ImageManager.d.ts.map +1 -0
  25. package/dist/types/components/Loader.d.ts +4 -0
  26. package/dist/types/components/Loader.d.ts.map +1 -0
  27. package/dist/types/components/TabAI.d.ts +7 -0
  28. package/dist/types/components/TabAI.d.ts.map +1 -0
  29. package/dist/types/components/TabPortals.d.ts +6 -0
  30. package/dist/types/components/TabPortals.d.ts.map +1 -0
  31. package/dist/types/components/TabStock.d.ts +7 -0
  32. package/dist/types/components/TabStock.d.ts.map +1 -0
  33. package/dist/types/components/TabUpload.d.ts +10 -0
  34. package/dist/types/components/TabUpload.d.ts.map +1 -0
  35. package/dist/types/components/Tabs.d.ts +6 -0
  36. package/dist/types/components/Tabs.d.ts.map +1 -0
  37. package/dist/types/components/UploadForm.d.ts +7 -0
  38. package/dist/types/components/UploadForm.d.ts.map +1 -0
  39. package/dist/types/core/AutoInputManager.d.ts +221 -0
  40. package/dist/types/core/AutoInputManager.d.ts.map +1 -0
  41. package/dist/types/core/ConfigManager.d.ts +294 -0
  42. package/dist/types/core/ConfigManager.d.ts.map +1 -0
  43. package/dist/types/core/EventManager.d.ts +36 -0
  44. package/dist/types/core/EventManager.d.ts.map +1 -0
  45. package/dist/types/core/InstanceManager.d.ts +48 -0
  46. package/dist/types/core/InstanceManager.d.ts.map +1 -0
  47. package/dist/types/core/LimboCore.d.ts +92 -0
  48. package/dist/types/core/LimboCore.d.ts.map +1 -0
  49. package/dist/types/core/ModalManager.d.ts +140 -0
  50. package/dist/types/core/ModalManager.d.ts.map +1 -0
  51. package/dist/types/hooks/useAiImage.d.ts +10 -0
  52. package/dist/types/hooks/useAiImage.d.ts.map +1 -0
  53. package/dist/types/hooks/useAiServices.d.ts +7 -0
  54. package/dist/types/hooks/useAiServices.d.ts.map +1 -0
  55. package/dist/types/hooks/useContainerQuery.d.ts +28 -0
  56. package/dist/types/hooks/useContainerQuery.d.ts.map +1 -0
  57. package/dist/types/hooks/useCropper.d.ts +43 -0
  58. package/dist/types/hooks/useCropper.d.ts.map +1 -0
  59. package/dist/types/hooks/useDeleteImage.d.ts +7 -0
  60. package/dist/types/hooks/useDeleteImage.d.ts.map +1 -0
  61. package/dist/types/hooks/useExternalImages.d.ts +10 -0
  62. package/dist/types/hooks/useExternalImages.d.ts.map +1 -0
  63. package/dist/types/hooks/useImage.d.ts +6 -0
  64. package/dist/types/hooks/useImage.d.ts.map +1 -0
  65. package/dist/types/hooks/useImageParams.d.ts +8 -0
  66. package/dist/types/hooks/useImageParams.d.ts.map +1 -0
  67. package/dist/types/hooks/useImages.d.ts +8 -0
  68. package/dist/types/hooks/useImages.d.ts.map +1 -0
  69. package/dist/types/hooks/useIsAllowedAll.d.ts +7 -0
  70. package/dist/types/hooks/useIsAllowedAll.d.ts.map +1 -0
  71. package/dist/types/hooks/useMobileDetection.d.ts +32 -0
  72. package/dist/types/hooks/useMobileDetection.d.ts.map +1 -0
  73. package/dist/types/hooks/usePortalSources.d.ts +7 -0
  74. package/dist/types/hooks/usePortalSources.d.ts.map +1 -0
  75. package/dist/types/hooks/useStockImages.d.ts +10 -0
  76. package/dist/types/hooks/useStockImages.d.ts.map +1 -0
  77. package/dist/types/hooks/useStockServices.d.ts +7 -0
  78. package/dist/types/hooks/useStockServices.d.ts.map +1 -0
  79. package/dist/types/hooks/useUploadImage.d.ts +8 -0
  80. package/dist/types/hooks/useUploadImage.d.ts.map +1 -0
  81. package/dist/types/index-refactored.d.ts +9 -0
  82. package/dist/types/index-refactored.d.ts.map +1 -0
  83. package/dist/types/services/aiApi.d.ts +3 -0
  84. package/dist/types/services/aiApi.d.ts.map +1 -0
  85. package/dist/types/services/apiClient.d.ts +31 -0
  86. package/dist/types/services/apiClient.d.ts.map +1 -0
  87. package/dist/types/services/assetsApi.d.ts +48 -0
  88. package/dist/types/services/assetsApi.d.ts.map +1 -0
  89. package/dist/types/services/authService.d.ts +65 -0
  90. package/dist/types/services/authService.d.ts.map +1 -0
  91. package/dist/types/services/imageParamsApi.d.ts +5 -0
  92. package/dist/types/services/imageParamsApi.d.ts.map +1 -0
  93. package/dist/types/services/portalsApi.d.ts +3 -0
  94. package/dist/types/services/portalsApi.d.ts.map +1 -0
  95. package/dist/types/services/responseAdapters.d.ts +43 -0
  96. package/dist/types/services/responseAdapters.d.ts.map +1 -0
  97. package/dist/types/services/stockApi.d.ts +4 -0
  98. package/dist/types/services/stockApi.d.ts.map +1 -0
  99. package/dist/types/utils/ContainerQueryDetector.d.ts +45 -0
  100. package/dist/types/utils/ContainerQueryDetector.d.ts.map +1 -0
  101. package/dist/types/utils/CropperManager.d.ts +88 -0
  102. package/dist/types/utils/CropperManager.d.ts.map +1 -0
  103. package/dist/types/utils/ThemeManager.d.ts +1002 -0
  104. package/dist/types/utils/ThemeManager.d.ts.map +1 -0
  105. package/dist/types/utils/i18n.d.ts +255 -0
  106. package/dist/types/utils/i18n.d.ts.map +1 -0
  107. package/package.json +84 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,124 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2025-10-13
9
+
10
+ ### Added
11
+
12
+ - 🎉 **Primera versión estable** lista para producción
13
+ - ✨ Arquitectura SOLID con sistema de instancias múltiples
14
+ - 🔐 Autenticación JWT v2 con auto-renovación
15
+ - 📦 Build multi-formato: ESM, CJS, UMD
16
+ - 🎨 Tailwind 4 con prefix `lb-` para evitar colisiones
17
+ - 🖼️ Sistema completo de gestión de imágenes:
18
+ - Galería de imágenes del portal
19
+ - Subida de imágenes con preview
20
+ - Recortador avanzado (Cropper.js 2.0)
21
+ - Integración con IA, Stock y servicios externos
22
+ - 🎭 Múltiples modos UI:
23
+ - `embed`: Componente embebido en contenedor
24
+ - `modal`: Apertura en overlay modal
25
+ - `button`: Botón trigger que abre modal
26
+ - 🎯 Modos funcionales configurables:
27
+ - `full`: Todas las funcionalidades
28
+ - `gallery-only`: Solo galería
29
+ - `upload-only`: Solo subida
30
+ - `crop-only`: Solo recortador
31
+ - `ia-only`: Solo IA
32
+ - 🤖 Sistema AutoInputs:
33
+ - Detección automática de inputs con `data-limbo-input-file`
34
+ - Configuración vía datasets
35
+ - Múltiples formatos de retorno (url, base64, assetId, object, json)
36
+ - 🎨 Sistema de presets:
37
+ - Aspect ratios configurables
38
+ - Tamaños predefinidos
39
+ - Presets obligatorios
40
+ - Bloqueo de recorte manual
41
+ - 🌍 Sistema i18n completo (ES/EN)
42
+ - 🎨 Sistema de theming extensible
43
+ - 📡 Sistema de eventos robusto:
44
+ - Eventos DOM personalizados
45
+ - Callbacks programáticos
46
+ - Event Manager centralizado
47
+ - ♿ Accesibilidad:
48
+ - Focus trap en modales
49
+ - ARIA labels
50
+ - Navegación por teclado
51
+ - Soporte ESC para cerrar modales
52
+ - 📱 Responsive y mobile-friendly
53
+ - 🔍 Container queries para adaptación automática
54
+ - 🎯 APIs completas:
55
+ - `Limbo.configure()` - Configuración global
56
+ - `Limbo.create()` - Crear instancias
57
+ - `Limbo.mount()` / `unmount()` - Gestión de montaje
58
+ - `Limbo.open()` / `close()` - Control de modales
59
+ - `Limbo.configureAutoInputs()` - Configurar inputs automáticos
60
+
61
+ ### Changed
62
+
63
+ - 🔄 Migración completa de API v1 a v2
64
+ - 🔄 Refactorización SOLID de toda la arquitectura
65
+ - ⚡ Optimización de bundle sizes
66
+ - 🔒 Mejoras de seguridad con JWT
67
+
68
+ ### Security
69
+
70
+ - 🔐 Implementación de autenticación JWT segura
71
+ - 🔒 Eliminación de API keys en cliente
72
+ - 🛡️ Validación de CORS por portal
73
+
74
+ ## [0.5.0] - 2025-10-10
75
+
76
+ ### Added
77
+
78
+ - 🚧 Versión beta con migración API v2
79
+ - 📦 Sistema de build básico
80
+ - 🎨 Integración inicial de Tailwind 4
81
+
82
+ ### Changed
83
+
84
+ - 🔄 Adaptadores de respuesta v2
85
+ - 🔄 Migración de hooks a APIs v2
86
+
87
+ ## [0.4.0] - 2025-10-05
88
+
89
+ ### Added
90
+
91
+ - ⚡ Sistema de managers (Config, Event, Modal, AutoInputs)
92
+ - 🎯 Soporte para múltiples instancias
93
+
94
+ ## [0.3.0] - 2025-09-28
95
+
96
+ ### Added
97
+
98
+ - 🖼️ Componente Gallery básico
99
+ - 📤 Sistema de subida de imágenes
100
+ - ✂️ Integración de Cropper.js
101
+
102
+ ## [0.2.0] - 2025-09-20
103
+
104
+ ### Added
105
+
106
+ - ⚛️ Configuración inicial React 19
107
+ - 📦 Setup Vite 7
108
+ - 🎨 Configuración Tailwind 4
109
+
110
+ ## [0.1.0] - 2025-09-15
111
+
112
+ ### Added
113
+
114
+ - 🎉 Proyecto inicial
115
+ - 📋 Estructura base del componente
116
+
117
+ ---
118
+
119
+ [1.0.0]: https://github.com/Lefebvre-El-Derecho-SA/component-image-manager-bundle/releases/tag/v1.0.0
120
+ [0.5.0]: https://github.com/Lefebvre-El-Derecho-SA/component-image-manager-bundle/releases/tag/v0.5.0
121
+ [0.4.0]: https://github.com/Lefebvre-El-Derecho-SA/component-image-manager-bundle/releases/tag/v0.4.0
122
+ [0.3.0]: https://github.com/Lefebvre-El-Derecho-SA/component-image-manager-bundle/releases/tag/v0.3.0
123
+ [0.2.0]: https://github.com/Lefebvre-El-Derecho-SA/component-image-manager-bundle/releases/tag/v0.2.0
124
+ [0.1.0]: https://github.com/Lefebvre-El-Derecho-SA/component-image-manager-bundle/releases/tag/v0.1.0
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2025 Lefebvre El Derecho, S.A.
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # @limbojs/component-limbo
2
+
3
+ > Componente React altamente configurable para gestión de imágenes en portales web. Incluye galería, subida, recortador, y servicios de IA/Stock.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@limbojs/component-limbo.svg)](https://www.npmjs.com/package/@limbojs/component-limbo)
6
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
7
+
8
+ ## 🌟 Características
9
+
10
+ - 🖼️ **Galería completa** - Navega y selecciona imágenes del portal
11
+ - 📤 **Subida de imágenes** - Con preview y validación
12
+ - ✂️ **Recortador avanzado** - Basado en Cropper.js 2.0 con presets
13
+ - 🤖 **Integración IA/Stock** - Generación y búsqueda de imágenes
14
+ - 🎭 **Múltiples modos** - Embed, modal o botón trigger
15
+ - 🎯 **Altamente configurable** - Por portal y por instancia
16
+ - 🔐 **Seguro** - Autenticación JWT v2
17
+ - 📦 **Multi-formato** - ESM, CJS, UMD (con React incluido)
18
+ - 🌍 **Internacionalización** - ES/EN incluidos
19
+ - ♿ **Accesible** - ARIA, teclado, focus trap
20
+ - 📱 **Responsive** - Mobile-friendly con container queries
21
+
22
+ ## 📦 Instalación
23
+
24
+ ### NPM / Yarn / PNPM
25
+
26
+ ```bash
27
+ npm install @limbojs/component-limbo
28
+ # o
29
+ yarn add @limbojs/component-limbo
30
+ # o
31
+ pnpm add @limbojs/component-limbo
32
+ ```
33
+
34
+ ### CDN (UMD)
35
+
36
+ ```html
37
+ <!-- Incluir CSS -->
38
+ <link rel="stylesheet" href="https://unpkg.com/@limbojs/component-limbo/dist/limbo.css">
39
+
40
+ <!-- Incluir JS (React ya incluido) -->
41
+ <script src="https://unpkg.com/@limbojs/component-limbo/dist/limbo.min.js"></script>
42
+ ```
43
+
44
+ ## 🚀 Uso Rápido
45
+
46
+ ### Modo Embed (ESM)
47
+
48
+ ```javascript
49
+ import Limbo from '@limbojs/component-limbo';
50
+ import '@limbojs/component-limbo/css';
51
+
52
+ // Configurar globalmente
53
+ Limbo.configure({
54
+ apiKey: 'your-api-key',
55
+ prod: true,
56
+ url: 'https://api.limbo.com'
57
+ });
58
+
59
+ // Crear instancia embebida
60
+ Limbo.create({
61
+ container: '#limbo-container',
62
+ mode: 'embed',
63
+ modeUI: 'full'
64
+ });
65
+ ```
66
+
67
+ ### Modo UMD (HTML puro)
68
+
69
+ ```html
70
+ <!DOCTYPE html>
71
+ <html>
72
+ <head>
73
+ <link rel="stylesheet" href="https://unpkg.com/@limbojs/component-limbo/dist/limbo.css">
74
+ </head>
75
+ <body>
76
+ <div id="limbo-app"></div>
77
+
78
+ <script src="https://unpkg.com/@limbojs/component-limbo/dist/limbo.min.js"></script>
79
+ <script>
80
+ // Configurar
81
+ Limbo.configure({
82
+ apiKey: 'your-api-key',
83
+ prod: true
84
+ });
85
+
86
+ // Montar
87
+ Limbo.create({
88
+ container: '#limbo-app',
89
+ mode: 'embed'
90
+ });
91
+ </script>
92
+ </body>
93
+ </html>
94
+ ```
95
+
96
+ ### AutoInputs (Integración automática)
97
+
98
+ ```html
99
+ <!-- Configurar una vez -->
100
+ <script>
101
+ Limbo.configure({ apiKey: 'your-api-key' });
102
+ Limbo.configureAutoInputs({
103
+ dataset: 'data-limbo-input-file',
104
+ returnType: 'url'
105
+ });
106
+ </script>
107
+
108
+ <!-- Usar en múltiples inputs -->
109
+ <input
110
+ type="hidden"
111
+ name="avatar"
112
+ data-limbo-input-file
113
+ data-limbo-mode="modal"
114
+ data-limbo-features="gallery,upload"
115
+ />
116
+ ```
117
+
118
+ ## ⚙️ Configuración
119
+
120
+ ```javascript
121
+ Limbo.create({
122
+ container: '#app',
123
+ mode: 'embed', // 'embed' | 'modal' | 'button'
124
+ modeUI: 'full', // 'full' | 'gallery-only' | 'upload-only' | 'crop-only'
125
+
126
+ // Callbacks
127
+ callbacks: {
128
+ onSelect: (payload) => console.log('Selected:', payload),
129
+ onUpload: (payload) => console.log('Uploaded:', payload),
130
+ onError: (error) => console.error('Error:', error)
131
+ }
132
+ });
133
+ ```
134
+
135
+ ## 📡 Eventos
136
+
137
+ ```javascript
138
+ document.addEventListener('limbo:select', (e) => {
139
+ console.log('Image selected:', e.detail);
140
+ // e.detail contiene: assetId, variants, master, fileBlob, etc.
141
+ });
142
+ ```
143
+
144
+ ## 📄 Licencia
145
+
146
+ ISC © LefebvreWEB
147
+
148
+ ## 🔗 Links
149
+
150
+ - [Documentación completa](https://docs.limbo.dev)
151
+ - [API Backend](https://github.com/Lefebvre-El-Derecho-SA/api-limbo)
152
+ - [Reportar issues](https://github.com/Lefebvre-El-Derecho-SA/component-image-manager-bundle/issues)
153
+ - [Changelog](./CHANGELOG.md)
Binary file
@@ -0,0 +1,239 @@
1
+ // Type definitions for @limbojs/component-limbo
2
+ // Project: Limbo Image Manager Component
3
+ // Definitions by: LefebvreWEB <https://github.com/Lefebvre-El-Derecho-SA>
4
+
5
+ export interface LimboConfig {
6
+ /** API key for authentication */
7
+ apiKey: string;
8
+ /** Production mode flag */
9
+ prod?: boolean;
10
+ /** Base URL for API endpoints */
11
+ url?: string;
12
+ }
13
+
14
+ export interface LimboInstanceConfig extends LimboConfig {
15
+ /** DOM selector or element for mounting */
16
+ container: string | HTMLElement;
17
+ /** UI mode */
18
+ mode?: 'embed' | 'modal' | 'button';
19
+ /** Functional mode */
20
+ modeUI?: 'full' | 'gallery-only' | 'upload-only' | 'crop-only' | 'ia-only';
21
+ /** Available features */
22
+ features?: Array<'gallery' | 'upload' | 'cropper' | 'ia'>;
23
+ /** Image presets configuration */
24
+ presets?: {
25
+ /** Aspect ratio presets */
26
+ aspects?: Array<{
27
+ name: string;
28
+ ratio: string;
29
+ label?: string;
30
+ }>;
31
+ /** Size presets */
32
+ sizes?: Array<{
33
+ name: string;
34
+ width: number;
35
+ height?: number;
36
+ fit?: 'cover' | 'contain' | 'fill';
37
+ label?: string;
38
+ }>;
39
+ /** Required preset names */
40
+ required?: string[];
41
+ /** Lock user crop */
42
+ lockUserCrop?: boolean;
43
+ /** Allow arbitrary crops */
44
+ allowArbitrary?: boolean;
45
+ /** Default aspect preset */
46
+ defaultAspect?: string;
47
+ /** Default size preset */
48
+ defaultSize?: string;
49
+ };
50
+ /** Internationalization configuration */
51
+ i18n?: {
52
+ /** Locale code */
53
+ locale?: 'es' | 'en' | 'auto';
54
+ /** Custom messages */
55
+ messages?: Record<string, Record<string, string>>;
56
+ /** Auto-detect browser language */
57
+ autoDetect?: boolean;
58
+ };
59
+ /** Theme configuration */
60
+ theme?: {
61
+ /** Color palette */
62
+ colors?: Record<string, string>;
63
+ /** Spacing values */
64
+ spacing?: Record<string, string>;
65
+ /** Typography settings */
66
+ typography?: {
67
+ fontFamily?: string;
68
+ fontSize?: Record<string, string>;
69
+ fontWeight?: Record<string, string>;
70
+ };
71
+ /** Border radius values */
72
+ borderRadius?: Record<string, string>;
73
+ /** Shadow definitions */
74
+ shadows?: Record<string, string>;
75
+ /** Custom CSS properties */
76
+ customProperties?: Record<string, string>;
77
+ };
78
+ /** UI configuration */
79
+ ui?: LimboUIConfig;
80
+ /** Event callbacks */
81
+ callbacks?: LimboCallbacks;
82
+ }
83
+
84
+ export interface LimboUIConfig {
85
+ /** Actions to show */
86
+ showActions?: Array<'select' | 'download' | 'copy' | 'delete' | 'crop'>;
87
+ /** Actions to hide */
88
+ hideActions?: Array<'select' | 'download' | 'copy' | 'delete' | 'crop'>;
89
+ /** UI theme */
90
+ theme?: 'light' | 'dark';
91
+ /** Interface language */
92
+ language?: 'es' | 'en';
93
+ /** Compact mode flag */
94
+ compactMode?: boolean;
95
+ /** Show tabs flag */
96
+ showTabs?: boolean;
97
+ }
98
+
99
+ export interface LimboCallbacks {
100
+ /** Called when component is ready */
101
+ onReady?: (data: { instance: LimboInstance; config: LimboInstanceConfig; timestamp: number }) => void;
102
+ /** Called when image is selected */
103
+ onSelect?: (data: ImageData) => void;
104
+ /** Called when image is uploaded */
105
+ onUpload?: (data: ImageData) => void;
106
+ /** Called when error occurs */
107
+ onError?: (error: { message: string; code: string; timestamp: number }) => void;
108
+ /** Called when modal is opened */
109
+ onOpen?: (data: { instance: LimboInstance; mode: string; timestamp: number }) => void;
110
+ /** Called when modal/component is closed */
111
+ onClose?: () => void;
112
+ }
113
+
114
+ export interface ImageData {
115
+ /** Unique asset identifier */
116
+ assetId?: string;
117
+ /** Available image variants */
118
+ variants?: Array<{
119
+ variantId: string;
120
+ name: string;
121
+ urlSigned: string;
122
+ width: number;
123
+ height: number;
124
+ mime: string;
125
+ }>;
126
+ /** Master image data */
127
+ master?: {
128
+ urlSigned: string;
129
+ width: number;
130
+ height: number;
131
+ mime: string;
132
+ };
133
+ /** Image URL (legacy) */
134
+ url?: string;
135
+ /** Base64 data URL */
136
+ base64?: string;
137
+ /** Original file name */
138
+ fileName?: string;
139
+ /** MIME type */
140
+ mime?: string;
141
+ /** Image width */
142
+ width?: number;
143
+ /** Image height */
144
+ height?: number;
145
+ /** File blob if available */
146
+ blob?: Blob;
147
+ fileBlob?: File | Blob;
148
+ /** Additional metadata */
149
+ metadata?: {
150
+ uploadedBy?: string;
151
+ uploadedAt?: string | number;
152
+ size?: number;
153
+ [key: string]: any;
154
+ };
155
+ /** Instance information (for events) */
156
+ instance?: LimboInstance;
157
+ /** Event type (for events) */
158
+ eventType?: string;
159
+ /** Timestamp (for events) */
160
+ timestamp?: number;
161
+ /** Instance ID (for events) */
162
+ instanceId?: string;
163
+ /** Mode (for events) */
164
+ mode?: string;
165
+ /** Features (for events) */
166
+ features?: string[];
167
+ }
168
+
169
+ export interface AutoInputConfig {
170
+ /** Dataset attribute name */
171
+ dataset?: string;
172
+ /** Return data format */
173
+ return?: 'url' | 'base64' | 'assetId' | 'object' | 'json';
174
+ /** UI mode for auto-inputs */
175
+ modeUI?: 'full' | 'gallery-only' | 'upload-only' | 'crop-only' | 'ia-only';
176
+ /** Modal size */
177
+ modalSize?: 'small' | 'medium' | 'large';
178
+ }
179
+
180
+ export interface LimboInstance {
181
+ /** Instance ID */
182
+ id: string;
183
+ /** Instance configuration */
184
+ config: Partial<LimboInstanceConfig>;
185
+ /** Instance event manager */
186
+ eventManager: object;
187
+ /** Instance modal manager */
188
+ modalManager: object;
189
+ /** Mount the component */
190
+ mount(): LimboInstance;
191
+ /** Unmount the component */
192
+ unmount(): LimboInstance;
193
+ /** Open modal (for modal/button modes) */
194
+ open(): LimboInstance;
195
+ /** Close modal (for modal/button modes) */
196
+ close(): LimboInstance;
197
+ /** Update instance configuration */
198
+ updateConfig(config: Partial<LimboInstanceConfig>): LimboInstance;
199
+ /** Destroy the instance */
200
+ destroy(): void;
201
+ /** Check if mounted */
202
+ isMounted(): boolean;
203
+ /** Get current mode */
204
+ getMode(): 'embed' | 'modal' | 'button';
205
+ /** Get container element */
206
+ getContainer(): HTMLElement | null;
207
+ /** Get current configuration */
208
+ getConfig(): LimboInstanceConfig;
209
+ }
210
+
211
+ export interface LimboCore {
212
+ /** Configure global settings */
213
+ configure(config: LimboConfig): LimboCore;
214
+ /** Create new instance */
215
+ create(config: LimboInstanceConfig): LimboInstance;
216
+ /** Configure auto-inputs */
217
+ configureAutoInputs(config: AutoInputConfig): LimboCore;
218
+ /** Set theme configuration */
219
+ setTheme(theme: any): LimboCore;
220
+ /** Get current theme */
221
+ getTheme(): any;
222
+ /** Get instance by ID */
223
+ getInstance(id: string): LimboInstance | null;
224
+ /** Get all instances */
225
+ getAllInstances(): LimboInstance[];
226
+ /** Destroy all instances */
227
+ destroyAll(): LimboCore;
228
+ }
229
+
230
+ declare const Limbo: LimboCore;
231
+
232
+ export default Limbo;
233
+
234
+ // UMD global declarations
235
+ declare global {
236
+ interface Window {
237
+ Limbo: LimboCore;
238
+ }
239
+ }