@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/README.md +75 -0
- package/bin/svgfonts.js +1412 -0
- package/bin/svgm.js +1 -1
- package/dist/svg-matrix.global.min.js +8 -0
- package/dist/svg-matrix.min.js +2 -2
- package/dist/svg-toolbox.global.min.js +493 -0
- package/dist/svg-toolbox.min.js +16 -16
- package/dist/svgm.min.js +60 -60
- package/dist/version.json +44 -16
- package/package.json +11 -3
- package/src/bezier-intersections.js +1 -1
- package/src/browser-verify.js +0 -1
- package/src/clip-path-resolver.js +3 -1
- package/src/font-manager.js +1013 -0
- package/src/index.js +2 -2
- package/src/inkscape-support.js +2 -2
- package/src/mask-resolver.js +14 -6
- package/src/mesh-gradient.js +0 -2
- package/src/off-canvas-detection.js +14 -22
- package/src/svg-boolean-ops.js +0 -5
- package/src/svg-collections.js +11 -0
- package/src/svg-matrix-lib.js +2 -2
- package/src/svg-parser.js +0 -24
- package/src/svg-rendering-context.js +2 -4
- package/src/svg-toolbox-lib.js +2 -2
- package/src/svgm-lib.js +2 -2
- package/src/transform-optimization.js +93 -142
- package/src/verification.js +0 -2
- package/templates/svgm_replacement_map.yml +53 -0
package/dist/version.json
CHANGED
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
3
|
-
"buildTime": "2026-01-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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.
|
|
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": ">=
|
|
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
|
|
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);
|
package/src/browser-verify.js
CHANGED
|
@@ -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
|
-
|
|
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(
|