svg-path-commander 2.0.5 → 2.0.7
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/.eslintrc.cjs +1 -1
- package/.lgtm.yml +0 -0
- package/.prettierrc.json +0 -0
- package/LICENSE +0 -0
- package/README.md +5 -5
- package/cypress/e2e/svg-path-commander.spec.ts +1 -1
- package/cypress/fixtures/shapeObjects.js +0 -0
- package/cypress/fixtures/shapes.js +7 -7
- package/cypress/fixtures/simpleShapes.js +0 -0
- package/cypress/plugins/esbuild-istanbul.ts +0 -0
- package/cypress/plugins/tsCompile.ts +0 -0
- package/cypress/support/commands.ts +0 -0
- package/cypress/support/e2e.ts +0 -0
- package/cypress/test.html +0 -0
- package/cypress.config.ts +0 -0
- package/dist/svg-path-commander.cjs +1 -1
- package/dist/svg-path-commander.cjs.map +1 -1
- package/dist/svg-path-commander.d.ts +8 -0
- package/dist/svg-path-commander.js +1 -1
- package/dist/svg-path-commander.js.map +1 -1
- package/dist/svg-path-commander.mjs +66 -63
- package/dist/svg-path-commander.mjs.map +1 -1
- package/dts.config.ts +0 -0
- package/package.json +13 -13
- package/src/convert/pathToAbsolute.ts +0 -0
- package/src/convert/pathToCurve.ts +0 -0
- package/src/convert/pathToRelative.ts +0 -0
- package/src/convert/pathToString.ts +0 -0
- package/src/index.ts +2 -0
- package/src/interface.ts +0 -0
- package/src/math/distanceSquareRoot.ts +0 -0
- package/src/math/midPoint.ts +0 -0
- package/src/math/polygonArea.ts +0 -0
- package/src/math/polygonLength.ts +0 -0
- package/src/math/rotateVector.ts +0 -0
- package/src/options/options.ts +0 -0
- package/src/parser/error.ts +0 -0
- package/src/parser/finalizeSegment.ts +0 -0
- package/src/parser/invalidPathValue.ts +0 -0
- package/src/parser/isArcCommand.ts +0 -0
- package/src/parser/isDigit.ts +0 -0
- package/src/parser/isDigitStart.ts +0 -0
- package/src/parser/isPathCommand.ts +0 -0
- package/src/parser/isSpace.ts +0 -0
- package/src/parser/paramsCount.ts +0 -0
- package/src/parser/paramsParser.ts +0 -0
- package/src/parser/parsePathString.ts +0 -0
- package/src/parser/pathParser.ts +0 -0
- package/src/parser/scanFlag.ts +0 -0
- package/src/parser/scanParam.ts +0 -0
- package/src/parser/scanSegment.ts +0 -0
- package/src/parser/skipSpaces.ts +0 -0
- package/src/process/arcToCubic.ts +0 -0
- package/src/process/fixArc.ts +0 -0
- package/src/process/getSVGMatrix.ts +0 -0
- package/src/process/lineToCubic.ts +3 -3
- package/src/process/normalizePath.ts +0 -0
- package/src/process/normalizeSegment.ts +0 -0
- package/src/process/optimizePath.ts +0 -0
- package/src/process/projection2d.ts +0 -0
- package/src/process/quadToCubic.ts +0 -0
- package/src/process/reverseCurve.ts +0 -0
- package/src/process/reversePath.ts +0 -0
- package/src/process/roundPath.ts +0 -0
- package/src/process/segmentToCubic.ts +0 -0
- package/src/process/shortenSegment.ts +0 -0
- package/src/process/splitCubic.ts +0 -0
- package/src/process/splitPath.ts +0 -0
- package/src/process/transformPath.ts +0 -0
- package/src/types.ts +0 -0
- package/src/util/getClosestPoint.ts +0 -0
- package/src/util/getDrawDirection.ts +0 -0
- package/src/util/getPathArea.ts +0 -0
- package/src/util/getPathBBox.ts +0 -0
- package/src/util/getPointAtLength.ts +0 -0
- package/src/util/getPropertiesAtLength.ts +0 -0
- package/src/util/getPropertiesAtPoint.ts +0 -0
- package/src/util/getSegmentAtLength.ts +0 -0
- package/src/util/getSegmentOfPoint.ts +0 -0
- package/src/util/getTotalLength.ts +0 -0
- package/src/util/isAbsoluteArray.ts +0 -0
- package/src/util/isCurveArray.ts +0 -0
- package/src/util/isNormalizedArray.ts +0 -0
- package/src/util/isPathArray.ts +0 -0
- package/src/util/isPointInStroke.ts +0 -0
- package/src/util/isRelativeArray.ts +0 -0
- package/src/util/isValidPath.ts +0 -0
- package/src/util/pathLengthFactory.ts +0 -0
- package/src/util/segmentArcFactory.ts +0 -0
- package/src/util/segmentCubicFactory.ts +0 -0
- package/src/util/segmentLineFactory.ts +0 -0
- package/src/util/segmentQuadFactory.ts +0 -0
- package/src/util/shapeParams.ts +0 -0
- package/src/util/shapeToPath.ts +0 -0
- package/src/util/shapeToPathArray.ts +0 -0
- package/tsconfig.json +0 -0
- package/vite.config.ts +0 -0
package/dts.config.ts
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "svg-path-commander",
|
|
3
3
|
"author": "thednp",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.7",
|
|
6
6
|
"description": "Modern TypeScript tools for SVG",
|
|
7
7
|
"source": "./src/index.ts",
|
|
8
8
|
"main": "./dist/svg-path-commander.js",
|
|
@@ -53,26 +53,26 @@
|
|
|
53
53
|
"homepage": "http://thednp.github.io/svg-path-commander",
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
|
|
56
|
-
"@cypress/code-coverage": "^3.10.
|
|
56
|
+
"@cypress/code-coverage": "^3.10.7",
|
|
57
57
|
"@types/istanbul-lib-instrument": "^1.7.4",
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
59
|
-
"@typescript-eslint/parser": "^5.
|
|
60
|
-
"cypress": "^12.
|
|
61
|
-
"dts-bundle-generator": "^
|
|
62
|
-
"eslint": "^8.
|
|
63
|
-
"eslint-plugin-jsdoc": "^
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
|
59
|
+
"@typescript-eslint/parser": "^5.59.9",
|
|
60
|
+
"cypress": "^12.14.0",
|
|
61
|
+
"dts-bundle-generator": "^8.0.1",
|
|
62
|
+
"eslint": "^8.42.0",
|
|
63
|
+
"eslint-plugin-jsdoc": "^46.2.6",
|
|
64
64
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
65
65
|
"eslint-plugin-prettier": "^4.2.1",
|
|
66
66
|
"istanbul-lib-coverage": "^3.2.0",
|
|
67
67
|
"istanbul-lib-instrument": "^5.2.1",
|
|
68
68
|
"ncp": "^2.0.0",
|
|
69
69
|
"nyc": "^15.1.0",
|
|
70
|
-
"prettier": "^2.8.
|
|
71
|
-
"rimraf": "^
|
|
72
|
-
"typescript": "^5.
|
|
73
|
-
"vite": "^4.
|
|
70
|
+
"prettier": "^2.8.8",
|
|
71
|
+
"rimraf": "^5.0.1",
|
|
72
|
+
"typescript": "^5.1.3",
|
|
73
|
+
"vite": "^4.3.9"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@thednp/dommatrix": "^2.0.
|
|
76
|
+
"@thednp/dommatrix": "^2.0.5"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ import shapeToPath from './util/shapeToPath';
|
|
|
34
34
|
|
|
35
35
|
import roundPath from './process/roundPath';
|
|
36
36
|
import splitPath from './process/splitPath';
|
|
37
|
+
import getSVGMatrix from './process/getSVGMatrix';
|
|
37
38
|
import optimizePath from './process/optimizePath';
|
|
38
39
|
import reverseCurve from './process/reverseCurve';
|
|
39
40
|
import reversePath from './process/reversePath';
|
|
@@ -59,6 +60,7 @@ import pathToString from './convert/pathToString';
|
|
|
59
60
|
class SVGPathCommander {
|
|
60
61
|
// bring main utilities to front
|
|
61
62
|
public static CSSMatrix = CSSMatrix;
|
|
63
|
+
public static getSVGMatrix = getSVGMatrix;
|
|
62
64
|
public static getPathBBox = getPathBBox;
|
|
63
65
|
public static getPathArea = getPathArea;
|
|
64
66
|
public static getTotalLength = getTotalLength;
|
package/src/interface.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/math/midPoint.ts
CHANGED
|
File without changes
|
package/src/math/polygonArea.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/math/rotateVector.ts
CHANGED
|
File without changes
|
package/src/options/options.ts
CHANGED
|
File without changes
|
package/src/parser/error.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/parser/isDigit.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/parser/isSpace.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/parser/pathParser.ts
CHANGED
|
File without changes
|
package/src/parser/scanFlag.ts
CHANGED
|
File without changes
|
package/src/parser/scanParam.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/parser/skipSpaces.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/process/fixArc.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -10,8 +10,8 @@ import midPoint from '../math/midPoint';
|
|
|
10
10
|
* @returns the cubic-bezier segment
|
|
11
11
|
*/
|
|
12
12
|
const lineToCubic = (x1: number, y1: number, x2: number, y2: number) => {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
return [...
|
|
13
|
+
const c1 = midPoint([x1, y1], [x2, y2], 1.0 / 3.0);
|
|
14
|
+
const c2 = midPoint([x1, y1], [x2, y2], 2.0 / 3.0);
|
|
15
|
+
return [...c1, ...c2, x2, y2];
|
|
16
16
|
};
|
|
17
17
|
export default lineToCubic;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/process/roundPath.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/process/splitPath.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/types.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/util/getPathArea.ts
CHANGED
|
File without changes
|
package/src/util/getPathBBox.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/util/isCurveArray.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/util/isPathArray.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/util/isValidPath.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/util/shapeParams.ts
CHANGED
|
File without changes
|
package/src/util/shapeToPath.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/tsconfig.json
CHANGED
|
File without changes
|
package/vite.config.ts
CHANGED
|
File without changes
|