@zumer/snapdom 1.9.12-dev.3 → 1.9.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/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@zumer/snapdom",
3
- "version": "1.9.12-dev.3",
3
+ "version": "1.9.13",
4
4
  "description": "snapDOM captures HTML elements to images with exceptional speed and accuracy.",
5
5
  "main": "dist/snapdom.js",
6
6
  "module": "dist/snapdom.mjs",
7
7
  "scripts": {
8
- "test": "npx vitest run --browser.headless --reporter=verbose",
8
+ "lint": "eslint src __tests__ --ext .js",
9
+ "lint:fix": "eslint src __tests__ --ext .js --fix",
10
+ "test": "npm run lint:fix && npx vitest run --browser.headless --reporter=verbose",
9
11
  "test:benchmark": "npx vitest bench --browser.headless --watch=false",
10
12
  "compile-browser": "npx @zumerbox/build -n snapdom -j src/index.browser.js -t es2015",
11
13
  "compile-esm": "npx @zumerbox/build -n snapdom -j src/index.js -p neutral -x",
@@ -65,8 +67,11 @@
65
67
  },
66
68
  "homepage": "https://zumerlab.github.io/snapdom/",
67
69
  "devDependencies": {
70
+ "@eslint/js": "^9.36.0",
68
71
  "@vitest/browser": "^3.1.2",
69
72
  "@vitest/coverage-v8": "^3.1.2",
73
+ "eslint": "^9.36.0",
74
+ "globals": "^16.4.0",
70
75
  "playwright": "^1.52.0"
71
76
  }
72
77
  }
@@ -85,7 +85,7 @@ export interface CaptureOptions {
85
85
  * Preferred export format used by convenience methods / download.
86
86
  * Default: "png"
87
87
  */
88
- format?: "svg" | RasterMime;
88
+ format?: BlobType;
89
89
 
90
90
  /** CSS selectors removed from the cloned subtree before processing. */
91
91
  exclude?: string[];
@@ -163,8 +163,23 @@ export interface CaptureOptions {
163
163
  * Default: "snapDOM"
164
164
  */
165
165
  filename?: string;
166
+
167
+ /**
168
+ * Normalize only translate*rotate* on the cloned root (keeps scale/skew intact).
169
+ * Children are not modified.
170
+ * Default: false
171
+ */
172
+ straighten?: boolean;
173
+
174
+ /**
175
+ * Do not expand the root viewBox for shadows/blur/outline/drop-shadow.
176
+ * Children are not modified. The root may also have those visuals cleared to avoid clipping.
177
+ * Default: false
178
+ */
179
+ noShadows?: boolean;
166
180
  }
167
181
 
182
+
168
183
  export interface BlobOptions {
169
184
  /** Blob type to export. Default: "svg". */
170
185
  type?: BlobType;
@@ -192,6 +207,8 @@ export interface CaptureResult {
192
207
  toRaw(): string;
193
208
  /** Creates an HTMLImageElement from the SVG (accepts options). */
194
209
  toImg(options?: CaptureOptions): Promise<HTMLImageElement>;
210
+ /** Creates an HTMLImageElement from the SVG (accepts options). */
211
+ toSvg(options?: CaptureOptions): Promise<HTMLImageElement>;
195
212
  /** Renders into a Canvas element (accepts options). */
196
213
  toCanvas(options?: CaptureOptions): Promise<HTMLCanvasElement>;
197
214
  /** Exports to a Blob (SVG/PNG/JPG/WebP). */
@@ -213,6 +230,7 @@ export declare function snapdom(el: Element, options?: CaptureOptions): Promise<
213
230
 
214
231
  export declare namespace snapdom {
215
232
  function toImg(el: Element, options?: CaptureOptions): Promise<HTMLImageElement>;
233
+ function toSvg(el: Element, options?: CaptureOptions): Promise<HTMLImageElement>;
216
234
  function toCanvas(el: Element, options?: CaptureOptions): Promise<HTMLCanvasElement>;
217
235
  function toBlob(el: Element, options?: CaptureOptions & BlobOptions): Promise<Blob>;
218
236
  function toPng(el: Element, options?: CaptureOptions): Promise<HTMLImageElement>;