@robosophy/ui-vue 1.1.11 → 1.1.13

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.
package/icon-scanner.md CHANGED
@@ -2,280 +2,373 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- The Vite plugin `robosophyMaterialSymbols()` automatically detects which Material Symbols
6
- icons are used in source code and generates an SVG sprite with only those icons.
7
- No fonts are loaded.
5
+ `robosophyMaterialSymbols()` es un plugin de Vite que genera un sprite SVG con solo los
6
+ iconos de **Material Symbols** que tu codigo realmente usa. Sin fuentes tipograficas,
7
+ sin subset fonts, sin dependencias npm.
8
8
 
9
- The scanner works at **build time** (and in dev mode via file watching).
10
- It scans every `.vue`, `.ts`, `.tsx`, `.js`, `.jsx`, and `.mjs` file in the project's `src/` directory
11
- (or custom `roots`), extracts icon names, families, and weights, then downloads the matching SVGs
12
- from the Google Material Design Icons repository.
9
+ **Pipeline:**
13
10
 
14
- When the package is built (`npm run build`), a **pre-scan** (the manifest script in
15
- `scripts/generate-icon-manifest.mjs`) identifies icons used by the library's own components
16
- (`RsSidebar`, `RsAccountSelector`, etc.) and writes them to `dist/icon-manifest.json`.
17
- The Vite plugin loads this manifest at dev/build time as a baseline, then adds icons found
18
- by scanning the consuming project's source.
11
+ ```
12
+ source code → scan (8 patterns) → merge with manifest → download SVGs → inline SVG sprite
13
+ ```
14
+
15
+ El scanner opera en **build time** y en **dev mode** (con file watching). Escanea archivos
16
+ `.vue`, `.ts`, `.tsx`, `.js`, `.jsx`, y `.mjs` del proyecto, extrae nombres de icono,
17
+ familias y pesos, y descarga los SVGs correspondientes del repositorio oficial de Google.
18
+
19
+ Los iconos que usan los componentes internos de la libreria (`RsSidebar`, `RsAccountSelector`,
20
+ etc.) se precargan en `dist/icon-manifest.json` durante el build del paquete y se fusionan
21
+ con los detectados en el proyecto consumidor.
19
22
 
20
23
  ---
21
24
 
22
- ## Detection Patterns
25
+ ## Quick Reference
26
+
27
+ | # | Pattern | Categoria | Detecta | Ejemplo |
28
+ |---|---------|-----------|---------|---------|
29
+ | 1 | `<RsIcon>` tag | Componente | `name` estatico + ternarias | `<RsIcon name="home" />` |
30
+ | 2 | `rsPrimeIcon()` | Componente | String literal en helper | `rsPrimeIcon("home")` |
31
+ | 3 | `icon:` property | Dato | Objeto con `icon:` key | `{ icon: "home" }` |
32
+ | 5 | Icon arrays | Dato | Array en variable `*icon*` | `const iconNames = ["home"]` |
33
+ | 5b | Icon objects | Dato | Objeto en variable `*icon*` | `const iconMap = { pc: "article" }` |
34
+ | 6a | Component icon prop | Cross-file | `icon=` en tag PascalCase | `<CustomButton icon="home" />` |
35
+ | 6b | Proxy components | Cross-file | Prop forwarding a `<RsIcon :name>` | `<ProxyIcon icon="home" />` |
36
+ | 4 | Magic comments | Fallback | Declaracion explicita | `// @robosophy-icon: home` |
23
37
 
24
- The scanner uses five patterns to find icon usage in source code.
25
- Patterns 4 and 5 were added for cases that the original three could not handle.
38
+ ---
26
39
 
27
- ### Pattern 1: `<RsIcon>` Component Tag
40
+ ## Automatic Detection
28
41
 
29
- **Regex:** `/ <RsIcon\b([^>]*)>/g`
42
+ Estos 7 patrones se activan solos. No requieren configuracion manual, solo codigo fuente
43
+ donde los nombres de icono aparezcan como **string literals**.
30
44
 
