f1ow 0.1.5 → 1.0.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/dist/components/Canvas/AnnotationsOverlay.d.ts +34 -0
- package/dist/components/shapes/TextLabel.d.ts +16 -0
- package/dist/f1ow.js +881 -419
- package/dist/f1ow.umd.cjs +880 -418
- package/dist/lib/FlowCanvasProps.d.ts +37 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/utils/camera.d.ts +1 -1
- package/dist/utils/connection.d.ts +26 -1
- package/dist/utils/dragSync.d.ts +50 -0
- package/dist/utils/labelMetrics.d.ts +49 -0
- package/package.json +107 -99
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CanvasElement, ViewportState } from '../../types';
|
|
3
|
+
/** Screen-space bounding box passed to the annotation renderer */
|
|
4
|
+
export interface AnnotationScreenBounds {
|
|
5
|
+
/** Left edge in pixels (relative to canvas container) */
|
|
6
|
+
x: number;
|
|
7
|
+
/** Top edge in pixels (relative to canvas container) */
|
|
8
|
+
y: number;
|
|
9
|
+
/** Width in screen pixels */
|
|
10
|
+
width: number;
|
|
11
|
+
/** Height in screen pixels */
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
/** Context provided to the `renderAnnotation` callback */
|
|
15
|
+
export interface AnnotationContext {
|
|
16
|
+
/** The canvas element being annotated */
|
|
17
|
+
element: CanvasElement;
|
|
18
|
+
/** Screen-space bounding box of the element (after zoom/pan) */
|
|
19
|
+
screenBounds: AnnotationScreenBounds;
|
|
20
|
+
/** Current viewport zoom level */
|
|
21
|
+
scale: number;
|
|
22
|
+
}
|
|
23
|
+
/** Signature for the `renderAnnotation` prop */
|
|
24
|
+
export type RenderAnnotationFn = (ctx: AnnotationContext) => React.ReactNode;
|
|
25
|
+
interface AnnotationsOverlayProps {
|
|
26
|
+
elements: CanvasElement[];
|
|
27
|
+
viewport: ViewportState;
|
|
28
|
+
/** Container dimensions for viewport-culling */
|
|
29
|
+
containerWidth: number;
|
|
30
|
+
containerHeight: number;
|
|
31
|
+
renderAnnotation: RenderAnnotationFn;
|
|
32
|
+
}
|
|
33
|
+
export declare const AnnotationsOverlay: React.FC<AnnotationsOverlayProps>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TextElement, ArrowElement, LineElement } from '../../types';
|
|
3
|
+
export interface TextLabelProps {
|
|
4
|
+
element: TextElement;
|
|
5
|
+
/** The parent connector element (arrow or line) */
|
|
6
|
+
connector: ArrowElement | LineElement;
|
|
7
|
+
onChange: (id: string, updates: Partial<TextElement>) => void;
|
|
8
|
+
/** If true, auto-opens the textarea editor immediately after mount */
|
|
9
|
+
autoEdit?: boolean;
|
|
10
|
+
/** Called to notify parent that text editing started */
|
|
11
|
+
onEditStart?: (id: string) => void;
|
|
12
|
+
/** Called to notify parent that text editing ended */
|
|
13
|
+
onEditEnd?: (id: string, isEmpty: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: React.NamedExoticComponent<TextLabelProps>;
|
|
16
|
+
export default _default;
|