@liquidcars/atlas 0.1.44 → 0.1.46

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/README.md CHANGED
@@ -159,16 +159,33 @@ La misma funcionalidad puede controlarse explícitamente:
159
159
 
160
160
  ```js
161
161
  const atlas = document.querySelector("liquidcars-atlas");
162
- const frame = atlas.captureFrame(); // canvas 2D con el framebuffer actual
162
+ const transparent = atlas.captureFrame(); // canvas 2D con alfa
163
+ const themed = atlas.captureFrame({ background: "theme" }); // añade el fondo visual del componente
164
+ const white = atlas.captureFrame({ background: "#ffffff" }); // fondo sólido opcional
165
+ const presentation = atlas.captureFrame({ background: "transparent", scale: 2 }); // salida HD
166
+ const copied = await atlas.copyFrame({ background: "theme", scale: 2 }); // portapapeles PNG
167
+ const portable = await atlas.copyFrame({ background: "transparent", scale: 2, fallback: "download" });
163
168
  atlas.prepareForPrint();
164
169
  atlas.restoreAfterPrint();
165
170
  ```
166
171
 
167
172
  `captureFrame()` usa `WebGLRenderingContext.readPixels()` para funcionar también
168
173
  en navegadores que no permiten copiar directamente un canvas WebGL sin
169
- `preserveDrawingBuffer`. Para evitar que un bloque se divida entre páginas, el
174
+ `preserveDrawingBuffer`. El framebuffer permanece transparente: el fondo de tema
175
+ se compone en el canvas 2D únicamente cuando se solicita y no recibe luces ni
176
+ sombras de la escena. `scale` vuelve a renderizar temporalmente entre 1× y 4×,
177
+ respetando el límite de framebuffer del navegador, y restaura inmediatamente el
178
+ canvas interactivo. Los colores WebGL semitransparentes se convierten de alfa
179
+ premultiplicado a alfa directo para conservar el tono de los contenedores
180
+ abiertos cuando el PNG se coloca sobre un fondo claro. Para evitar que un bloque se divida entre páginas, el
170
181
  componente aplica `break-inside: avoid` durante la impresión.
171
182
 
183
+ La toolbar incorpora las variantes PNG con fondo y transparente. Ambas usan
184
+ `copyFrame()` a resolución 2×; si el portapapeles de imágenes no está disponible,
185
+ la acción descarga `atlas-view.png`. La API emite `lc-image-export` con el método
186
+ empleado (`clipboard` o `download`) y `lc-image-export-error` si tampoco puede
187
+ generar el archivo.
188
+
172
189
  ## Contrato de datos
173
190
 
174
191
  - `palette`: mapa de nombres de color a valores CSS/hex.