@zumer/snapdom 2.24.7 → 2.24.10
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 +14 -7
- package/dist/plugins.mjs +1 -1
- package/dist/preCache.mjs +1 -1
- package/dist/snapdom.js +9 -9
- package/dist/snapdom.mjs +9 -9
- package/package.json +6 -2
- package/types/snapdom.d.ts +43 -13
package/README.md
CHANGED
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
|
|
37
37
|
# SnapDOM
|
|
38
38
|
|
|
39
|
-
**SnapDOM** is a next-generation **DOM Capture Engine
|
|
40
|
-
It converts any DOM subtree into a self-contained representation that can be exported to SVG, PNG, JPG, WebP, Canvas, Blob, or **any custom format** through plugins
|
|
39
|
+
**SnapDOM** is a next-generation **DOM Capture Engine**: the fast, modern alternative to **html2canvas**, **dom-to-image**, and **html-to-image**.
|
|
40
|
+
It converts any DOM subtree into a self-contained representation that can be exported to SVG, PNG, JPG, WebP, Canvas, Blob, or **any custom format** through plugins. Ultra-fast, modular, extensible, and dependency-free.
|
|
41
41
|
|
|
42
42
|
> 📖 **[Documentation, guides & live demos → snapdom.dev](https://snapdom.dev)**
|
|
43
43
|
|
|
44
44
|
## Features
|
|
45
45
|
|
|
46
|
-
Full DOM capture with embedded styles, pseudo-elements and fonts; export to SVG, PNG, JPG, WebP, `canvas` or Blob
|
|
46
|
+
Full DOM capture with embedded styles, pseudo-elements and fonts; export to SVG, PNG, JPG, WebP, `canvas` or Blob. Ultra fast, dependency-free, and 100% based on standard Web APIs.
|
|
47
47
|
|
|
48
48
|
👉 **See the complete technical feature list in [FEATURES.md](FEATURES.md).**
|
|
49
49
|
|
|
@@ -157,7 +157,14 @@ import { snapdom } from '@zumer/snapdom'; // → dist/snapdom.mjs
|
|
|
157
157
|
**Subpath imports** (lighter bundle if you only need one):
|
|
158
158
|
```js
|
|
159
159
|
import { preCache } from '@zumer/snapdom/preCache';
|
|
160
|
-
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Official plugins** live in their own package:
|
|
163
|
+
```bash
|
|
164
|
+
npm install @zumer/snapdom-plugins
|
|
165
|
+
```
|
|
166
|
+
```js
|
|
167
|
+
import { filter } from '@zumer/snapdom-plugins/filter';
|
|
161
168
|
```
|
|
162
169
|
|
|
163
170
|
|
|
@@ -223,7 +230,7 @@ The full reference lives on **[snapdom.dev/docs](https://snapdom.dev/docs/)**, k
|
|
|
223
230
|
- **[Plugins](https://snapdom.dev/docs/plugins/)**: build, register and ship custom plugins and export formats. Browse community plugins on the [plugins page](https://snapdom.dev/plugins.html).
|
|
224
231
|
- **[Cache & preCache](https://snapdom.dev/docs/cache/)**: control caching between captures and preload resources.
|
|
225
232
|
|
|
226
|
-
Popular guides: **[
|
|
233
|
+
Popular guides: **[convert HTML to PNG](https://snapdom.dev/how-to/html-to-png/)** · **[tile a full-page capture](https://snapdom.dev/blog/huge-page-mosaic/)** · **[run SnapDOM from Playwright or Puppeteer](https://snapdom.dev/blog/dom-capture-boundaries/)** · **[how SnapDOM captures the DOM](https://snapdom.dev/blog/painting-without-canvas/)**
|
|
227
234
|
|
|
228
235
|
### API at a glance
|
|
229
236
|
|
|
@@ -278,8 +285,8 @@ All options are optional and can be passed to `snapdom(el, options)` or any shor
|
|
|
278
285
|
## Limitations
|
|
279
286
|
|
|
280
287
|
* External images should be CORS-accessible (use `useProxy` option for handling CORS denied)
|
|
281
|
-
* When WebP format is used on Safari, it will fallback to PNG rendering.
|
|
282
|
-
* `@font-face` CSS rule is well supported
|
|
288
|
+
* When WebP format is used on Safari, it will fallback to PNG rendering (verified on Safari 26.5: `canvas.toDataURL('image/webp')` returns PNG). `download()` keeps the `.webp` filename, so the saved file carries PNG bytes.
|
|
289
|
+
* `@font-face` CSS rule is well supported. Fonts registered from JavaScript with `FontFace()` are *not* embedded automatically: list them in the `localFonts` option (`{ family, src }`), or use the workaround in [`#43`](https://github.com/zumerlab/snapdom/issues/43)
|
|
283
290
|
* **Safari**: captures with `embedFonts` or background/mask images run slower due to [WebKit #219770](https://bugs.webkit.org/show_bug.cgi?id=219770) (font decode timing). SnapDOM waits for the fonts the element actually uses and verifies the first canvas draw, so there is nothing to configure.
|
|
284
291
|
* **Custom scrollbar styles** (`::-webkit-scrollbar`): Applied only when the element has *not* been scrolled. When scrolled, the viewport content is captured without the scrollbar.
|
|
285
292
|
|
package/dist/plugins.mjs
CHANGED