@pixerate/editor-react 0.192.0 → 0.194.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.
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+ import { type CanvasAnimatedEdgePathType, type CanvasEdgeAnimation, type Position } from '@pixerate/editor/canvas';
3
+ /** True while the user asks for reduced motion (`prefers-reduced-motion: reduce`). */
4
+ export declare function usePrefersReducedMotion(): boolean;
5
+ export interface EdgeAnimationProps {
6
+ /** The animation (`edge.data.animation`). Renders nothing when null. */
7
+ animation: CanvasEdgeAnimation | null | undefined;
8
+ /** SVG path data of the edge, as your edge draws it. */
9
+ path: string;
10
+ /** Edge id: keeps glow filter ids unique. */
11
+ id: string;
12
+ /** Colour when the animation has none (the edge's stroke). Default `currentColor`. */
13
+ stroke?: string;
14
+ /** Hold the first frame. Default: follow `prefers-reduced-motion`. */
15
+ reducedMotion?: boolean;
16
+ }
17
+ /**
18
+ * The moving part of an animated edge (dots, dashes, a beam or a pulse) as an SVG `<g>`, drawn
19
+ * along `path` with SMIL, so nothing runs per frame in JavaScript. Put it in your own React Flow
20
+ * edge after `<BaseEdge>`, or use `<AnimatedEdge>`. It ignores the pointer.
21
+ */
22
+ export declare function EdgeAnimation({ animation, path, id, stroke, reducedMotion }: EdgeAnimationProps): React.JSX.Element | null;
23
+ /** The props React Flow passes a custom edge (the subset `<AnimatedEdge>` uses). */
24
+ export interface AnimatedEdgeProps {
25
+ id: string;
26
+ sourceX: number;
27
+ sourceY: number;
28
+ targetX: number;
29
+ targetY: number;
30
+ sourcePosition?: Position;
31
+ targetPosition?: Position;
32
+ /** `data.animation` is the animation; `data.pathType` the path style (default `default`, a bézier). */
33
+ data?: {
34
+ animation?: CanvasEdgeAnimation | null;
35
+ pathType?: CanvasAnimatedEdgePathType;
36
+ [key: string]: any;
37
+ };
38
+ label?: React.ReactNode;
39
+ labelStyle?: React.CSSProperties;
40
+ style?: React.CSSProperties;
41
+ markerStart?: string;
42
+ markerEnd?: string;
43
+ selected?: boolean;
44
+ /** Width of the invisible line that takes the pointer. Default 20. */
45
+ interactionWidth?: number;
46
+ /** Hold the first frame. Default: follow `prefers-reduced-motion`. */
47
+ reducedMotion?: boolean;
48
+ [key: string]: any;
49
+ }
50
+ /**
51
+ * A React Flow edge that plays `data.animation` (travelling dots, marching dashes, a beam or a
52
+ * pulse) over its line. Register it as an edge type (`edgeTypes={{ animated: AnimatedEdge }}`) and
53
+ * give edges `type: "animated"`; `data.pathType` picks the path (`default`, `straight`, `step`,
54
+ * `smoothstep`, `simplebezier`), drawn as React Flow draws it. An edge without an animation is a
55
+ * plain edge. Agents change animations with `createCanvasEdgeAnimationToolProvider`.
56
+ */
57
+ export declare function AnimatedEdge(props: AnimatedEdgeProps): React.JSX.Element;
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+ import { type CanvasAnimatedEdgePathType, type CanvasEdgeAnimation, type Position } from '@pixerate/editor/canvas';
3
+ /** True while the user asks for reduced motion (`prefers-reduced-motion: reduce`). */
4
+ export declare function usePrefersReducedMotion(): boolean;
5
+ export interface EdgeAnimationProps {
6
+ /** The animation (`edge.data.animation`). Renders nothing when null. */
7
+ animation: CanvasEdgeAnimation | null | undefined;
8
+ /** SVG path data of the edge, as your edge draws it. */
9
+ path: string;
10
+ /** Edge id: keeps glow filter ids unique. */
11
+ id: string;
12
+ /** Colour when the animation has none (the edge's stroke). Default `currentColor`. */
13
+ stroke?: string;
14
+ /** Hold the first frame. Default: follow `prefers-reduced-motion`. */
15
+ reducedMotion?: boolean;
16
+ }
17
+ /**
18
+ * The moving part of an animated edge (dots, dashes, a beam or a pulse) as an SVG `<g>`, drawn
19
+ * along `path` with SMIL, so nothing runs per frame in JavaScript. Put it in your own React Flow
20
+ * edge after `<BaseEdge>`, or use `<AnimatedEdge>`. It ignores the pointer.
21
+ */
22
+ export declare function EdgeAnimation({ animation, path, id, stroke, reducedMotion }: EdgeAnimationProps): React.JSX.Element | null;
23
+ /** The props React Flow passes a custom edge (the subset `<AnimatedEdge>` uses). */
24
+ export interface AnimatedEdgeProps {
25
+ id: string;
26
+ sourceX: number;
27
+ sourceY: number;
28
+ targetX: number;
29
+ targetY: number;
30
+ sourcePosition?: Position;
31
+ targetPosition?: Position;
32
+ /** `data.animation` is the animation; `data.pathType` the path style (default `default`, a bézier). */
33
+ data?: {
34
+ animation?: CanvasEdgeAnimation | null;
35
+ pathType?: CanvasAnimatedEdgePathType;
36
+ [key: string]: any;
37
+ };
38
+ label?: React.ReactNode;
39
+ labelStyle?: React.CSSProperties;
40
+ style?: React.CSSProperties;
41
+ markerStart?: string;
42
+ markerEnd?: string;
43
+ selected?: boolean;
44
+ /** Width of the invisible line that takes the pointer. Default 20. */
45
+ interactionWidth?: number;
46
+ /** Hold the first frame. Default: follow `prefers-reduced-motion`. */
47
+ reducedMotion?: boolean;
48
+ [key: string]: any;
49
+ }
50
+ /**
51
+ * A React Flow edge that plays `data.animation` (travelling dots, marching dashes, a beam or a
52
+ * pulse) over its line. Register it as an edge type (`edgeTypes={{ animated: AnimatedEdge }}`) and
53
+ * give edges `type: "animated"`; `data.pathType` picks the path (`default`, `straight`, `step`,
54
+ * `smoothstep`, `simplebezier`), drawn as React Flow draws it. An edge without an animation is a
55
+ * plain edge. Agents change animations with `createCanvasEdgeAnimationToolProvider`.
56
+ */
57
+ export declare function AnimatedEdge(props: AnimatedEdgeProps): React.JSX.Element;