@valcis/brand 2.1.0 → 2.1.1

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -0
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 valcis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -228,8 +228,26 @@ colors.semantic // Semánticos (success, warning, error, info)
228
228
  --valcis-logo-text
229
229
  ```
230
230
 
231
+ ## Datos del desarrollador
232
+
233
+ El Footer y el hook `useDevInfo` obtienen los datos de marca desde `https://valcis.es/api/dev-info.json`. Si el servidor no está disponible o el fetch falla (timeout de 2s, error de red, JSON inválido), se usa automáticamente un fallback local:
234
+
235
+ ```ts
236
+ {
237
+ version: 1,
238
+ brand: 'valcis',
239
+ contact: 'contacto@valcis.es',
240
+ website: 'https://valcis.es',
241
+ year: new Date().getFullYear(),
242
+ }
243
+ ```
244
+
245
+ En cliente, las respuestas se cachean en `localStorage` durante 1 hora para minimizar peticiones.
246
+
231
247
  ## SSR
232
248
 
249
+ Para evitar el fetch en cliente, puedes pre-cargar los datos en el servidor con `getDevInfo()`:
250
+
233
251
  ```tsx
234
252
  import { getDevInfo, Footer } from '@valcis/brand';
235
253
 
@@ -244,6 +262,8 @@ export default function Page({ devInfo }) {
244
262
  }
245
263
  ```
246
264
 
265
+ Si se pasa `initialDevInfo`, el componente no hace fetch.
266
+
247
267
  ## Assets estáticos
248
268
 
249
269
  El paquete incluye SVGs en `assets/` para uso fuera de React:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valcis/brand",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Componentes de marca valcis: Logo SVG y Footer React con soporte SSR",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",