svg-path-commander 0.1.24 → 0.2.0-alpha2

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.
Files changed (72) hide show
  1. package/README.md +5 -3
  2. package/dist/svg-path-commander.es5.js +3948 -0
  3. package/dist/svg-path-commander.es5.min.js +2 -0
  4. package/dist/svg-path-commander.esm.js +428 -407
  5. package/dist/svg-path-commander.esm.min.js +2 -2
  6. package/dist/svg-path-commander.js +1434 -1515
  7. package/dist/svg-path-commander.min.js +2 -2
  8. package/package.json +15 -2
  9. package/src/convert/pathToAbsolute.js +4 -4
  10. package/src/convert/pathToCurve.js +2 -2
  11. package/src/convert/pathToRelative.js +4 -4
  12. package/src/convert/pathToString.js +2 -2
  13. package/src/math/polygonLength.js +1 -2
  14. package/src/options/options.js +1 -1
  15. package/src/parser/error.js +2 -0
  16. package/src/parser/finalizeSegment.js +1 -1
  17. package/src/parser/isSpace.js +1 -1
  18. package/src/parser/paramsParser.js +1 -1
  19. package/src/parser/parsePathString.js +6 -11
  20. package/src/parser/pathParser.js +1 -1
  21. package/src/parser/scanFlag.js +3 -3
  22. package/src/parser/scanParam.js +7 -6
  23. package/src/parser/scanSegment.js +3 -2
  24. package/src/parser/skipSpaces.js +1 -1
  25. package/src/process/clonePath.js +1 -1
  26. package/src/process/fixArc.js +1 -1
  27. package/src/process/fixPath.js +2 -2
  28. package/src/process/getSVGMatrix.js +3 -2
  29. package/src/process/normalizePath.js +3 -3
  30. package/src/process/normalizeSegment.js +2 -2
  31. package/src/process/optimizePath.js +2 -2
  32. package/src/process/projection2d.js +2 -2
  33. package/src/process/reverseCurve.js +3 -3
  34. package/src/process/reversePath.js +4 -5
  35. package/src/process/roundPath.js +7 -6
  36. package/src/process/segmentToCubic.js +3 -3
  37. package/src/process/shortenSegment.js +3 -3
  38. package/src/process/splitCubic.js +1 -1
  39. package/src/process/splitPath.js +1 -1
  40. package/src/process/transformPath.js +8 -7
  41. package/src/svg-path-commander.js +60 -20
  42. package/src/util/getClosestPoint.js +1 -1
  43. package/src/util/getCubicSize.js +1 -1
  44. package/src/util/getDrawDirection.js +1 -1
  45. package/src/util/getPathArea.js +1 -1
  46. package/src/util/getPathBBox.js +2 -2
  47. package/src/util/getPathLength.js +1 -1
  48. package/src/util/getPointAtLength.js +1 -1
  49. package/src/util/getPropertiesAtLength.js +3 -3
  50. package/src/util/getPropertiesAtPoint.js +2 -2
  51. package/src/util/getSegmentAtLength.js +2 -2
  52. package/src/util/getSegmentOfPoint.js +2 -2
  53. package/src/util/getTotalLength.js +1 -1
  54. package/src/util/isAbsoluteArray.js +1 -1
  55. package/src/util/isCurveArray.js +1 -1
  56. package/src/util/isNormalizedArray.js +1 -1
  57. package/src/util/isPathArray.js +1 -1
  58. package/src/util/isPointInStroke.js +2 -2
  59. package/src/util/isRelativeArray.js +1 -1
  60. package/src/util/pathLengthFactory.js +3 -2
  61. package/src/util/segmentArcFactory.js +1 -1
  62. package/src/util/segmentCubicFactory.js +1 -1
  63. package/src/util/segmentLineFactory.js +1 -1
  64. package/src/util/segmentQuadFactory.js +1 -1
  65. package/src/util/shapeToPath.js +14 -14
  66. package/src/util/util.js +0 -2
  67. package/types/index.d.ts +1 -3
  68. package/types/more/modules.ts +0 -3
  69. package/types/more/svg.d.ts +11 -10
  70. package/types/svg-path-commander.d.ts +214 -226
  71. package/src/util/createPath.js +0 -17
  72. package/src/util/getPointAtPathLength.js +0 -15
@@ -1,17 +0,0 @@
1
- import shapeToPath from './shapeToPath';
2
-
3
- /**
4
- * Returns a new `<path>` from a `<glyph>` element, only using its `d` attribute,
5
- * all other attributes are ignored.
6
- *
7
- * If `pathInput` is a valid path string, will create a `<path>` and return it.
8
- *
9
- * @deprecated
10
- * @see shapeToPath a new and more flexible utility
11
- *
12
- * @param {SVGPathCommander.shapeTypes} pathInput a `<glyph>` element or path string
13
- * @returns {SVGPathElement | boolean} a new `<path>` element
14
- */
15
- export default function createPath(pathInput) {
16
- return shapeToPath(pathInput, true);
17
- }
@@ -1,15 +0,0 @@
1
- import getPointAtLength from './getPointAtLength';
2
-
3
- /**
4
- * Returns [x,y] coordinates of a point at a given length of a shape.
5
- * `pathToCurve` version.
6
- *
7
- * @deprecated
8
- *
9
- * @param {string | SVGPathCommander.pathArray} pathInput the `pathArray` to look into
10
- * @param {number} distance the length of the shape to look at
11
- * @returns {{x: number, y: number}} the requested {x, y} point coordinates
12
- */
13
- export default function getPointAtPathLength(pathInput, distance) {
14
- return getPointAtLength(pathInput, distance);
15
- }