@emasoft/svg-matrix 1.2.1 → 1.3.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/dist/version.json CHANGED
@@ -1,18 +1,46 @@
1
1
  {
2
- "version": "1.2.1",
3
- "buildTime": "2026-01-01T23:13:01.462Z",
4
- "files": [
5
- {
6
- "name": "svg-matrix.min.js",
7
- "size": 56185
8
- },
9
- {
10
- "name": "svg-toolbox.min.js",
11
- "size": 577277
12
- },
13
- {
14
- "name": "svgm.min.js",
15
- "size": 602660
16
- }
17
- ]
2
+ "version": "1.3.0",
3
+ "buildTime": "2026-01-06T06:30:13.714Z",
4
+ "bundles": {
5
+ "esm": [
6
+ {
7
+ "name": "svg-matrix.min.js",
8
+ "size": 56185,
9
+ "gzipSize": 19446,
10
+ "description": "ESM bundle for bundlers/Node.js (includes decimal.js)"
11
+ },
12
+ {
13
+ "name": "svg-toolbox.min.js",
14
+ "size": 577145,
15
+ "gzipSize": 152275,
16
+ "description": "ESM bundle for bundlers/Node.js (includes decimal.js)"
17
+ },
18
+ {
19
+ "name": "svgm.min.js",
20
+ "size": 602528,
21
+ "gzipSize": 159439,
22
+ "description": "ESM bundle for bundlers/Node.js (includes decimal.js)"
23
+ }
24
+ ],
25
+ "iife": [
26
+ {
27
+ "name": "svg-matrix.global.min.js",
28
+ "size": 56568,
29
+ "gzipSize": 19669,
30
+ "description": "IIFE bundle for browsers via <script> (includes decimal.js)"
31
+ },
32
+ {
33
+ "name": "svg-toolbox.global.min.js",
34
+ "size": 577274,
35
+ "gzipSize": 151612,
36
+ "description": "IIFE bundle for browsers via <script> (includes decimal.js)"
37
+ },
38
+ {
39
+ "name": "svgm.global.min.js",
40
+ "size": 0,
41
+ "gzipSize": 0,
42
+ "description": "IIFE bundle for browsers via <script> (includes decimal.js)"
43
+ }
44
+ ]
45
+ }
18
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emasoft/svg-matrix",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Arbitrary-precision matrix, vector and affine transformation library for JavaScript using decimal.js",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -12,6 +12,8 @@
12
12
  "test:embed:w3c": "node test/test-embed-w3c.js",
13
13
  "test:embed:w3c:all": "node test/test-embed-w3c-all.js",
14
14
  "test:toolbox:8bits": "node test/test-toolbox-matrix-8bits.js",
15
+ "test:fuzz": "node test/test-path-fuzz.js",
16
+ "test:browser:bundles": "node test/test-browser-bundles.js",
15
17
  "test:embed:browser": "node test/test-embed-playwright.js",
16
18
  "ci-test": "npm ci && npm test",
17
19
  "lint": "node bin/svglinter.cjs",
@@ -47,7 +49,11 @@
47
49
  "3d",
48
50
  "rotation",
49
51
  "translation",
50
- "homogeneous"
52
+ "homogeneous",
53
+ "font",
54
+ "embed",
55
+ "google-fonts",
56
+ "subsetting"
51
57
  ],
52
58
  "exports": {
53
59
  ".": {
@@ -84,15 +90,17 @@
84
90
  "bin": {
85
91
  "svg-matrix": "bin/svg-matrix.js",
86
92
  "svgm": "bin/svgm.js",
93
+ "svgfonts": "bin/svgfonts.js",
87
94
  "svglinter": "bin/svglinter.cjs"
88
95
  },
89
96
  "engines": {
90
- "node": ">=24.0.0"
97
+ "node": ">=18.0.0"
91
98
  },
92
99
  "files": [
93
100
  "src/",
94
101
  "bin/",
95
102
  "scripts/",
103
+ "templates/",
96
104
  "dist/",
97
105
  "LICENSE",
98
106
  "README.md"
@@ -586,7 +586,7 @@ function refineIntersection(bez1, bez2, t1, t2, tol) {
586
586
  // Check for convergence by step size
587
587
  if (dt1.abs().lt(tol) && dt2.abs().lt(tol)) {
588
588
  // BUGFIX: Compute fresh error value instead of using stale one from previous iteration
589
- // WHY: The `error` variable computed above (line 368) is from before the parameter update,
589
+ // WHY: The `error` variable computed above (line 553) is from before the parameter update,
590
590
  // so it may not reflect the final accuracy. We need to recompute error for the converged parameters.
591
591
  const [finalX, finalY] = bezierPoint(bez1, currentT1);
592
592
  const [finalX2, finalY2] = bezierPoint(bez2, currentT2);
@@ -14,7 +14,6 @@
14
14
  */
15
15
 
16
16
  import Decimal from "decimal.js";
17
- import { Matrix as _Matrix } from "./matrix.js";
18
17
  import * as SVGFlatten from "./svg-flatten.js";
19
18
 
20
19
  // Playwright is loaded dynamically to avoid crashes when not installed
@@ -1464,7 +1464,9 @@ export function resolveNestedClipPath(
1464
1464
  let clipPolygon = resolveClipPath(clipPathDef, targetElement, ctm, options);
1465
1465
 
1466
1466
  if (clipPathDef["clip-path"] && clipPolygon.length >= 3) {
1467
- const nestedRef = clipPathDef["clip-path"].replace(/^url\(#?|[)'"]/g, "");
1467
+ // Extract clipPath ID from url(#id), url('#id'), or url("#id") formats
1468
+ // WHY: Robust extraction handles quoted and unquoted references correctly
1469
+ const nestedRef = clipPathDef["clip-path"].replace(/^url\(['"]?#?|['"]?\)$/g, "");
1468
1470
  const nestedClipDef = defsMap.get(nestedRef);
1469
1471
  if (!nestedClipDef) {
1470
1472
  Logger.warn(