@pixerate/editor 0.38.0 → 0.39.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/THIRD_PARTY_NOTICES.md +2 -2
- package/dist/canvas/index.cjs +31 -25
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +16 -3
- package/dist/canvas/index.d.ts +16 -3
- package/dist/canvas/index.js +7 -1
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-ZCCU3VNI.js → chunk-3LHWTGHW.js} +158 -9
- package/dist/chunk-3LHWTGHW.js.map +1 -0
- package/dist/{chunk-7EDLVBOO.cjs → chunk-VNYRI265.cjs} +159 -10
- package/dist/chunk-VNYRI265.cjs.map +1 -0
- package/dist/{pathfinder-fLmmFOJw.d.ts → pathfinder-D98S2lV5.d.ts} +20 -2
- package/dist/{pathfinder-Bd87_lsQ.d.cts → pathfinder-DKRcXiLS.d.cts} +20 -2
- package/dist/vector/index.cjs +281 -220
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +55 -12
- package/dist/vector/index.d.ts +55 -12
- package/dist/vector/index.js +101 -40
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-7EDLVBOO.cjs.map +0 -1
- package/dist/chunk-ZCCU3VNI.js.map +0 -1
|
@@ -823,7 +823,7 @@ declare function offsetPath(input: BezierPathInput, distance: number, options?:
|
|
|
823
823
|
* Adjacency is kept in per-vertex lists and half-edge slots (no scans over all edges per step).
|
|
824
824
|
*
|
|
825
825
|
* Ported from vectorcraft-main/crates/pathops/src/planar.rs (`map`, `Map::merge`, `build`,
|
|
826
|
-
* `interior_point`, `without_spurs`, `leaving_angle`), figcraft-main/crates/doc/src/vector_faces.rs
|
|
826
|
+
* `interior_point`, `without_spurs`, `leaving_angle`, `cut_out`), figcraft-main/crates/doc/src/vector_faces.rs
|
|
827
827
|
* (`faces`: half-edge walk with an angle-sorted next edge, the winding deciding inside or
|
|
828
828
|
* outside) and cadcraft-main/crates/geom/src/region.rs (`enclosing_loop`, `boundary_at_gap`:
|
|
829
829
|
* a ray from the point, the sharpest left turn, islands as holes, gaps between open ends
|
|
@@ -935,6 +935,24 @@ declare class PlanarMap {
|
|
|
935
935
|
*/
|
|
936
936
|
regionAt(p: Point): BezierPath | null;
|
|
937
937
|
}
|
|
938
|
+
/** Whether a contour, closed, encloses an area (rather than retracing itself). */
|
|
939
|
+
declare function contourEnclosesArea(contour: BezierContour): boolean;
|
|
940
|
+
/**
|
|
941
|
+
* `path` without `piece`, a run along one of its subpaths between two points (a Shape Builder
|
|
942
|
+
* edge from `PlanarMap.chains`): a closed subpath opens there, an open one splits in two (or
|
|
943
|
+
* loses an end), and a piece that runs all the way round (`closed`, or ending where it starts)
|
|
944
|
+
* takes its subpath with it. With `fillCloses`, open subpaths that enclose an area run on round
|
|
945
|
+
* an invisible closing edge, as the Shape Builder sees a filled path: a piece may run over it,
|
|
946
|
+
* and it never comes back as a visible segment. Null when the piece does not lie on `path`
|
|
947
|
+
* within `tol`.
|
|
948
|
+
*
|
|
949
|
+
* Ported from vectorcraft-main/crates/pathops/src/planar.rs (`cut_out`, `nearest_u`, `span`,
|
|
950
|
+
* `snap_ends`). MIT OR Apache-2.0, © ArtCraft Team and contributors. See THIRD_PARTY_NOTICES.md.
|
|
951
|
+
*/
|
|
952
|
+
declare function cutOutPiece(path: BezierPathInput, piece: {
|
|
953
|
+
segments: readonly BezierSegment[];
|
|
954
|
+
closed?: boolean;
|
|
955
|
+
}, fillCloses: boolean, tol: number): BezierPath | null;
|
|
938
956
|
|
|
939
957
|
/**
|
|
940
958
|
* The Pathfinder panel's dividing operations over a stack of shapes (index 0 at the back):
|
|
@@ -991,4 +1009,4 @@ interface PathfinderResult extends PathOpsReport {
|
|
|
991
1009
|
*/
|
|
992
1010
|
declare function pathfinder(op: PathfinderOperation, shapes: readonly PathfinderShape[], options?: PathOpsOptions): PathfinderResult;
|
|
993
1011
|
|
|
994
|
-
export { type PolygonInput as $, type AffineMatrix as A, type BezierPathInput as B, type CanvasGradientDef as C, type DashedPath as D, type EllipseShape as E, type FlattenOptions as F, type GetShapeRenderDataOptions as G, type PathOpsOptions as H, type PathOpsReport as I, type PathPiece as J, type PathPointAtLength as K, type PathSelectResult as L, type MultiPolygon as M, type PathShape as N, type OffsetPathOptions as O, PlanarMap as P, type PathfinderPiece as Q, type PathfinderResult as R, type SvgGradientDef as S, type PlanarChain as T, type PlanarFace as U, type PlanarInput as V, type PlanarMapOptions as W, type PlanarSplitEdge as X, type PlanarSplitResult as Y, type PolygonBooleanOperation as Z, type PolygonBooleanOptions as _, type BezierPath as a,
|
|
1012
|
+
export { type PolygonInput as $, type AffineMatrix as A, type BezierPathInput as B, type CanvasGradientDef as C, type DashedPath as D, type EllipseShape as E, type FlattenOptions as F, type GetShapeRenderDataOptions as G, type PathOpsOptions as H, type PathOpsReport as I, type PathPiece as J, type PathPointAtLength as K, type PathSelectResult as L, type MultiPolygon as M, type PathShape as N, type OffsetPathOptions as O, PlanarMap as P, type PathfinderPiece as Q, type PathfinderResult as R, type SvgGradientDef as S, type PlanarChain as T, type PlanarFace as U, type PlanarInput as V, type PlanarMapOptions as W, type PlanarSplitEdge as X, type PlanarSplitResult as Y, type PolygonBooleanOperation as Z, type PolygonBooleanOptions as _, type BezierPath as a, segmentCurvature as a$, type PolygonOperand as a0, type PolygonPiece as a1, type PolygonToPathOptions as a2, type PolygonWithHoles as a3, type RectShape as a4, type RegularPolygonShape as a5, SHAPE_KINDS as a6, type SegmentIntersection as a7, type ShapeKind as a8, type ShapePaint as a9, gradientToSvgDef as aA, interiorPoint as aB, intersectPaths as aC, intersectPolygons as aD, isCanvasGradient as aE, isShapeDescription as aF, multiPolygonArea as aG, multiPolygonBounds as aH, normalizeBezierPath as aI, offsetPath as aJ, outlineStroke as aK, parseCssGradient as aL, parseSvgPath as aM, pathBoolean as aN, pathBooleanSelect as aO, pathToContours as aP, pathfinder as aQ, planarSplit as aR, pointInBezierPath as aS, pointInMultiPolygon as aT, pointInRings as aU, polygonArea as aV, polygonBoolean as aW, polygonToSvgPath as aX, resolveCanvasGradient as aY, ringSignedArea as aZ, segmentBounds as a_, type ShapeRenderData as aa, type StarShape as ab, type SvgGradientStop as ac, angleToSvgLinearCoords as ad, arcToCubics as ae, bezierPathArea as af, bezierPathBounds as ag, bezierPathLength as ah, bezierPathPointAtLength as ai, bezierPathSignedArea as aj, bezierPathToSvg as ak, closeContour as al, contourEnclosesArea as am, contourSignedArea as an, contoursToPath as ao, countPathSegments as ap, cutOutPiece as aq, dashContours as ar, distanceToBezierPath as as, dividePaths as at, dividePolygons as au, excludePaths as av, flattenSvgPath as aw, formatNumber as ax, getShapeRenderData as ay, getShapeSvg as az, type StrokeJoin as b, segmentDerivative as b0, segmentExtrema as b1, segmentIntersections as b2, segmentLength as b3, segmentNearest as b4, segmentParamAtLength as b5, segmentPoint as b6, segmentTangent as b7, shapeToPolygon as b8, simplifyRing as b9, splitSegment as ba, strokeOutlineRings as bb, subSegment as bc, subtractPaths as bd, subtractPolygons as be, toBezierPath as bf, transformBezierPath as bg, trimSegments as bh, unionPolygons as bi, unitePaths as bj, windingNumber as bk, xorPolygons as bl, type StrokeCap as c, type BezierSegment as d, type PathfinderOperation as e, type PathfinderShape as f, type ShapeDescription as g, type PolygonFillRule as h, type PolygonRing as i, type ShapeSize as j, type BezierCommand as k, type BezierContour as l, type BezierPathToSvgOptions as m, CANVAS_GRADIENT_PRESETS as n, type CanvasLinearGradient as o, type CanvasRadialGradient as p, type DividePathsResult as q, type GradientStop as r, type OutlineStrokeOptions as s, PATHFINDER_OPERATIONS as t, type PathBooleanOperation as u, type PathBooleanResult as v, type PathCommand as w, type PathOperand as x, type PathOperandInput as y, PathOpsError as z };
|
|
@@ -823,7 +823,7 @@ declare function offsetPath(input: BezierPathInput, distance: number, options?:
|
|
|
823
823
|
* Adjacency is kept in per-vertex lists and half-edge slots (no scans over all edges per step).
|
|
824
824
|
*
|
|
825
825
|
* Ported from vectorcraft-main/crates/pathops/src/planar.rs (`map`, `Map::merge`, `build`,
|
|
826
|
-
* `interior_point`, `without_spurs`, `leaving_angle`), figcraft-main/crates/doc/src/vector_faces.rs
|
|
826
|
+
* `interior_point`, `without_spurs`, `leaving_angle`, `cut_out`), figcraft-main/crates/doc/src/vector_faces.rs
|
|
827
827
|
* (`faces`: half-edge walk with an angle-sorted next edge, the winding deciding inside or
|
|
828
828
|
* outside) and cadcraft-main/crates/geom/src/region.rs (`enclosing_loop`, `boundary_at_gap`:
|
|
829
829
|
* a ray from the point, the sharpest left turn, islands as holes, gaps between open ends
|
|
@@ -935,6 +935,24 @@ declare class PlanarMap {
|
|
|
935
935
|
*/
|
|
936
936
|
regionAt(p: Point): BezierPath | null;
|
|
937
937
|
}
|
|
938
|
+
/** Whether a contour, closed, encloses an area (rather than retracing itself). */
|
|
939
|
+
declare function contourEnclosesArea(contour: BezierContour): boolean;
|
|
940
|
+
/**
|
|
941
|
+
* `path` without `piece`, a run along one of its subpaths between two points (a Shape Builder
|
|
942
|
+
* edge from `PlanarMap.chains`): a closed subpath opens there, an open one splits in two (or
|
|
943
|
+
* loses an end), and a piece that runs all the way round (`closed`, or ending where it starts)
|
|
944
|
+
* takes its subpath with it. With `fillCloses`, open subpaths that enclose an area run on round
|
|
945
|
+
* an invisible closing edge, as the Shape Builder sees a filled path: a piece may run over it,
|
|
946
|
+
* and it never comes back as a visible segment. Null when the piece does not lie on `path`
|
|
947
|
+
* within `tol`.
|
|
948
|
+
*
|
|
949
|
+
* Ported from vectorcraft-main/crates/pathops/src/planar.rs (`cut_out`, `nearest_u`, `span`,
|
|
950
|
+
* `snap_ends`). MIT OR Apache-2.0, © ArtCraft Team and contributors. See THIRD_PARTY_NOTICES.md.
|
|
951
|
+
*/
|
|
952
|
+
declare function cutOutPiece(path: BezierPathInput, piece: {
|
|
953
|
+
segments: readonly BezierSegment[];
|
|
954
|
+
closed?: boolean;
|
|
955
|
+
}, fillCloses: boolean, tol: number): BezierPath | null;
|
|
938
956
|
|
|
939
957
|
/**
|
|
940
958
|
* The Pathfinder panel's dividing operations over a stack of shapes (index 0 at the back):
|
|
@@ -991,4 +1009,4 @@ interface PathfinderResult extends PathOpsReport {
|
|
|
991
1009
|
*/
|
|
992
1010
|
declare function pathfinder(op: PathfinderOperation, shapes: readonly PathfinderShape[], options?: PathOpsOptions): PathfinderResult;
|
|
993
1011
|
|
|
994
|
-
export { type PolygonInput as $, type AffineMatrix as A, type BezierPathInput as B, type CanvasGradientDef as C, type DashedPath as D, type EllipseShape as E, type FlattenOptions as F, type GetShapeRenderDataOptions as G, type PathOpsOptions as H, type PathOpsReport as I, type PathPiece as J, type PathPointAtLength as K, type PathSelectResult as L, type MultiPolygon as M, type PathShape as N, type OffsetPathOptions as O, PlanarMap as P, type PathfinderPiece as Q, type PathfinderResult as R, type SvgGradientDef as S, type PlanarChain as T, type PlanarFace as U, type PlanarInput as V, type PlanarMapOptions as W, type PlanarSplitEdge as X, type PlanarSplitResult as Y, type PolygonBooleanOperation as Z, type PolygonBooleanOptions as _, type BezierPath as a,
|
|
1012
|
+
export { type PolygonInput as $, type AffineMatrix as A, type BezierPathInput as B, type CanvasGradientDef as C, type DashedPath as D, type EllipseShape as E, type FlattenOptions as F, type GetShapeRenderDataOptions as G, type PathOpsOptions as H, type PathOpsReport as I, type PathPiece as J, type PathPointAtLength as K, type PathSelectResult as L, type MultiPolygon as M, type PathShape as N, type OffsetPathOptions as O, PlanarMap as P, type PathfinderPiece as Q, type PathfinderResult as R, type SvgGradientDef as S, type PlanarChain as T, type PlanarFace as U, type PlanarInput as V, type PlanarMapOptions as W, type PlanarSplitEdge as X, type PlanarSplitResult as Y, type PolygonBooleanOperation as Z, type PolygonBooleanOptions as _, type BezierPath as a, segmentCurvature as a$, type PolygonOperand as a0, type PolygonPiece as a1, type PolygonToPathOptions as a2, type PolygonWithHoles as a3, type RectShape as a4, type RegularPolygonShape as a5, SHAPE_KINDS as a6, type SegmentIntersection as a7, type ShapeKind as a8, type ShapePaint as a9, gradientToSvgDef as aA, interiorPoint as aB, intersectPaths as aC, intersectPolygons as aD, isCanvasGradient as aE, isShapeDescription as aF, multiPolygonArea as aG, multiPolygonBounds as aH, normalizeBezierPath as aI, offsetPath as aJ, outlineStroke as aK, parseCssGradient as aL, parseSvgPath as aM, pathBoolean as aN, pathBooleanSelect as aO, pathToContours as aP, pathfinder as aQ, planarSplit as aR, pointInBezierPath as aS, pointInMultiPolygon as aT, pointInRings as aU, polygonArea as aV, polygonBoolean as aW, polygonToSvgPath as aX, resolveCanvasGradient as aY, ringSignedArea as aZ, segmentBounds as a_, type ShapeRenderData as aa, type StarShape as ab, type SvgGradientStop as ac, angleToSvgLinearCoords as ad, arcToCubics as ae, bezierPathArea as af, bezierPathBounds as ag, bezierPathLength as ah, bezierPathPointAtLength as ai, bezierPathSignedArea as aj, bezierPathToSvg as ak, closeContour as al, contourEnclosesArea as am, contourSignedArea as an, contoursToPath as ao, countPathSegments as ap, cutOutPiece as aq, dashContours as ar, distanceToBezierPath as as, dividePaths as at, dividePolygons as au, excludePaths as av, flattenSvgPath as aw, formatNumber as ax, getShapeRenderData as ay, getShapeSvg as az, type StrokeJoin as b, segmentDerivative as b0, segmentExtrema as b1, segmentIntersections as b2, segmentLength as b3, segmentNearest as b4, segmentParamAtLength as b5, segmentPoint as b6, segmentTangent as b7, shapeToPolygon as b8, simplifyRing as b9, splitSegment as ba, strokeOutlineRings as bb, subSegment as bc, subtractPaths as bd, subtractPolygons as be, toBezierPath as bf, transformBezierPath as bg, trimSegments as bh, unionPolygons as bi, unitePaths as bj, windingNumber as bk, xorPolygons as bl, type StrokeCap as c, type BezierSegment as d, type PathfinderOperation as e, type PathfinderShape as f, type ShapeDescription as g, type PolygonFillRule as h, type PolygonRing as i, type ShapeSize as j, type BezierCommand as k, type BezierContour as l, type BezierPathToSvgOptions as m, CANVAS_GRADIENT_PRESETS as n, type CanvasLinearGradient as o, type CanvasRadialGradient as p, type DividePathsResult as q, type GradientStop as r, type OutlineStrokeOptions as s, PATHFINDER_OPERATIONS as t, type PathBooleanOperation as u, type PathBooleanResult as v, type PathCommand as w, type PathOperand as x, type PathOperandInput as y, PathOpsError as z };
|