31
- Parses the attributes with `parseStaticAttributes` and reads `name`, `:name`, `family`,
32
- `:family`, `weight`, `:weight`.
45
+ ### Component Patterns
33
46
 
34
- **Detected:**
47
+ #### Pattern 1: `<RsIcon>` tag
48
+
49
+ **Regex:** `/ <RsIcon\b([\s\S]*?)>/g`
50
+
51
+ Detecta usos directos del componente `<RsIcon>` con `name` estatico, ternarias en `:name`,
52
+ template literals, y tags multi-linea. Soporta `family`, `:family`, `weight`, `:weight`.
53
+
54
+ **Detectado:**
35
55
  ```vue
36
56
  <RsIcon name="home" />
37
57
  <RsIcon name="home" family="rounded" />
38
- <RsIcon :name="cond ? 'home' : 'settings'" family="rounded" />
39
- <RsIcon name="home" weight="200" />
58
+ <RsIcon :name="cond ? 'home' : 'settings'" family="rounded" weight="200" />
59
+ <RsIcon
60
+ name="home"
61
+ family="rounded"
62
+ />
63
+ <RsIcon :name="`home`" />
40
64
  ```
41
65
 
42
- **Not detected** (variable references):
66
+ **No detectado** (variables en `:name`):
43
67
  ```vue
44
68
  <RsIcon :name="iconVar" />
45
69
  <RsIcon :name="item.icon" />
70
+ <RsIcon v-for="name in list" :name="name" />
46
71
  ```
47
72
 
48
- **Filter:** icon names must match `/^[a-z0-9_]+$/` (lowercase with underscores).
73
+ > 💡 Si el binding tiene ternarias con string literals, ambas ramas se extraen.
74
+ > Si es solo una variable (`:name="iconProp"`), usa Pattern 3 en la fuente de datos
75
+ > o Magic Comments como ultimo recurso.
49
76
 
50
- **Dynamic `:name` with ternaries:** any string literal inside the `:name` expression
51
- is extracted. For example `:name="cond ? 'add' : 'remove'"` extracts both `add` and `remove`.
77
+ ---
52
78
 
53
- **Dynamic `:name` without string literals:** if the binding is a plain variable reference
54
- like `:name="current_icon"`, the scanner no longer treats it as an icon name
55
- (improvement 3, see changelog). Use `include` or magic comments for these cases.
79
+ #### Pattern 2: `rsPrimeIcon()` helper
56
80
 
