@zumer/snapdom 3.0.0-beta.0 → 3.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.
- package/README.md +10 -8
- package/dist/snapdom.js +10 -10
- package/dist/snapdom.mjs +10 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Export images and canvas with the core. Use plugins for self-contained HTML, pag
|
|
|
42
42
|
|
|
43
43
|
[Documentation and demos](https://snapdom.dev/) · [Technical features](FEATURES.md) · [Official plugins](packages/plugins/README.md) · [简体中文](README_CN.md)
|
|
44
44
|
|
|
45
|
-
This checkout documents **v3**. The migration guide below compares it with
|
|
45
|
+
This checkout documents **v3.x.x**. The migration guide below compares it with **v2.x.x**. The [v2 source](https://github.com/zumerlab/snapdom/tree/v2) and [v2 documentation](https://snapdom.dev/v2/) remain available.
|
|
46
46
|
|
|
47
47
|
## What you can build
|
|
48
48
|
|
|
@@ -84,13 +84,13 @@ The result keeps that capture even if the source element later changes. Call `sn
|
|
|
84
84
|
Install the core and, when you need them, the official plugins; use matching major versions:
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
|
-
npm i @zumer/snapdom @zumer/snapdom-plugins
|
|
87
|
+
npm i @zumer/snapdom@latest @zumer/snapdom-plugins@latest
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
Or load it in a browser:
|
|
91
91
|
|
|
92
92
|
```html
|
|
93
|
-
<script src="https://unpkg.com/@zumer/snapdom/dist/snapdom.js"></script>
|
|
93
|
+
<script src="https://unpkg.com/@zumer/snapdom@latest/dist/snapdom.js"></script>
|
|
94
94
|
<script>
|
|
95
95
|
snapdom.toPng(document.querySelector('#card')).then(image => {
|
|
96
96
|
document.body.appendChild(image);
|
|
@@ -101,11 +101,11 @@ Or load it in a browser:
|
|
|
101
101
|
As an ES module from a CDN:
|
|
102
102
|
|
|
103
103
|
```js
|
|
104
|
-
import { snapdom } from 'https://esm.sh/@zumer/snapdom';
|
|
105
|
-
import { htmlExport } from 'https://esm.sh/@zumer/snapdom-plugins/html-export';
|
|
104
|
+
import { snapdom } from 'https://esm.sh/@zumer/snapdom@latest';
|
|
105
|
+
import { htmlExport } from 'https://esm.sh/@zumer/snapdom-plugins@latest/html-export';
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
`https://unpkg.com/@zumer/snapdom/dist/snapdom.mjs` serves the same module.
|
|
108
|
+
`https://unpkg.com/@zumer/snapdom@latest/dist/snapdom.mjs` serves the same module. These examples load the latest published core and plugins.
|
|
109
109
|
|
|
110
110
|
To run the docs site against a local build of this checkout instead:
|
|
111
111
|
|
|
@@ -236,7 +236,7 @@ The second engine is experimental: it still needs a compatible browser with its
|
|
|
236
236
|
|
|
237
237
|
## Migrating from v2
|
|
238
238
|
|
|
239
|
-
The main capture pattern remains `snapdom(element, options)`. This guide compares v3 with **v2.
|
|
239
|
+
The main capture pattern remains `snapdom(element, options)`. This guide compares v3 with **v2.x.x**; review these changes before upgrading:
|
|
240
240
|
|
|
241
241
|
| In v2 | In v3 | What to change |
|
|
242
242
|
| --- | --- | --- |
|
|
@@ -251,6 +251,7 @@ The main capture pattern remains `snapdom(element, options)`. This guide compare
|
|
|
251
251
|
| `resolvePicturePlaceholders` / `pictureResolver` configured lazy-image preparation | Responsive/lazy image resolution happens on the clone; these options are no longer documented or supported | Remove the options and handle custom loading/timeouts in your app before capture; the engine still reads `resolvePicturePlaceholders` for internal use, do not rely on it |
|
|
252
252
|
| Some visible input values were redacted | Core masks passwords only | Add `redactInputs()` for other fields |
|
|
253
253
|
| `afterExport` returns became the next hook's payload, not the caller's result | Returns are ignored; hooks receive the same export payload | Stop chaining through return values; use `defineExports` to produce a different output |
|
|
254
|
+
| Plugins v2.x.x exposed `@zumer/snapdom-plugins/html-in-canvas` | That subpath is removed | Use the experimental core `engine: 'html-in-canvas'` with a compatible custom build; the default build uses SVG |
|
|
254
255
|
| TypeScript exported `PluginExportFacade` | The named type is removed; `ctx.exports` still provides core exporters | Infer it in `defineExports`, or use `NonNullable<CaptureContext['exports']>` |
|
|
255
256
|
|
|
256
257
|
### Use filter and exclude together
|
|
@@ -309,6 +310,7 @@ For a useful comparison, use the same scene, output format, scale and DPR. Compa
|
|
|
309
310
|
|
|
310
311
|
## Documentation
|
|
311
312
|
|
|
313
|
+
- [Archived v2 documentation](https://snapdom.dev/v2/) and [v2 source](https://github.com/zumerlab/snapdom/tree/v2)
|
|
312
314
|
- [API](https://snapdom.dev/docs/api/) and [options](https://snapdom.dev/docs/options/)
|
|
313
315
|
- [Framework guides](https://snapdom.dev/guides/) and [how-to examples](https://snapdom.dev/how-to/)
|
|
314
316
|
- [Official plugins](packages/plugins/README.md), [plugin specification](PLUGIN_SPEC.md) and [contributing plugins](CONTRIBUTING_PLUGINS.md)
|
|
@@ -346,6 +348,7 @@ npm run test:pack
|
|
|
346
348
|
<a href="https://github.com/jswhisperer" title="jswhisperer"><img src="https://avatars.githubusercontent.com/u/1177690?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="jswhisperer"/></a>
|
|
347
349
|
<a href="https://github.com/K1ender" title="K1ender"><img src="https://avatars.githubusercontent.com/u/146767945?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="K1ender"/></a>
|
|
348
350
|
<a href="https://github.com/mosuzi" title="mosuzi"><img src="https://avatars.githubusercontent.com/u/43341701?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="mosuzi"/></a>
|
|
351
|
+
<a href="https://github.com/ninecc" title="ninecc"><img src="https://avatars.githubusercontent.com/u/18310590?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="ninecc"/></a>
|
|
349
352
|
<a href="https://github.com/17biubiu" title="17biubiu"><img src="https://avatars.githubusercontent.com/u/13295895?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="17biubiu"/></a>
|
|
350
353
|
<a href="https://github.com/av01d" title="av01d"><img src="https://avatars.githubusercontent.com/u/6247646?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="av01d"/></a>
|
|
351
354
|
<a href="https://github.com/CHOYSEN" title="CHOYSEN"><img src="https://avatars.githubusercontent.com/u/25995358?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="CHOYSEN"/></a>
|
|
@@ -362,7 +365,6 @@ npm run test:pack
|
|
|
362
365
|
<a href="https://github.com/titoBouzout" title="titoBouzout"><img src="https://avatars.githubusercontent.com/u/64156?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="titoBouzout"/></a>
|
|
363
366
|
<a href="https://github.com/ZiuChen" title="ZiuChen"><img src="https://avatars.githubusercontent.com/u/64892985?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="ZiuChen"/></a>
|
|
364
367
|
<a href="https://github.com/adajoy" title="adajoy"><img src="https://avatars.githubusercontent.com/u/26210079?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="adajoy"/></a>
|
|
365
|
-
<a href="https://github.com/hjl12345" title="hjl12345"><img src="https://avatars.githubusercontent.com/u/170017602?v=4&s=100" style="border-radius:10px; width:60px; height:60px; object-fit:cover; margin:5px;" alt="hjl12345"/></a>
|
|
366
368
|
</p>
|
|
367
369
|
<!-- CONTRIBUTORS:END -->
|
|
368
370
|
|