@retikz/core 0.3.0-alpha.5 → 0.3.0-beta.1
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/es/arrows/define.d.ts +9 -0
- package/dist/es/arrows/define.d.ts.map +1 -0
- package/dist/es/arrows/define.js +10 -0
- package/dist/es/arrows/index.d.ts +3 -1
- package/dist/es/arrows/index.d.ts.map +1 -1
- package/dist/es/arrows/index.js +14 -1
- package/dist/es/arrows/types.d.ts +4 -2
- package/dist/es/arrows/types.d.ts.map +1 -1
- package/dist/es/compile/anchor-cache.d.ts +3 -3
- package/dist/es/compile/anchor-cache.d.ts.map +1 -1
- package/dist/es/compile/anchor-cache.js +18 -5
- package/dist/es/compile/compile.d.ts +5 -14
- package/dist/es/compile/compile.d.ts.map +1 -1
- package/dist/es/compile/compile.js +39 -39
- package/dist/es/compile/{lowerComposites.d.ts → composite.d.ts} +9 -2
- package/dist/es/compile/composite.d.ts.map +1 -0
- package/dist/es/compile/{lowerComposites.js → composite.js} +9 -1
- package/dist/es/compile/constant.d.ts +32 -0
- package/dist/es/compile/constant.d.ts.map +1 -0
- package/dist/es/compile/constant.js +23 -0
- package/dist/es/compile/direction.d.ts +27 -0
- package/dist/es/compile/direction.d.ts.map +1 -0
- package/dist/es/compile/direction.js +30 -0
- package/dist/es/compile/index.d.ts +3 -1
- package/dist/es/compile/index.d.ts.map +1 -1
- package/dist/es/compile/name-stack.d.ts +3 -1
- package/dist/es/compile/name-stack.d.ts.map +1 -1
- package/dist/es/compile/name-stack.js +5 -1
- package/dist/es/compile/node.d.ts +18 -7
- package/dist/es/compile/node.d.ts.map +1 -1
- package/dist/es/compile/node.js +39 -63
- package/dist/es/compile/paint.js +1 -1
- package/dist/es/compile/path/anchor.d.ts +4 -3
- package/dist/es/compile/path/anchor.d.ts.map +1 -1
- package/dist/es/compile/path/anchor.js +9 -12
- package/dist/es/compile/path/index.d.ts +6 -8
- package/dist/es/compile/path/index.d.ts.map +1 -1
- package/dist/es/compile/path/index.js +57 -34
- package/dist/es/compile/path/relative.d.ts +1 -1
- package/dist/es/compile/path/relative.js +1 -1
- package/dist/es/compile/path/shrink.d.ts +3 -1
- package/dist/es/compile/path/shrink.d.ts.map +1 -1
- package/dist/es/compile/path/shrink.js +16 -11
- package/dist/es/compile/position.d.ts +2 -2
- package/dist/es/compile/position.d.ts.map +1 -1
- package/dist/es/compile/position.js +6 -19
- package/dist/es/compile/precision.d.ts +1 -1
- package/dist/es/compile/precision.d.ts.map +1 -1
- package/dist/es/compile/precision.js +2 -2
- package/dist/es/compile/scope.d.ts +7 -5
- package/dist/es/compile/scope.d.ts.map +1 -1
- package/dist/es/compile/scope.js +29 -13
- package/dist/es/compile/style.d.ts +2 -2
- package/dist/es/compile/style.d.ts.map +1 -1
- package/dist/es/compile/style.js +2 -2
- package/dist/es/composites/define.d.ts +8 -0
- package/dist/es/composites/define.d.ts.map +1 -0
- package/dist/es/composites/{types.js → define.js} +2 -2
- package/dist/es/composites/index.d.ts +1 -1
- package/dist/es/composites/index.d.ts.map +1 -1
- package/dist/es/composites/types.d.ts +0 -6
- package/dist/es/composites/types.d.ts.map +1 -1
- package/dist/es/geometry/anchor.d.ts +33 -0
- package/dist/es/geometry/anchor.d.ts.map +1 -0
- package/dist/es/geometry/anchor.js +45 -0
- package/dist/es/geometry/bend.d.ts +1 -1
- package/dist/es/geometry/bend.js +2 -2
- package/dist/es/geometry/circle.d.ts +4 -4
- package/dist/es/geometry/circle.d.ts.map +1 -1
- package/dist/es/geometry/circle.js +3 -3
- package/dist/es/geometry/{roundedContour.d.ts → contour.d.ts} +4 -5
- package/dist/es/geometry/contour.d.ts.map +1 -0
- package/dist/es/geometry/{roundedContour.js → contour.js} +22 -34
- package/dist/es/geometry/diamond.d.ts +3 -3
- package/dist/es/geometry/diamond.d.ts.map +1 -1
- package/dist/es/geometry/diamond.js +2 -2
- package/dist/{lib/geometry/_edge.d.ts → es/geometry/edge.d.ts} +1 -1
- package/dist/es/geometry/edge.d.ts.map +1 -0
- package/dist/es/geometry/{_edge.js → edge.js} +1 -1
- package/dist/es/geometry/ellipse.d.ts +3 -3
- package/dist/es/geometry/ellipse.d.ts.map +1 -1
- package/dist/es/geometry/ellipse.js +2 -2
- package/dist/es/geometry/index.d.ts +2 -1
- package/dist/es/geometry/index.d.ts.map +1 -1
- package/dist/es/geometry/point.d.ts +6 -0
- package/dist/es/geometry/point.d.ts.map +1 -1
- package/dist/es/geometry/point.js +17 -0
- package/dist/es/geometry/rect.d.ts +4 -17
- package/dist/es/geometry/rect.d.ts.map +1 -1
- package/dist/es/geometry/rect.js +4 -16
- package/dist/es/geometry/segment.d.ts.map +1 -1
- package/dist/es/geometry/segment.js +25 -47
- package/dist/{lib/geometry/_transform.d.ts → es/geometry/transform.d.ts} +1 -1
- package/dist/es/geometry/transform.d.ts.map +1 -0
- package/dist/es/geometry/{_transform.js → transform.js} +1 -1
- package/dist/es/index.d.ts +11 -11
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +17 -14
- package/dist/es/ir/animation.d.ts +6 -5
- package/dist/es/ir/animation.d.ts.map +1 -1
- package/dist/es/ir/boundary.d.ts +1 -1
- package/dist/es/ir/boundary.d.ts.map +1 -1
- package/dist/es/ir/coordinate.d.ts +8 -8
- package/dist/es/ir/node.d.ts +73 -72
- package/dist/es/ir/node.d.ts.map +1 -1
- package/dist/es/ir/node.js +23 -23
- package/dist/es/ir/paint.d.ts +19 -18
- package/dist/es/ir/paint.d.ts.map +1 -1
- package/dist/es/ir/paint.js +10 -10
- package/dist/es/ir/path/arrow.d.ts +15 -14
- package/dist/es/ir/path/arrow.d.ts.map +1 -1
- package/dist/es/ir/path/arrow.js +18 -16
- package/dist/es/ir/path/path.d.ts +893 -152
- package/dist/es/ir/path/path.d.ts.map +1 -1
- package/dist/es/ir/path/path.js +1 -1
- package/dist/es/ir/path/step.d.ts +932 -20
- package/dist/es/ir/path/step.d.ts.map +1 -1
- package/dist/es/ir/path/step.js +73 -22
- package/dist/es/ir/path/target.js +3 -3
- package/dist/es/ir/position/at-position.d.ts +18 -18
- package/dist/es/ir/position/at-position.d.ts.map +1 -1
- package/dist/es/ir/position/at-position.js +11 -11
- package/dist/es/ir/scope.d.ts +2559 -1057
- package/dist/es/ir/scope.d.ts.map +1 -1
- package/dist/es/ir/scope.js +5 -5
- package/dist/es/ir/transform.d.ts +44 -17
- package/dist/es/ir/transform.d.ts.map +1 -1
- package/dist/es/ir/transform.js +10 -3
- package/dist/es/parsers/index.d.ts +3 -3
- package/dist/es/parsers/index.d.ts.map +1 -1
- package/dist/es/parsers/{parseNodeTarget.d.ts → node-target.d.ts} +1 -1
- package/dist/es/parsers/node-target.d.ts.map +1 -0
- package/dist/es/parsers/{parseNodeTarget.js → node-target.js} +10 -8
- package/dist/{lib/parsers/parseTargetSugar.d.ts → es/parsers/target-sugar.d.ts} +1 -1
- package/dist/es/parsers/target-sugar.d.ts.map +1 -0
- package/dist/es/parsers/{parseTargetSugar.js → target-sugar.js} +9 -4
- package/dist/{lib/parsers/parseWay.d.ts → es/parsers/way.d.ts} +1 -1
- package/dist/es/parsers/way.d.ts.map +1 -0
- package/dist/es/parsers/{parseWay.js → way.js} +9 -5
- package/dist/es/path-generators/define.d.ts.map +1 -0
- package/dist/es/{pathGenerators → path-generators}/define.js +1 -1
- package/dist/es/path-generators/index.d.ts.map +1 -0
- package/dist/es/path-generators/types.d.ts.map +1 -0
- package/dist/es/patterns/define.d.ts +9 -0
- package/dist/es/patterns/define.d.ts.map +1 -0
- package/dist/es/patterns/define.js +10 -0
- package/dist/es/patterns/index.d.ts +1 -0
- package/dist/es/patterns/index.d.ts.map +1 -1
- package/dist/es/patterns/index.js +42 -35
- package/dist/es/presets/animation.js +2 -2
- package/dist/es/primitive/marker.d.ts +1 -1
- package/dist/es/primitive/paint.d.ts +1 -1
- package/dist/es/primitive/path.d.ts +1 -1
- package/dist/es/shapes/arc.js +2 -2
- package/dist/{lib/shapes/_contour.d.ts → es/shapes/contour.d.ts} +6 -3
- package/dist/es/shapes/contour.d.ts.map +1 -0
- package/dist/es/shapes/{_contour.js → contour.js} +14 -2
- package/dist/es/shapes/ellipse.js +2 -2
- package/dist/es/shapes/index.d.ts +1 -1
- package/dist/es/shapes/index.d.ts.map +1 -1
- package/dist/es/shapes/index.js +1 -1
- package/dist/es/shapes/polygon.d.ts +1 -1
- package/dist/es/shapes/polygon.d.ts.map +1 -1
- package/dist/es/shapes/polygon.js +26 -21
- package/dist/es/shapes/rectangle.js +5 -5
- package/dist/es/shapes/sector.d.ts.map +1 -1
- package/dist/es/shapes/sector.js +30 -22
- package/dist/es/shapes/{_shared.d.ts → shared.d.ts} +4 -8
- package/dist/es/shapes/shared.d.ts.map +1 -0
- package/dist/es/shapes/{_shared.js → shared.js} +8 -12
- package/dist/es/shapes/star.d.ts.map +1 -1
- package/dist/es/shapes/star.js +4 -14
- package/dist/lib/arrows/define.cjs +10 -0
- package/dist/lib/arrows/define.d.ts +9 -0
- package/dist/lib/arrows/define.d.ts.map +1 -0
- package/dist/lib/arrows/index.cjs +14 -1
- package/dist/lib/arrows/index.d.ts +3 -1
- package/dist/lib/arrows/index.d.ts.map +1 -1
- package/dist/lib/arrows/types.d.ts +4 -2
- package/dist/lib/arrows/types.d.ts.map +1 -1
- package/dist/lib/compile/anchor-cache.cjs +17 -4
- package/dist/lib/compile/anchor-cache.d.ts +3 -3
- package/dist/lib/compile/anchor-cache.d.ts.map +1 -1
- package/dist/lib/compile/compile.cjs +37 -37
- package/dist/lib/compile/compile.d.ts +5 -14
- package/dist/lib/compile/compile.d.ts.map +1 -1
- package/dist/lib/compile/{lowerComposites.cjs → composite.cjs} +9 -1
- package/dist/lib/compile/{lowerComposites.d.ts → composite.d.ts} +9 -2
- package/dist/lib/compile/composite.d.ts.map +1 -0
- package/dist/lib/compile/constant.cjs +24 -0
- package/dist/lib/compile/constant.d.ts +32 -0
- package/dist/lib/compile/constant.d.ts.map +1 -0
- package/dist/lib/compile/direction.cjs +31 -0
- package/dist/lib/compile/direction.d.ts +27 -0
- package/dist/lib/compile/direction.d.ts.map +1 -0
- package/dist/lib/compile/index.d.ts +3 -1
- package/dist/lib/compile/index.d.ts.map +1 -1
- package/dist/lib/compile/name-stack.cjs +5 -1
- package/dist/lib/compile/name-stack.d.ts +3 -1
- package/dist/lib/compile/name-stack.d.ts.map +1 -1
- package/dist/lib/compile/node.cjs +39 -62
- package/dist/lib/compile/node.d.ts +18 -7
- package/dist/lib/compile/node.d.ts.map +1 -1
- package/dist/lib/compile/paint.cjs +1 -1
- package/dist/lib/compile/path/anchor.cjs +10 -12
- package/dist/lib/compile/path/anchor.d.ts +4 -3
- package/dist/lib/compile/path/anchor.d.ts.map +1 -1
- package/dist/lib/compile/path/index.cjs +56 -33
- package/dist/lib/compile/path/index.d.ts +6 -8
- package/dist/lib/compile/path/index.d.ts.map +1 -1
- package/dist/lib/compile/path/relative.cjs +1 -1
- package/dist/lib/compile/path/relative.d.ts +1 -1
- package/dist/lib/compile/path/shrink.cjs +16 -11
- package/dist/lib/compile/path/shrink.d.ts +3 -1
- package/dist/lib/compile/path/shrink.d.ts.map +1 -1
- package/dist/lib/compile/position.cjs +6 -19
- package/dist/lib/compile/position.d.ts +2 -2
- package/dist/lib/compile/position.d.ts.map +1 -1
- package/dist/lib/compile/precision.cjs +2 -2
- package/dist/lib/compile/precision.d.ts +1 -1
- package/dist/lib/compile/precision.d.ts.map +1 -1
- package/dist/lib/compile/scope.cjs +29 -13
- package/dist/lib/compile/scope.d.ts +7 -5
- package/dist/lib/compile/scope.d.ts.map +1 -1
- package/dist/lib/compile/style.cjs +2 -2
- package/dist/lib/compile/style.d.ts +2 -2
- package/dist/lib/compile/style.d.ts.map +1 -1
- package/dist/lib/composites/{types.cjs → define.cjs} +2 -2
- package/dist/lib/composites/define.d.ts +8 -0
- package/dist/lib/composites/define.d.ts.map +1 -0
- package/dist/lib/composites/index.d.ts +1 -1
- package/dist/lib/composites/index.d.ts.map +1 -1
- package/dist/lib/composites/types.d.ts +0 -6
- package/dist/lib/composites/types.d.ts.map +1 -1
- package/dist/lib/geometry/anchor.cjs +47 -0
- package/dist/lib/geometry/anchor.d.ts +33 -0
- package/dist/lib/geometry/anchor.d.ts.map +1 -0
- package/dist/lib/geometry/bend.cjs +2 -2
- package/dist/lib/geometry/bend.d.ts +1 -1
- package/dist/lib/geometry/circle.cjs +9 -9
- package/dist/lib/geometry/circle.d.ts +4 -4
- package/dist/lib/geometry/circle.d.ts.map +1 -1
- package/dist/lib/geometry/{roundedContour.cjs → contour.cjs} +21 -32
- package/dist/lib/geometry/{roundedContour.d.ts → contour.d.ts} +4 -5
- package/dist/lib/geometry/contour.d.ts.map +1 -0
- package/dist/lib/geometry/diamond.cjs +7 -7
- package/dist/lib/geometry/diamond.d.ts +3 -3
- package/dist/lib/geometry/diamond.d.ts.map +1 -1
- package/dist/lib/geometry/{_edge.cjs → edge.cjs} +1 -1
- package/dist/{es/geometry/_edge.d.ts → lib/geometry/edge.d.ts} +1 -1
- package/dist/lib/geometry/edge.d.ts.map +1 -0
- package/dist/lib/geometry/ellipse.cjs +8 -8
- package/dist/lib/geometry/ellipse.d.ts +3 -3
- package/dist/lib/geometry/ellipse.d.ts.map +1 -1
- package/dist/lib/geometry/index.d.ts +2 -1
- package/dist/lib/geometry/index.d.ts.map +1 -1
- package/dist/lib/geometry/point.cjs +17 -0
- package/dist/lib/geometry/point.d.ts +6 -0
- package/dist/lib/geometry/point.d.ts.map +1 -1
- package/dist/lib/geometry/rect.cjs +9 -22
- package/dist/lib/geometry/rect.d.ts +4 -17
- package/dist/lib/geometry/rect.d.ts.map +1 -1
- package/dist/lib/geometry/segment.cjs +25 -47
- package/dist/lib/geometry/segment.d.ts.map +1 -1
- package/dist/lib/geometry/{_transform.cjs → transform.cjs} +1 -1
- package/dist/{es/geometry/_transform.d.ts → lib/geometry/transform.d.ts} +1 -1
- package/dist/lib/geometry/transform.d.ts.map +1 -0
- package/dist/lib/index.cjs +29 -22
- package/dist/lib/index.d.ts +11 -11
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/animation.d.ts +6 -5
- package/dist/lib/ir/animation.d.ts.map +1 -1
- package/dist/lib/ir/boundary.d.ts +1 -1
- package/dist/lib/ir/boundary.d.ts.map +1 -1
- package/dist/lib/ir/coordinate.d.ts +8 -8
- package/dist/lib/ir/node.cjs +23 -23
- package/dist/lib/ir/node.d.ts +73 -72
- package/dist/lib/ir/node.d.ts.map +1 -1
- package/dist/lib/ir/paint.cjs +10 -10
- package/dist/lib/ir/paint.d.ts +19 -18
- package/dist/lib/ir/paint.d.ts.map +1 -1
- package/dist/lib/ir/path/arrow.cjs +18 -16
- package/dist/lib/ir/path/arrow.d.ts +15 -14
- package/dist/lib/ir/path/arrow.d.ts.map +1 -1
- package/dist/lib/ir/path/path.cjs +1 -1
- package/dist/lib/ir/path/path.d.ts +893 -152
- package/dist/lib/ir/path/path.d.ts.map +1 -1
- package/dist/lib/ir/path/step.cjs +73 -21
- package/dist/lib/ir/path/step.d.ts +932 -20
- package/dist/lib/ir/path/step.d.ts.map +1 -1
- package/dist/lib/ir/path/target.cjs +3 -3
- package/dist/lib/ir/position/at-position.cjs +11 -11
- package/dist/lib/ir/position/at-position.d.ts +18 -18
- package/dist/lib/ir/position/at-position.d.ts.map +1 -1
- package/dist/lib/ir/scope.cjs +5 -5
- package/dist/lib/ir/scope.d.ts +2559 -1057
- package/dist/lib/ir/scope.d.ts.map +1 -1
- package/dist/lib/ir/transform.cjs +9 -2
- package/dist/lib/ir/transform.d.ts +44 -17
- package/dist/lib/ir/transform.d.ts.map +1 -1
- package/dist/lib/parsers/index.d.ts +3 -3
- package/dist/lib/parsers/index.d.ts.map +1 -1
- package/dist/lib/parsers/{parseNodeTarget.cjs → node-target.cjs} +10 -8
- package/dist/lib/parsers/{parseNodeTarget.d.ts → node-target.d.ts} +1 -1
- package/dist/lib/parsers/node-target.d.ts.map +1 -0
- package/dist/lib/parsers/{parseTargetSugar.cjs → target-sugar.cjs} +9 -4
- package/dist/{es/parsers/parseTargetSugar.d.ts → lib/parsers/target-sugar.d.ts} +1 -1
- package/dist/lib/parsers/target-sugar.d.ts.map +1 -0
- package/dist/lib/parsers/{parseWay.cjs → way.cjs} +12 -8
- package/dist/{es/parsers/parseWay.d.ts → lib/parsers/way.d.ts} +1 -1
- package/dist/lib/parsers/way.d.ts.map +1 -0
- package/dist/lib/{pathGenerators → path-generators}/define.cjs +1 -1
- package/dist/lib/path-generators/define.d.ts.map +1 -0
- package/dist/lib/path-generators/index.d.ts.map +1 -0
- package/dist/lib/path-generators/types.d.ts.map +1 -0
- package/dist/lib/patterns/define.cjs +10 -0
- package/dist/lib/patterns/define.d.ts +9 -0
- package/dist/lib/patterns/define.d.ts.map +1 -0
- package/dist/lib/patterns/index.cjs +42 -35
- package/dist/lib/patterns/index.d.ts +1 -0
- package/dist/lib/patterns/index.d.ts.map +1 -1
- package/dist/lib/presets/animation.cjs +2 -2
- package/dist/lib/primitive/marker.d.ts +1 -1
- package/dist/lib/primitive/paint.d.ts +1 -1
- package/dist/lib/primitive/path.d.ts +1 -1
- package/dist/lib/shapes/arc.cjs +4 -4
- package/dist/lib/shapes/{_contour.cjs → contour.cjs} +14 -1
- package/dist/{es/shapes/_contour.d.ts → lib/shapes/contour.d.ts} +6 -3
- package/dist/lib/shapes/contour.d.ts.map +1 -0
- package/dist/lib/shapes/ellipse.cjs +2 -2
- package/dist/lib/shapes/index.cjs +1 -1
- package/dist/lib/shapes/index.d.ts +1 -1
- package/dist/lib/shapes/index.d.ts.map +1 -1
- package/dist/lib/shapes/polygon.cjs +29 -24
- package/dist/lib/shapes/polygon.d.ts +1 -1
- package/dist/lib/shapes/polygon.d.ts.map +1 -1
- package/dist/lib/shapes/rectangle.cjs +11 -11
- package/dist/lib/shapes/sector.cjs +41 -33
- package/dist/lib/shapes/sector.d.ts.map +1 -1
- package/dist/lib/shapes/{_shared.cjs → shared.cjs} +7 -12
- package/dist/lib/shapes/{_shared.d.ts → shared.d.ts} +4 -8
- package/dist/lib/shapes/shared.d.ts.map +1 -0
- package/dist/lib/shapes/star.cjs +7 -17
- package/dist/lib/shapes/star.d.ts.map +1 -1
- package/package.json +2 -3
- package/dist/es/compile/lowerComposites.d.ts.map +0 -1
- package/dist/es/geometry/_edge.d.ts.map +0 -1
- package/dist/es/geometry/_transform.d.ts.map +0 -1
- package/dist/es/geometry/roundedContour.d.ts.map +0 -1
- package/dist/es/parsers/parseNodeTarget.d.ts.map +0 -1
- package/dist/es/parsers/parseTargetSugar.d.ts.map +0 -1
- package/dist/es/parsers/parseWay.d.ts.map +0 -1
- package/dist/es/pathGenerators/define.d.ts.map +0 -1
- package/dist/es/pathGenerators/index.d.ts.map +0 -1
- package/dist/es/pathGenerators/types.d.ts.map +0 -1
- package/dist/es/shapes/_contour.d.ts.map +0 -1
- package/dist/es/shapes/_shared.d.ts.map +0 -1
- package/dist/lib/compile/lowerComposites.d.ts.map +0 -1
- package/dist/lib/geometry/_edge.d.ts.map +0 -1
- package/dist/lib/geometry/_transform.d.ts.map +0 -1
- package/dist/lib/geometry/roundedContour.d.ts.map +0 -1
- package/dist/lib/parsers/parseNodeTarget.d.ts.map +0 -1
- package/dist/lib/parsers/parseTargetSugar.d.ts.map +0 -1
- package/dist/lib/parsers/parseWay.d.ts.map +0 -1
- package/dist/lib/pathGenerators/define.d.ts.map +0 -1
- package/dist/lib/pathGenerators/index.d.ts.map +0 -1
- package/dist/lib/pathGenerators/types.d.ts.map +0 -1
- package/dist/lib/shapes/_contour.d.ts.map +0 -1
- package/dist/lib/shapes/_shared.d.ts.map +0 -1
- /package/dist/es/{pathGenerators → path-generators}/define.d.ts +0 -0
- /package/dist/es/{pathGenerators → path-generators}/index.d.ts +0 -0
- /package/dist/es/{pathGenerators → path-generators}/types.d.ts +0 -0
- /package/dist/lib/{pathGenerators → path-generators}/define.d.ts +0 -0
- /package/dist/lib/{pathGenerators → path-generators}/index.d.ts +0 -0
- /package/dist/lib/{pathGenerators → path-generators}/types.d.ts +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const require_json = require("../ir/json.cjs");
|
|
2
|
-
const
|
|
2
|
+
const require_arc = require("../geometry/arc.cjs");
|
|
3
|
+
const require_anchor = require("../geometry/anchor.cjs");
|
|
3
4
|
const require_index = require("../shapes/index.cjs");
|
|
5
|
+
const require_direction = require("./direction.cjs");
|
|
4
6
|
const require_position = require("./position.cjs");
|
|
5
7
|
const require_text_baseline = require("./text-baseline.cjs");
|
|
6
8
|
const require_boundary = require("./boundary.cjs");
|
|
@@ -14,8 +16,8 @@ var EMPTY_SHAPE_PARAMS = {};
|
|
|
14
16
|
* @description 裸 string → `{ type, params: {} }`;`{ type, params? }` → params 缺省补 `{}`;
|
|
15
17
|
* 缺省(undefined)→ `{ type: 'rectangle', params: {} }`。`'circle'`(裸 string)消解为
|
|
16
18
|
* `{ type: 'ellipse', params: { circumscribe: 'equal' } }`——circle 无独立几何,是 ellipse 等轴 preset 别名。
|
|
17
|
-
* `'diamond'`(裸 string)消解为 `{ type: 'polygon', params: { sides: 4, rotate:
|
|
18
|
-
* 是 polygon 4
|
|
19
|
+
* `'diamond'`(裸 string)消解为 `{ type: 'polygon', params: { sides: 4, rotate: 0 } }`——diamond 无独立几何,
|
|
20
|
+
* 是 polygon 4 边形 preset 别名。仅做形态归一,不查表 / 不校验。
|
|
19
21
|
*/
|
|
20
22
|
var normalizeShape = (shape) => {
|
|
21
23
|
if (shape === void 0) return {
|
|
@@ -30,7 +32,7 @@ var normalizeShape = (shape) => {
|
|
|
30
32
|
type: "polygon",
|
|
31
33
|
params: {
|
|
32
34
|
sides: 4,
|
|
33
|
-
rotate:
|
|
35
|
+
rotate: 0
|
|
34
36
|
}
|
|
35
37
|
};
|
|
36
38
|
if (typeof shape === "string") return {
|
|
@@ -108,9 +110,9 @@ var DEFAULT_LABEL_DISTANCE = 12;
|
|
|
108
110
|
var DASHED_PATTERN = [4, 2];
|
|
109
111
|
/** dotted 预设:1 px 圆点 + 2 px 间隙 */
|
|
110
112
|
var DOTTED_PATTERN = [1, 2];
|
|
111
|
-
/** dashed / dotted /
|
|
112
|
-
var
|
|
113
|
-
if (
|
|
113
|
+
/** dashed / dotted / dashPattern 优先级:dashPattern > dashed > dotted */
|
|
114
|
+
var resolveDashPattern = (dashPattern, dashed, dotted) => {
|
|
115
|
+
if (dashPattern !== void 0) return dashPattern;
|
|
114
116
|
if (dashed) return DASHED_PATTERN;
|
|
115
117
|
if (dotted) return DOTTED_PATTERN;
|
|
116
118
|
};
|
|
@@ -125,6 +127,14 @@ var inflateRect = (r, m) => m === 0 ? r : {
|
|
|
125
127
|
rotate: r.rotate
|
|
126
128
|
};
|
|
127
129
|
/**
|
|
130
|
+
* 视觉 rect 外扩 outerSep(margin)得到外边界 AABB
|
|
131
|
+
* @description = `inflateRect(layout.rect, layout.margin)`,中心不变、四向各 +margin。border 类
|
|
132
|
+
* anchor(compass / 数字角度)解析与 bbox / viewBox / 布局占位都基于这层;视觉 emit / 裁剪 /
|
|
133
|
+
* 形状专属 anchor / edgePoint / label 附着点仍读 `layout.rect`(不外扩)。单一派生量,不另存字段。
|
|
134
|
+
* (TikZ outer sep 对齐见 v0.3-beta.1 ADR-07。)
|
|
135
|
+
*/
|
|
136
|
+
var outerRectOf = (layout) => inflateRect(layout.rect, layout.margin);
|
|
137
|
+
/**
|
|
128
138
|
* 取节点 shape 在 toward 方向的附着点(path 端点贴边用)
|
|
129
139
|
* @description 走连接面(boundary)对应的 def.boundaryPoint;margin > 0 时先膨胀外接 Rect,让 path 在 border 外停 margin。
|
|
130
140
|
* boundary 缺省 = 'shape'(视觉形状自身),与改前行为一致。
|
|
@@ -135,15 +145,19 @@ var boundaryPointOf = (layout, toward, boundary = "shape") => {
|
|
|
135
145
|
};
|
|
136
146
|
/**
|
|
137
147
|
* 取节点 shape 命名 anchor(center / north / east / north-east 等)
|
|
138
|
-
* @description
|
|
148
|
+
* @description 纯几何:在传入的 `layout.rect` 上求点,本体**不施加 outerSep(margin)**。outerSep 的
|
|
149
|
+
* 「border 外推」由调用方决定——`anchor-cache.ts` 的 compass 解析先把 rect 外扩 margin(`outerRectOf`)
|
|
150
|
+
* 再调本函数;`labelBorderPoint` 喂视觉 rect(label 附着点不含 margin)。这样 outer sep 只作用于
|
|
151
|
+
* path / position 的 anchor 引用,不波及 label(详见 v0.3-beta.1 ADR-07 §1/§2)。
|
|
139
152
|
* compass(9 个 rect 方位名)走连接面 AABB:'shape' 时归一为 'rectangle'(矩形 AABB),其余按 boundary 解析。
|
|
140
153
|
* 形状专属命名 anchor(tip-N / apex 等非 compass 名)恒走视觉形状自身,boundary 不影响。
|
|
141
|
-
* boundary 缺省 = 'shape'
|
|
154
|
+
* boundary 缺省 = 'shape'。
|
|
142
155
|
*/
|
|
143
156
|
var anchorOf = (layout, name, boundary = "shape") => {
|
|
144
|
-
|
|
157
|
+
const compassAnchor = require_anchor.normalizeCompassAnchor(name);
|
|
158
|
+
if (compassAnchor !== void 0) {
|
|
145
159
|
const { def, rect, params } = require_boundary.resolveBoundary(boundary === "shape" ? "rectangle" : boundary, layout.shapeDef, layout.rect, layout.shapeParams ?? EMPTY_SHAPE_PARAMS, layout.shapes);
|
|
146
|
-
const p = def.anchor(rect,
|
|
160
|
+
const p = def.anchor(rect, compassAnchor, params);
|
|
147
161
|
if (p === void 0) throw new Error(`Unknown anchor '${name}' for shape '${layout.shapeName}'`);
|
|
148
162
|
return p;
|
|
149
163
|
}
|
|
@@ -151,41 +165,6 @@ var anchorOf = (layout, name, boundary = "shape") => {
|
|
|
151
165
|
if (p === void 0) throw new Error(`Unknown anchor '${name}' for shape '${layout.shapeName}'`);
|
|
152
166
|
return p;
|
|
153
167
|
};
|
|
154
|
-
/** 8 方向 label position → (anchorName, 单位向量);above 视觉上方即 y 减小 */
|
|
155
|
-
var LABEL_DIRECTION_MAP = {
|
|
156
|
-
above: {
|
|
157
|
-
anchor: "north",
|
|
158
|
-
vec: [0, -1]
|
|
159
|
-
},
|
|
160
|
-
below: {
|
|
161
|
-
anchor: "south",
|
|
162
|
-
vec: [0, 1]
|
|
163
|
-
},
|
|
164
|
-
left: {
|
|
165
|
-
anchor: "west",
|
|
166
|
-
vec: [-1, 0]
|
|
167
|
-
},
|
|
168
|
-
right: {
|
|
169
|
-
anchor: "east",
|
|
170
|
-
vec: [1, 0]
|
|
171
|
-
},
|
|
172
|
-
"above-left": {
|
|
173
|
-
anchor: "north-west",
|
|
174
|
-
vec: [-Math.SQRT1_2, -Math.SQRT1_2]
|
|
175
|
-
},
|
|
176
|
-
"above-right": {
|
|
177
|
-
anchor: "north-east",
|
|
178
|
-
vec: [Math.SQRT1_2, -Math.SQRT1_2]
|
|
179
|
-
},
|
|
180
|
-
"below-left": {
|
|
181
|
-
anchor: "south-west",
|
|
182
|
-
vec: [-Math.SQRT1_2, Math.SQRT1_2]
|
|
183
|
-
},
|
|
184
|
-
"below-right": {
|
|
185
|
-
anchor: "south-east",
|
|
186
|
-
vec: [Math.SQRT1_2, Math.SQRT1_2]
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
168
|
/**
|
|
190
169
|
* 算 label 中心点(节点局部坐标系,未旋转)
|
|
191
170
|
* @description 8 方向:节点对应 anchor 出发按单位向量 × distance 外推;数字角度:先取 angleBoundary 边界点再沿 (cos,sin) × distance 外推。
|
|
@@ -203,16 +182,12 @@ var labelBorderPoint = (layout, label) => {
|
|
|
203
182
|
}
|
|
204
183
|
};
|
|
205
184
|
if (typeof label.position === "number") return angleBoundaryOf(aaLayout, label.position);
|
|
206
|
-
|
|
207
|
-
return anchorOf(aaLayout, anchor);
|
|
185
|
+
return anchorOf(aaLayout, require_direction.LabelAnchorByAtDirection[label.position]);
|
|
208
186
|
};
|
|
209
187
|
var labelCenter = (layout, label) => {
|
|
210
188
|
const [bx, by] = labelBorderPoint(layout, label);
|
|
211
|
-
if (typeof label.position === "number")
|
|
212
|
-
|
|
213
|
-
return [bx + Math.cos(rad) * label.distance, by + Math.sin(rad) * label.distance];
|
|
214
|
-
}
|
|
215
|
-
const { vec } = LABEL_DIRECTION_MAP[label.position];
|
|
189
|
+
if (typeof label.position === "number") return require_arc.arcEndPoint([bx, by], label.distance, label.position);
|
|
190
|
+
const vec = require_direction.DirectionVectorByAtDirection[label.position];
|
|
216
191
|
return [bx + vec[0] * label.distance, by + vec[1] * label.distance];
|
|
217
192
|
};
|
|
218
193
|
/** 从 label 中心朝 border 方向,求 label 框(halfW×halfH)边界交点(pin 引线终点 = label 框近 node 边) */
|
|
@@ -252,8 +227,8 @@ var resolveLabelRotateDeg = (label, lx, ly, cx, cy) => {
|
|
|
252
227
|
};
|
|
253
228
|
/**
|
|
254
229
|
* 取节点 shape 在指定角度方向的边界点
|
|
255
|
-
* @description 角度是节点**局部坐标系**下的极角(度数:0°=局部 +x,90°=局部 +y)。layout.rect.rotate 把局部基绕中心旋转,得到世界系下的视觉方向;shape boundaryPoint 内部用 rotate-aware 投影,所以这里把局部 (cos, sin) 经 rect.rotate 旋转后加到中心当作世界系 toward
|
|
256
|
-
* boundary 缺省 = 'shape'
|
|
230
|
+
* @description 角度是节点**局部坐标系**下的极角(度数:0°=局部 +x,90°=局部 +y)。layout.rect.rotate 把局部基绕中心旋转,得到世界系下的视觉方向;shape boundaryPoint 内部用 rotate-aware 投影,所以这里把局部 (cos, sin) 经 rect.rotate 旋转后加到中心当作世界系 toward 传入。本体**不施加 margin(同 anchorOf)**——outerSep 外推由 `anchor-cache.ts` 调用方喂 `outerRectOf` 实现;用于 `'A.30'` 落点。
|
|
231
|
+
* boundary 缺省 = 'shape'(视觉形状自身)。
|
|
257
232
|
*/
|
|
258
233
|
var angleBoundaryOf = (layout, angleDeg, boundary = "shape") => {
|
|
259
234
|
const rad = angleDeg * Math.PI / 180;
|
|
@@ -271,7 +246,7 @@ var angleBoundaryOf = (layout, angleDeg, boundary = "shape") => {
|
|
|
271
246
|
* @description 文本度量 + padding 推内框半轴;按 shape 算外接边界(circle 取半对角线、ellipse ×√2、diamond ×2);解析 position 为几何中心;rotate 度数转弧度。
|
|
272
247
|
* `scopeChain` 非空时 `resolvePosition` 返回**当前 scope 局部坐标**(relative position 在当前
|
|
273
248
|
* scope 局部度量),调用方负责后续 `projectLayoutToGlobal` / `applyTransformChain` 投回全局;
|
|
274
|
-
* 笛卡尔字面量 `Position` 已在 scope
|
|
249
|
+
* 笛卡尔字面量 `Position` 已在 scope 局部度量,保持局部坐标语义。
|
|
275
250
|
*/
|
|
276
251
|
var layoutNode = (node, measureText, nameStack, nodeDistance, scopeChain = [], labelDefault, shapes = require_index.BUILTIN_SHAPES, resolveBetweenGlobal) => {
|
|
277
252
|
const { type: shapeName, params: rawShapeParams } = normalizeShape(node.shape);
|
|
@@ -310,12 +285,12 @@ var layoutNode = (node, measureText, nameStack, nodeDistance, scopeChain = [], l
|
|
|
310
285
|
const text = isObj ? spec.text : spec;
|
|
311
286
|
const lineFont = isObj ? spec.font : void 0;
|
|
312
287
|
const font = {
|
|
313
|
-
size: lineFont?.size
|
|
288
|
+
size: lineFont?.size !== void 0 ? lineFont.size * fontScale : fontSize,
|
|
314
289
|
family: lineFont?.family ?? fontFamily,
|
|
315
290
|
weight: lineFont?.weight ?? fontWeight,
|
|
316
291
|
style: lineFont?.style ?? fontStyle
|
|
317
292
|
};
|
|
318
|
-
const physical = maxTextWidth !== void 0 ? wrapText(
|
|
293
|
+
const physical = text.split("\n").flatMap((hardLine) => maxTextWidth !== void 0 ? wrapText(hardLine, font, maxTextWidth, measureText) : [hardLine]);
|
|
319
294
|
for (const ptext of physical) {
|
|
320
295
|
const m = measureText(ptext, font);
|
|
321
296
|
if (m.width > textWidth) textWidth = m.width;
|
|
@@ -323,7 +298,7 @@ var layoutNode = (node, measureText, nameStack, nodeDistance, scopeChain = [], l
|
|
|
323
298
|
if (isObj) {
|
|
324
299
|
if (spec.fill !== void 0) out.fill = spec.fill;
|
|
325
300
|
if (spec.opacity !== void 0) out.opacity = spec.opacity;
|
|
326
|
-
if (lineFont?.size !== void 0) out.fontSize = lineFont.size;
|
|
301
|
+
if (lineFont?.size !== void 0) out.fontSize = lineFont.size * fontScale;
|
|
327
302
|
if (lineFont?.family !== void 0) out.fontFamily = lineFont.family;
|
|
328
303
|
if (lineFont?.weight !== void 0) out.fontWeight = lineFont.weight;
|
|
329
304
|
if (lineFont?.style !== void 0) out.fontStyle = lineFont.style;
|
|
@@ -399,7 +374,7 @@ var layoutNode = (node, measureText, nameStack, nodeDistance, scopeChain = [], l
|
|
|
399
374
|
stroke: node.stroke,
|
|
400
375
|
strokeOpacity: node.drawOpacity,
|
|
401
376
|
strokeWidth: node.strokeWidth,
|
|
402
|
-
dashPattern:
|
|
377
|
+
dashPattern: resolveDashPattern(node.dashPattern, node.dashed, node.dotted),
|
|
403
378
|
cornerRadius: node.cornerRadius,
|
|
404
379
|
textColor: node.textColor,
|
|
405
380
|
opacity: node.opacity,
|
|
@@ -458,12 +433,13 @@ var labelExtentPoints = (layout) => {
|
|
|
458
433
|
}
|
|
459
434
|
return pts;
|
|
460
435
|
};
|
|
436
|
+
var cloneScenePrimitive = (primitive) => ({ ...primitive });
|
|
461
437
|
var emitNodePrimitives = (layout, round, resolveFill) => {
|
|
462
438
|
const axisAlignedRect = {
|
|
463
439
|
...layout.rect,
|
|
464
440
|
rotate: 0
|
|
465
441
|
};
|
|
466
|
-
const shapePrims = [...layout.shapeDef.emit(axisAlignedRect, toShapeStyle(layout, resolveFill), round, layout.shapeParams ?? EMPTY_SHAPE_PARAMS)];
|
|
442
|
+
const shapePrims = [...layout.shapeDef.emit(axisAlignedRect, toShapeStyle(layout, resolveFill), round, layout.shapeParams ?? EMPTY_SHAPE_PARAMS)].map(cloneScenePrimitive);
|
|
467
443
|
const inner = [...shapePrims];
|
|
468
444
|
if (layout.lines) {
|
|
469
445
|
const halfBlockW = layout.textWidth / 2;
|
|
@@ -527,7 +503,7 @@ var emitNodePrimitives = (layout, round, resolveFill) => {
|
|
|
527
503
|
lineHeight: labLineHeight,
|
|
528
504
|
fill: lab.textColor ?? "currentColor",
|
|
529
505
|
opacity: lab.opacity ?? layout.opacity,
|
|
530
|
-
measuredWidth:
|
|
506
|
+
measuredWidth: round(lab.measuredWidth),
|
|
531
507
|
measuredHeight: round(lab.fontSize)
|
|
532
508
|
};
|
|
533
509
|
const deg = resolveLabelRotateDeg(lab, lx, ly, cx, cy);
|
|
@@ -572,3 +548,4 @@ exports.boundaryPointOf = boundaryPointOf;
|
|
|
572
548
|
exports.emitNodePrimitives = emitNodePrimitives;
|
|
573
549
|
exports.labelExtentPoints = labelExtentPoints;
|
|
574
550
|
exports.layoutNode = layoutNode;
|
|
551
|
+
exports.outerRectOf = outerRectOf;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Position } from '../geometry/point';
|
|
2
2
|
import { Rect } from '../geometry/rect';
|
|
3
|
-
import {
|
|
3
|
+
import { AtDirectionValue, IRAnimationTrack, IRBoundary, IRJsonObject, IRLabelDefault, IRNode, IRPaintSpec } from '../ir';
|
|
4
4
|
import { PaintResolver } from './paint';
|
|
5
5
|
import { ScenePrimitive, TextLine, Transform } from '../primitive';
|
|
6
6
|
import { ShapeDefinition } from '../shapes';
|
|
@@ -86,7 +86,7 @@ export type NodeLayout = {
|
|
|
86
86
|
export type NodeLabelLayout = {
|
|
87
87
|
text: string;
|
|
88
88
|
/** 8 方向枚举或数字角度 */
|
|
89
|
-
position:
|
|
89
|
+
position: AtDirectionValue | number;
|
|
90
90
|
/** 已应用默认值 */
|
|
91
91
|
distance: number;
|
|
92
92
|
textColor?: string;
|
|
@@ -108,6 +108,14 @@ export type NodeLabelLayout = {
|
|
|
108
108
|
dashPattern?: Array<number>;
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* 视觉 rect 外扩 outerSep(margin)得到外边界 AABB
|
|
113
|
+
* @description = `inflateRect(layout.rect, layout.margin)`,中心不变、四向各 +margin。border 类
|
|
114
|
+
* anchor(compass / 数字角度)解析与 bbox / viewBox / 布局占位都基于这层;视觉 emit / 裁剪 /
|
|
115
|
+
* 形状专属 anchor / edgePoint / label 附着点仍读 `layout.rect`(不外扩)。单一派生量,不另存字段。
|
|
116
|
+
* (TikZ outer sep 对齐见 v0.3-beta.1 ADR-07。)
|
|
117
|
+
*/
|
|
118
|
+
export declare const outerRectOf: (layout: NodeLayout) => Rect;
|
|
111
119
|
/**
|
|
112
120
|
* 取节点 shape 在 toward 方向的附着点(path 端点贴边用)
|
|
113
121
|
* @description 走连接面(boundary)对应的 def.boundaryPoint;margin > 0 时先膨胀外接 Rect,让 path 在 border 外停 margin。
|
|
@@ -116,16 +124,19 @@ export type NodeLabelLayout = {
|
|
|
116
124
|
export declare const boundaryPointOf: (layout: NodeLayout, toward: Position, boundary?: IRBoundary | undefined) => Position;
|
|
117
125
|
/**
|
|
118
126
|
* 取节点 shape 命名 anchor(center / north / east / north-east 等)
|
|
119
|
-
* @description
|
|
127
|
+
* @description 纯几何:在传入的 `layout.rect` 上求点,本体**不施加 outerSep(margin)**。outerSep 的
|
|
128
|
+
* 「border 外推」由调用方决定——`anchor-cache.ts` 的 compass 解析先把 rect 外扩 margin(`outerRectOf`)
|
|
129
|
+
* 再调本函数;`labelBorderPoint` 喂视觉 rect(label 附着点不含 margin)。这样 outer sep 只作用于
|
|
130
|
+
* path / position 的 anchor 引用,不波及 label(详见 v0.3-beta.1 ADR-07 §1/§2)。
|
|
120
131
|
* compass(9 个 rect 方位名)走连接面 AABB:'shape' 时归一为 'rectangle'(矩形 AABB),其余按 boundary 解析。
|
|
121
132
|
* 形状专属命名 anchor(tip-N / apex 等非 compass 名)恒走视觉形状自身,boundary 不影响。
|
|
122
|
-
* boundary 缺省 = 'shape'
|
|
133
|
+
* boundary 缺省 = 'shape'。
|
|
123
134
|
*/
|
|
124
135
|
export declare const anchorOf: (layout: NodeLayout, name: string, boundary?: IRBoundary | undefined) => Position;
|
|
125
136
|
/**
|
|
126
137
|
* 取节点 shape 在指定角度方向的边界点
|
|
127
|
-
* @description 角度是节点**局部坐标系**下的极角(度数:0°=局部 +x,90°=局部 +y)。layout.rect.rotate 把局部基绕中心旋转,得到世界系下的视觉方向;shape boundaryPoint 内部用 rotate-aware 投影,所以这里把局部 (cos, sin) 经 rect.rotate 旋转后加到中心当作世界系 toward
|
|
128
|
-
* boundary 缺省 = 'shape'
|
|
138
|
+
* @description 角度是节点**局部坐标系**下的极角(度数:0°=局部 +x,90°=局部 +y)。layout.rect.rotate 把局部基绕中心旋转,得到世界系下的视觉方向;shape boundaryPoint 内部用 rotate-aware 投影,所以这里把局部 (cos, sin) 经 rect.rotate 旋转后加到中心当作世界系 toward 传入。本体**不施加 margin(同 anchorOf)**——outerSep 外推由 `anchor-cache.ts` 调用方喂 `outerRectOf` 实现;用于 `'A.30'` 落点。
|
|
139
|
+
* boundary 缺省 = 'shape'(视觉形状自身)。
|
|
129
140
|
*/
|
|
130
141
|
export declare const angleBoundaryOf: (layout: NodeLayout, angleDeg: number, boundary?: IRBoundary | undefined) => Position;
|
|
131
142
|
/**
|
|
@@ -133,7 +144,7 @@ export declare const angleBoundaryOf: (layout: NodeLayout, angleDeg: number, bou
|
|
|
133
144
|
* @description 文本度量 + padding 推内框半轴;按 shape 算外接边界(circle 取半对角线、ellipse ×√2、diamond ×2);解析 position 为几何中心;rotate 度数转弧度。
|
|
134
145
|
* `scopeChain` 非空时 `resolvePosition` 返回**当前 scope 局部坐标**(relative position 在当前
|
|
135
146
|
* scope 局部度量),调用方负责后续 `projectLayoutToGlobal` / `applyTransformChain` 投回全局;
|
|
136
|
-
* 笛卡尔字面量 `Position` 已在 scope
|
|
147
|
+
* 笛卡尔字面量 `Position` 已在 scope 局部度量,保持局部坐标语义。
|
|
137
148
|
*/
|
|
138
149
|
export declare const layoutNode: (node: IRNode, measureText: TextMeasurer, nameStack: NameStack, nodeDistance?: number, scopeChain?: ReadonlyArray<Transform>, labelDefault?: IRLabelDefault, shapes?: Record<string, ShapeDefinition>, resolveBetweenGlobal?: ResolveBetweenGlobal) => NodeLayout;
|
|
139
150
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/compile/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/compile/node.ts"],"names":[],"mappings":"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"}
|
|
@@ -77,7 +77,7 @@ var createPaintRegistry = (effectivePatterns, round) => {
|
|
|
77
77
|
id,
|
|
78
78
|
spec: fill
|
|
79
79
|
};
|
|
80
|
-
if (fill.
|
|
80
|
+
if (fill.kind === "pattern") resource.tile = resolvePatternTile(fill, effectivePatterns, round);
|
|
81
81
|
list.push(resource);
|
|
82
82
|
}
|
|
83
83
|
return {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_step = require("../../ir/path/step.cjs");
|
|
2
|
+
const require_edge = require("../../geometry/edge.cjs");
|
|
3
|
+
const require_point = require("../../geometry/point.cjs");
|
|
2
4
|
const require_scope = require("../scope.cjs");
|
|
3
5
|
const require_position = require("../position.cjs");
|
|
4
6
|
const require_node = require("../node.cjs");
|
|
@@ -6,6 +8,7 @@ const require_anchor_cache = require("../anchor-cache.cjs");
|
|
|
6
8
|
//#region src/compile/path/anchor.ts
|
|
7
9
|
/** target 是否对象形态 NodeTarget(`{ id, anchor?, offset? }`);与 Position(array) / Polar / Offset(of) / Relative 区分(独有 `id`) */
|
|
8
10
|
var isNodeTarget = (t) => typeof t === "object" && !Array.isArray(t) && "id" in t;
|
|
11
|
+
var isAutoBoundaryTarget = (target) => isNodeTarget(target) && target.anchor === void 0 && target.offset === void 0;
|
|
9
12
|
/** target 是否 between 比例点(`{ between, t }`);独有 `between` 字段 */
|
|
10
13
|
var isBetween = (t) => typeof t === "object" && !Array.isArray(t) && "between" in t;
|
|
11
14
|
/** 解析 NodeTarget 的 anchor(非 undefined)到世界坐标:命名 / 角度走 resolveAnchor(可选连接面),`{ side, t }` 恒走视觉形状(不传 boundary) */
|
|
@@ -21,7 +24,7 @@ var addOffset = (base, offset) => offset ? [base[0] + offset[0], base[1] + offse
|
|
|
21
24
|
* @description 三态:`'A'`(auto) 节点中心;`'A.<anchor>'`/`'A.<deg>'` 显式锚点 refPoint=endpoint 位置不随邻居变。直接坐标/极坐标解析为笛卡尔。
|
|
22
25
|
* string id lookup 拿到的 layout 已是全局坐标——不走 scopeChain 投影;Position / Polar /
|
|
23
26
|
* At / Offset 字面量经 `resolvePosition(..., scopeChain)` 拿到当前 scope 局部坐标后
|
|
24
|
-
* `applyTransformChain` 投回全局。`scopeChain=[]`
|
|
27
|
+
* `applyTransformChain` 投回全局。`scopeChain=[]` 时按恒等变换处理。
|
|
25
28
|
*/
|
|
26
29
|
var refPointOfTarget = (target, nameStack, scopeChain = []) => {
|
|
27
30
|
if (isNodeTarget(target)) {
|
|
@@ -33,7 +36,7 @@ var refPointOfTarget = (target, nameStack, scopeChain = []) => {
|
|
|
33
36
|
const a = refPointOfTarget(target.between[0], nameStack, scopeChain);
|
|
34
37
|
const b = refPointOfTarget(target.between[1], nameStack, scopeChain);
|
|
35
38
|
if (!a || !b) return null;
|
|
36
|
-
const mid =
|
|
39
|
+
const mid = require_edge.lerpPoint(a, b, target.t);
|
|
37
40
|
if (!Number.isFinite(mid[0]) || !Number.isFinite(mid[1])) return null;
|
|
38
41
|
return mid;
|
|
39
42
|
}
|
|
@@ -43,7 +46,7 @@ var refPointOfTarget = (target, nameStack, scopeChain = []) => {
|
|
|
43
46
|
return scopeChain.length === 0 ? local : require_scope.applyTransformChain(local, scopeChain);
|
|
44
47
|
};
|
|
45
48
|
/** 折角中间点:`-|` → (curr.x, prev.y);`|-` → (prev.x, curr.y) */
|
|
46
|
-
var cornerOf = (prev, curr, via) => via ===
|
|
49
|
+
var cornerOf = (prev, curr, via) => via === require_step.FoldStepVia.HorizontalThenVertical ? [curr[0], prev[1]] : [prev[0], curr[1]];
|
|
47
50
|
/**
|
|
48
51
|
* 在 toward 方向算 step.to 的实际绘制端点
|
|
49
52
|
* @description 节点 auto `'A'`:按 shape 走 boundaryPointOf 求中心→toward 射线交点;命名 anchor/角度:位置已定不受 toward 影响;直接坐标/极坐标:解析后返回;失败返回 null。
|
|
@@ -64,18 +67,13 @@ var clipForTarget = (target, toward, nameStack, scopeChain = []) => {
|
|
|
64
67
|
return scopeChain.length === 0 ? local : require_scope.applyTransformChain(local, scopeChain);
|
|
65
68
|
};
|
|
66
69
|
/** 两个 IRPosition 两分量精确相等(未 round) */
|
|
67
|
-
var samePoint = (a, b) => !!a && !!b && a
|
|
70
|
+
var samePoint = (a, b) => !!a && !!b && require_point.point.equal(a, b);
|
|
68
71
|
/** 把 p 朝 target 方向移动 dist */
|
|
69
|
-
var shiftToward = (p, target, dist) =>
|
|
70
|
-
const dx = target[0] - p[0];
|
|
71
|
-
const dy = target[1] - p[1];
|
|
72
|
-
const len = Math.sqrt(dx * dx + dy * dy);
|
|
73
|
-
if (len === 0 || dist === 0) return p;
|
|
74
|
-
return [p[0] + dx / len * dist, p[1] + dy / len * dist];
|
|
75
|
-
};
|
|
72
|
+
var shiftToward = (p, target, dist) => require_point.point.shiftToward(p, target, dist);
|
|
76
73
|
//#endregion
|
|
77
74
|
exports.clipForTarget = clipForTarget;
|
|
78
75
|
exports.cornerOf = cornerOf;
|
|
76
|
+
exports.isAutoBoundaryTarget = isAutoBoundaryTarget;
|
|
79
77
|
exports.refPointOfTarget = refPointOfTarget;
|
|
80
78
|
exports.samePoint = samePoint;
|
|
81
79
|
exports.shiftToward = shiftToward;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { IRPosition, IRTarget } from '../../ir';
|
|
1
|
+
import { FoldStepViaValue, IRPosition, IRTarget } from '../../ir';
|
|
2
2
|
import { Transform } from '../../primitive';
|
|
3
3
|
import { NameStack } from '../name-stack';
|
|
4
|
+
export declare const isAutoBoundaryTarget: (target: IRTarget) => boolean;
|
|
4
5
|
/**
|
|
5
6
|
* 求 step.to 的参考点(给 boundary clip 算方向 / 折角 corner 用)
|
|
6
7
|
* @description 三态:`'A'`(auto) 节点中心;`'A.<anchor>'`/`'A.<deg>'` 显式锚点 refPoint=endpoint 位置不随邻居变。直接坐标/极坐标解析为笛卡尔。
|
|
7
8
|
* string id lookup 拿到的 layout 已是全局坐标——不走 scopeChain 投影;Position / Polar /
|
|
8
9
|
* At / Offset 字面量经 `resolvePosition(..., scopeChain)` 拿到当前 scope 局部坐标后
|
|
9
|
-
* `applyTransformChain` 投回全局。`scopeChain=[]`
|
|
10
|
+
* `applyTransformChain` 投回全局。`scopeChain=[]` 时按恒等变换处理。
|
|
10
11
|
*/
|
|
11
12
|
export declare const refPointOfTarget: (target: IRTarget, nameStack: NameStack, scopeChain?: ReadonlyArray<Transform>) => IRPosition | null;
|
|
12
13
|
/** 折角中间点:`-|` → (curr.x, prev.y);`|-` → (prev.x, curr.y) */
|
|
13
|
-
export declare const cornerOf: (prev: IRPosition, curr: IRPosition, via:
|
|
14
|
+
export declare const cornerOf: (prev: IRPosition, curr: IRPosition, via: FoldStepViaValue) => IRPosition;
|
|
14
15
|
/**
|
|
15
16
|
* 在 toward 方向算 step.to 的实际绘制端点
|
|
16
17
|
* @description 节点 auto `'A'`:按 shape 走 boundaryPointOf 求中心→toward 射线交点;命名 anchor/角度:位置已定不受 toward 影响;直接坐标/极坐标:解析后返回;失败返回 null。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../../../src/compile/path/anchor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../../../src/compile/path/anchor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAmC,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAExG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAU/C,eAAO,MAAM,oBAAoB,GAAI,QAAQ,QAAQ,KAAG,OAC4B,CAAC;AAqBrF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,QAAQ,EAChB,WAAW,SAAS,EACpB,aAAY,aAAa,CAAC,SAAS,CAAM,KACxC,UAAU,GAAG,IA8Bf,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,GACnB,MAAM,UAAU,EAChB,MAAM,UAAU,EAChB,KAAK,gBAAgB,KACpB,UACmF,CAAC;AAEvF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,QAAQ,EAChB,QAAQ,UAAU,EAClB,WAAW,SAAS,EACpB,aAAY,aAAa,CAAC,SAAS,CAAM,KACxC,UAAU,GAAG,IAuBf,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,SAAS,GAAI,GAAG,UAAU,GAAG,IAAI,EAAE,GAAG,UAAU,GAAG,IAAI,KAAG,OACtC,CAAC;AAElC,6BAA6B;AAC7B,eAAO,MAAM,WAAW,GAAI,GAAG,UAAU,EAAE,QAAQ,UAAU,EAAE,MAAM,MAAM,KAAG,UAC1C,CAAC"}
|