57
- ### Pattern 2: `rsPrimeIcon()` Helper
81
+ **Regex:** `/\brsPrimeIcon\(\s*["'`]([a-z0-9_]+)["'`](?:\s*,\s*\{([^)]*)\})?/g`
58
82
 
59
- **Regex:** `/\brsPrimeIcon\(\s*["']([a-z0-9_]+)["'](?:\s*,\s*\{([^)]*)\})?/g`
83
+ Detecta el helper que PrimeVue usa como string de clases para `Button.icon`,
84
+ `MenuItem.icon`, etc. Soporta `family` opcional.
60
85
 
61
- **Detected:**
86
+ **Detectado:**
62
87
  ```ts
63
88
  rsPrimeIcon("home")
64
89
  rsPrimeIcon('settings', { family: 'rounded' })
90
+ rsPrimeIcon(`home`)
65
91
  ```
66
92
 
67
- **Not detected:**
93
+ **No detectado:**
68
94
  ```ts
69
- rsPrimeIcon(dynamicName)
95
+ rsPrimeIcon(variableName)
70
96
  ```
71
97
 
72
- ### Pattern 3: Object Literal `icon:` Property
98
+ ---
73
99
 
74
- **Regex:** `/\bicon\s*:\s*["']([a-z0-9_]+)["']/g`
100
+ ### Data Patterns
75
101
 
76
- After matching, the scanner finds the enclosing `{...}` object and extracts `weight` and
77
- `family` from its body (using `findEnclosingObject`). Comments are stripped from the body
78
- before searching for these properties.
102
+ #### Pattern 3: `icon:` property
79
103
 
80
- **Detected:**
104
+ **Regex:** `/\bicon\s*:\s*["'`]([a-z0-9_]+)["'`]/g`
105
+
106
+ Detecta objetos con una propiedad `icon:` y extrae `weight:` y `family:` del mismo objeto.
107
+ Usa `findEnclosingObject` para encontrar los limites del objeto, ignorando comentarios,
108
+ strings escapados y template literals.
109
+
110
+ **Detectado:**
81
111
  ```ts
82
112
  const items = [
83
113
  { label: "Inbox", icon: "inbox" },
84
114
  { label: "Settings", icon: "settings", family: "rounded", weight: 200 },
85
- ];
115
+ { icon: `home` },
116
+ ]
86
117
  ```
87
118
 
88
- **Not detected** (no `icon:` string literal):
119
+ **No detectado:**
89
120
  ```ts
90
- const items = [{ icon: dynamicVar }]; // variable reference
91
- { icon } // shorthand property
92
- { ["icon"]: "home" } // computed property
121
+ { icon: dynamicVar } // variable reference
122
+ { icon } // shorthand property
123
+ { ["icon"]: "home" } // computed property key
93
124
  ```
94
125
 
95
- **`findEnclosingObject` behavior:**
96
- - Scans backward from the `icon:` match to find the nearest opening `{`
97
- - Skips over strings, template literals, escaped quotes, and comments (`//` and `/* */`)
98
- - Scans forward to find the matching `}`
99
- - Returns the body content between `{` and `}`
100
- - The body is then cleaned of comments before searching for `weight:` and `family:`
126
+ > 💡 Pattern 3 es la forma mas comun de declarar iconos en datos de navegacion.
127
+ > RsSidebar recibe `items` con `icon:` — se detecta automaticamente.
101
128
 
102
- ```ts
103
- // This correctly reads weight=200 and family="rounded":
104
- { icon: "home", weight: 200, family: "rounded" }
105
-
106
- // Comments are ignored:
107
- { /* weight: 200, family: "rounded" */ icon: "home" }
108
- // → default weight 400, default family "outlined"
109
- ```
129
+ ---
110
130
 
111
- ### Pattern 4: Magic Comments
131
+ #### Pattern 5: Icon arrays
112
132
 
113
- **Regex:** `/\/\/\s*@robosophy-icon:\s*([a-z0-9_]+)(?:\s+family=(\w+))?(?:\s+weight=(\d+))?/g`
133
+ **Regex:** `/(?:const|let|var)\s+(\w*[Ii]con\w*)\s*=\s*\[/g`
114
134
 
115
- For cases where the scanner cannot detect an icon statically (props, variables, API responses,
116
- computed properties), use magic comments to declare them explicitly.
135
+ Detecta arrays asignados a variables cuyo nombre contiene "icon" (case-insensitive).
136
+ Extrae strings del nivel superior del array, incluyendo arrays anidados y template literals.
117
137
 
118
- **Usage:**
138
+ **Detectado:**
119
139
  ```ts
120
- // @robosophy-icon: home
121
- // @robosophy-icon: settings family=rounded
122
- // @robosophy-icon: warning weight=200
123
- // @robosophy-icon: manage_accounts family=rounded weight=200
124
-
125
- const sidebarItems = [
126
- { id: "home", label: "Home", icon: "home" },
127
- { id: "settings", label: "Settings", icon: "settings" },
128
- ];
140
+ const iconNames = ["home", "settings", "info"]
141
+ const sidebarIcons = ["home", "search"]
142
+ const ICON_LIST = ["warning", "error"]
129
143
  ```
130
144
 
131
- **Best for:**
132
- - Icon names passed as props to parent components
133
- - Icon names in constants, enums, or configuration objects
134
- - Icon names from API responses
135
- - Icon names in computed properties or functions
136
-
137
- **Placement:** anywhere in the source file. The scanner reads the entire file content.
145
+ ```ts
146
+ // Arrays anidados
147
+ const iconGroups = [
148
+ ["home", "settings"], // ✅ detectados
149
+ "search" // ✅ detectado
150
+ ]
151
+ ```
138
152
 
139
- ### Pattern 5: Arrays of Icon Strings
153
+ **No detectado:**
154
+ ```ts
155
+ const names = ["home", "settings"] // sin "icon" en nombre
156
+ const items = [{ icon: "home" }] // Pattern 3 lo cubre
157
+ ```
140
158
 
141
- **Regex:** `/\/\/\s*@robosophy-icon:\s*([a-z0-9_]+)(?:\s+family=(\w+))?(?:\s+weight=(\d+))?/g`
159
+ ---
142
160
 
143
- Wait, that's the same as Pattern 4. Let me check the actual regex I used...
161
+ #### Pattern 5b: Icon objects
144
162
 
145
- Actually, Pattern 5 detects arrays assigned to variables whose name contains "icon" (case-insensitive).
163
+ **Regex:** `/(?:const|let|var)\s+(\w*[Ii]con\w*)[^=]*=\s*\{/g`
146
164
 
147
- **Regex:** `/(?:const|let|var)\s+(\w*[Ii]con\w*)\s*=\s*\[/g`
165
+ Detecta objetos literales asignados a variables con "icon" en el nombre y extrae todos
166
+ los string values que matchean el patron de nombre de icono. Soporta anotaciones de tipo
167
+ TypeScript (`: Record<K, V>`) y TypeScript generics con `<>`.
148
168
 
149
- After finding the start of an icon array, it extracts all string literals from the brackets.
169
+ **Detectado:**
170
+ ```ts
171
+ const variantIconMap: Record<string, string> = {
172
+ pc: "article",
173
+ alta: "account_circle",
174
+ cc: "account_balance_wallet",
175
+ cyo: "nest_eco_leaf",
176
+ }
177
+ ```
150
178
 
151
- **Detected:**
152
179
  ```ts
153
- const iconNames = ["home", "settings", "info"];
154
- const sidebarIcons = ["home", "search"];
155
- const ICON_LIST = ["warning", "error"];
180
+ const iconConfig = {
181
+ default: "home",
182
+ active: "settings",
183
+ }
156
184
  ```
157
185
 
158
- **Not detected** (no "icon" in variable name):
186
+ **No detectado:**
159
187
  ```ts
160
- const names = ["home", "settings"]; // variable name doesn't contain "icon"
161
- const items = [{ icon: "home" }]; // already handled by Pattern 3
188
+ const names = { key: "article" } // sin "icon" en nombre
162
189
  ```
163
190
 
164
- **Caveat:** This pattern uses a heuristic (variable name contains "icon"). It may miss icons
165
- stored in arrays with unrelated names. Use magic comments for those.
191
+ > 💡 Pattern 5b fue creado especificamente para `variantIconMap` en RsSidebar,
192
+ > donde las claves son nombres de variante y los valores son iconos.
166
193
 
167
194
  ---
168
195
 
169
- ## Plugin Options
196
+ ### Cross-file Patterns
170
197
 
171
- | Option | Type | Default | Description |
172
- |--------|------|---------|-------------|
173
- | `include` | `IconInput[]` | `[]` | Icons to include regardless of detection. Each entry is a string (name) or `{ family, name, weight? }`. If weight is omitted, all valid weights (100-700) are included. |
174
- | `scan` | `boolean` | `true` | Set to `false` to disable source scanning entirely. All icons must be in `include`. |
175
- | `roots` | `string[]` | `["./src"]` | Directories to scan for icon usage. |
176
- | `outputDir` | `string` | `"assets"` | Output directory for the SVG sprite. |
177
- | `fontDisplay` | `string` | — | CSS `font-display` value. |
178
- | `preload` | `boolean` | `false` | Preload the SVG sprite in the `<head>`. |
198
+ #### Pattern 6a: Component icon prop
179
199
 
180
- ---
181
-
182
- ## `icon-manifest.json`
200
+ **Regex:** `/<([A-Z][a-zA-Z0-9_]*)\b([\s\S]*?)>/g`
183
201
 
184
- The build script (`scripts/generate-icon-manifest.mjs`) scans the library's own components
185
- under `src/components/` and produces `dist/icon-manifest.json`.
202
+ Detecta el atributo `icon`, `iconName` o `icon-name` en cualquier tag PascalCase
203
+ (excepto `<RsIcon>` que usa `name`). Funciona sin analisis cross-file.
186
204
 
187
- **File format:**
188
- ```json
189
- {
190
- "outlined": ["home", "search", "settings"],
191
- "rounded": ["settings"],
192
- "sharp": []
193
- }
205
+ **Detectado:**
206
+ ```vue
207
+ <CustomButton icon="home" />
208
+ <AnotherComponent iconName="settings" />
209
+ <ThirdThing icon-name="search" />
194
210
  ```
195
211
 
196
- **Role in the pipeline:**
197
- 1. Build generates the manifest from the library's component source
198
- 2. Vite plugin loads the manifest as a baseline
199
- 3. Plugin then scans the consuming project's source for additional icons
200
- 4. Plugin fetches SVGs for the combined set
212
+ **No detectado:**
213
+ ```vue
214
+ <RsIcon icon="home" /> <!-- RsIcon usa name, no icon -->
215
+ <CustomButton :icon="var" /> <!-- dynamic binding -->
216
+ ```
201
217
 
202
- **Why not just use the manifest alone?**
203
- The manifest ensures that icons required by library components are always available,
204
- even if the consuming project doesn't use those components. However, the manifest may
205
- include icons that the consumer never uses (it's a conservative baseline). The plugin's
206
- source scan adds only the icons that the consumer's own code references.
218
+ > 💡 Este patron es util cuando un componente expone un prop `icon` y el valor
219
+ > se pasa como string literal en el template del consumidor.
207
220
 
208
221
  ---
209
222
 
210
- ## Known Limitations
223
+ #### Pattern 6b: Proxy components
224
+
225
+ **Analisis en dos fases:**
211
226
 
212
- ### Icon names passed as props
227
+ 1. **Fase 1** — Encuentra componentes que hacen forwarding de un prop a `<RsIcon>`:
228
+ - Tienen `defineProps` con al menos un prop
229
+ - Tienen `<RsIcon :name="propName">` donde `propName` es un prop
230
+ - Tienen `defineOptions({ name: "ComponentName" })`
231
+ 2. **Fase 2** — Escanea los consumos de esos componentes y extrae valores del prop `icon`
213
232
 
233
+ **Detectado:**
234
+
235
+ Componente (`CustomIconButton.vue`):
214
236
  ```vue
215
- <!-- RsSidebar uses :name="icon" which is a prop -->
216
- <RsIcon :name="icon" />
237
+ <script setup lang="ts">
238
+ defineOptions({ name: "CustomIconButton" })
239
+ defineProps<{ icon: string }>()
240
+ </script>
241
+ <template>
242
+ <RsIcon :name="icon" />
243
+ </template>
244
+ ```
217
245
 
218
- <!-- RsSidebar uses :name="item.icon" from v-for iteration -->
219
- <RsIcon :name="item.icon" />
246
+ Consumo (`App.vue`):
247
+ ```vue
248
+ <CustomIconButton icon="home" /> <!-- ✅ detectado -->
249
+ <CustomIconButton icon="settings" /> <!-- ✅ detectado -->
220
250
  ```
221
251
 
222
- The scanner cannot resolve the runtime value of `icon` or `item.icon`.
252
+ **No detectado:**
253
+ - Componentes sin `defineProps`
254
+ - Componentes sin `defineOptions({ name: ... })`
255
+ - Props que no se pasan a `<RsIcon :name="prop">`
256
+ - Bindings dinamicos (`:icon="variable"`)
257
+
258
+ ---
259
+
260
+ ## Manual Fallbacks
261
+
262
+ Cuando ningun patron automatico detecta tu icono (ej: viene de una API, de un enum,
263
+ o de una variable calculada), tenes dos opciones. **Usalas solo cuando los patrones
264
+ automaticos no alcancen.**
223
265
 
224
- **Solutions:**
225
- 1. Use `include` in the Vite plugin config
226
- 2. Add magic comments (`// @robosophy-icon: icon_name`) in the component file
227
- 3. Declare the icon in the same file as the data source (Pattern 3 will detect it)
266
+ ### Magic comments (Pattern 4)
228
267
 
229
- ### Icon names in arrays of strings
268
+ **Regex:** `/(?:\/\/|\/\*)\s*@robosophy-icon:\s*([a-z0-9_]+)/g`
269
+
270
+ Declara el icono explicitamente en el mismo archivo donde se usa:
230
271
 
231
272
  ```ts
232
- const iconNames = ["home", "settings"];
273
+ // @robosophy-icon: manage_accounts
274
+ const item = { icon: props.iconName }
233
275
  ```
234
276
 
235
- Pattern 5 detects these only if the variable name contains "icon".
236
-
237
- ### Icon names in enums or constants
277
+ Soporta `family=` y `weight=` opcionales en la misma linea:
238
278
 
239
279
  ```ts
240
- export enum Icons {
241
- HOME = "home",
242
- SETTINGS = "settings",
243
- }
280
+ // @robosophy-icon: settings family=rounded weight=200
244
281
  ```
245
282
 
246
- Not detected. Use magic comments or `include`.
283
+ ### `include` (plugin config)
247
284
 
248
- ### Icon names from API responses
285
+ Para iconos usados en muchos lugares o controlados por configuracion remota:
249
286
 
250
287
  ```ts
251
- const config = await fetchConfig();
252
- return <RsIcon :name="config.iconName" />;
288
+ robosophyMaterialSymbols({
289
+ include: [
290
+ "home",
291
+ { family: "rounded", name: "settings", weight: 200 },
292
+ ],
293
+ })
253
294
  ```
254
295
 
255
- Cannot be detected statically. Use `include` or magic comments.
296
+ Si se omite `weight`, se incluyen todos los pesos validos (100-700).
297
+
298
+ ---
299
+
300
+ ## Plugin Options
301
+
302
+ | Option | Type | Default | Description |
303
+ |--------|------|---------|-------------|
304
+ | `include` | `IconInput[]` | `[]` | Iconos forzados. String = nombre, objeto = `{ family?, name, weight? }` |
305
+ | `scan` | `boolean` | `true` | `false` desactiva el escaneo. Todos los iconos deben ir en `include` |
306
+ | `roots` | `string[]` | `["./src"]` | Directorios a escanear |
307
+ | `outputDir` | `string` | `"assets"` | Directorio de salida del sprite SVG |
308
+ | `fontDisplay` | `string` | — | CSS `font-display` |
309
+ | `preload` | `boolean` | `false` | Precarga el sprite en el `<head>` |
310
+
311
+ ---
312
+
313
+ ## `icon-manifest.json`
314
+
315
+ Generado por `scripts/generate-icon-manifest.mjs` durante el build del paquete.
316
+ Escanea `src/components/` y produce `dist/icon-manifest.json`.
317
+
318
+ ```json
319
+ {
320
+ "outlined": ["home", "search", "settings"],
321
+ "rounded": ["settings"],
322
+ "sharp": []
323
+ }
324
+ ```
325
+
326
+ **Rol en el pipeline:**
327
+ 1. Build genera el manifiesto desde los componentes de la libreria
328
+ 2. Plugin de Vite carga el manifiesto como baseline
329
+ 3. Plugin escanea el proyecto consumidor para iconos adicionales
330
+ 4. Plugin descarga los SVGs del set combinado
331
+
332
+ El manifiesto asegura que los iconos de `RsSidebar`, `RsAccountSelector`, etc. esten
333
+ siempre disponibles, incluso si el proyecto consumidor no usa esos componentes.
256
334
 
257
335
  ---
258
336
 
259
337
  ## Best Practices
260
338
 
261
- ### For AI agents editing consuming projects
339
+ ### Para escribir codigo que se detecta solo
262
340
 
263
- 1. **Static icons:** use `<RsIcon name="icon_name" />` — always detected by Pattern 1
264
- 2. **Object configs:** use `{ icon: "icon_name" }` — detected by Pattern 3
265
- 3. **Dynamic icons:** use magic comments or `include`
266
- 4. **PrimeVue buttons:** use `rsPrimeIcon('icon_name')` — detected by Pattern 2
267
- 5. **Props to RsSidebar:** icons in the `items` array objects are detected by Pattern 3
341
+ 1. **Usa `<RsIcon name="home" />`** — siempre detectado por Pattern 1
342
+ 2. **Declara iconos en objetos con `icon:`** — Pattern 3 extrae automaticamente
343
+ 3. **Nombra variables con "icon"** cuando almacenes nombres de icono — Patterns 5 y 5b se activan
344
+ 4. **Pasa iconos como string literal** a componentes con prop `icon` — Pattern 6a lo detecta
345
+ 5. **Usa `rsPrimeIcon("home")`** para PrimeVue — Pattern 2 lo cubre
268
346
 
269
- ### For humans
347
+ ### Para componentes que envuelven RsIcon
348
+
349
+ Si creas un componente que recibe un icono por prop y lo pasa a `<RsIcon :name>`:
350
+
351
+ - Usa `defineProps` con el nombre del prop tipado
352
+ - Usa `defineOptions({ name: "ComponentName" })` para registrar el nombre
353
+ - Pattern 6b lo detectara automaticamente
354
+
355
+ Ejemplo:
356
+ ```vue
357
+ <script setup lang="ts">
358
+ defineOptions({ name: "MyIconButton" })
359
+ defineProps<{ icon: string }>()
360
+ </script>
361
+ <template>
362
+ <button><RsIcon :name="icon" /></button>
363
+ </template>
364
+ ```
270
365
 
271
- When adding a new icon to the codebase:
272
- 1. Check if it's statically detectable (direct string literal)
273
- 2. If not, add a magic comment near the usage
274
- 3. If the icon is used in many places, add it to the plugin config's `include`
366
+ ### Cuando nada funciona
275
367
 
276
- ### Tag helper
368
+ Usa magic comments o `include` — pero considera si podes reescribir el codigo para
369
+ que el scanner lo detecte automaticamente. Es menos mantenimiento a futuro.
277
370
 
278
- To quickly test if an icon name exists in the Material Symbols set:
371
+ ### Testing de nombres
279
372
 
280
373
  ```
281
374
  https://fonts.google.com/icons?icon.query=icon_name
@@ -287,7 +380,9 @@ https://fonts.google.com/icons?icon.query=icon_name
287
380
 
288
381
  | Date | Change |
289
382
  |------|--------|
383
+ | 2026-07-17 | Documentacion reestructurada: 8 patrones agrupados por categoria, automaticos primero |
384
+ | 2026-07-17 | **Pattern 5b** (icon objects), **Pattern 6a** (component icon prop), **Pattern 6b** (proxy components) added |
290
385
  | 2026-07-13 | **Pattern 4** (magic comments) and **Pattern 5** (icon arrays) added |
291
- | 2026-07-13 | `findEnclosingObject`: now handles comments, escaped quotes, and template literals |
292
- | 2026-07-13 | `resolveNames`: dynamic `:name` bindings no longer fall back to treating variable names as icon names |
293
- | 2026-07-13 | Pattern 3: weight and family are now extracted from the enclosing object literal |
386
+ | 2026-07-13 | `findEnclosingObject`: ahora maneja comentarios, strings escapados y template literals |
387
+ | 2026-07-13 | `resolveNames`: bindings `:name` dinamicos ya no tratan nombres de variable como iconos |
388
+ | 2026-07-13 | Pattern 3: weight y family se extraen del objeto contenedor |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robosophy/ui-vue",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://robosophy.gitlab.io/robosophy-basf/robosophy-library/",