@pyreon/flow 0.11.5 → 0.11.7
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/README.md +10 -10
- package/lib/index.js.map +1 -1
- package/lib/types/index.d.ts +13 -13
- package/package.json +16 -16
- package/src/components/background.tsx +8 -8
- package/src/components/controls.tsx +9 -9
- package/src/components/flow-component.tsx +46 -46
- package/src/components/handle.tsx +8 -8
- package/src/components/minimap.tsx +5 -5
- package/src/components/node-resizer.tsx +25 -25
- package/src/components/node-toolbar.tsx +12 -12
- package/src/components/panel.tsx +9 -9
- package/src/edges.ts +6 -6
- package/src/flow.ts +11 -11
- package/src/index.ts +17 -17
- package/src/layout.ts +23 -23
- package/src/tests/flow-advanced.test.ts +190 -190
- package/src/tests/flow.test.ts +417 -417
- package/src/types.ts +24 -24
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { VNodeChild } from
|
|
2
|
-
import type { Computed, Signal } from
|
|
1
|
+
import type { VNodeChild } from '@pyreon/core'
|
|
2
|
+
import type { Computed, Signal } from '@pyreon/reactivity'
|
|
3
3
|
|
|
4
4
|
// ─── Position & Geometry ─────────────────────────────────────────────────────
|
|
5
5
|
|
|
@@ -25,13 +25,13 @@ export interface Viewport {
|
|
|
25
25
|
|
|
26
26
|
// ─── Handle ──────────────────────────────────────────────────────────────────
|
|
27
27
|
|
|
28
|
-
export type HandleType =
|
|
28
|
+
export type HandleType = 'source' | 'target'
|
|
29
29
|
|
|
30
30
|
export enum Position {
|
|
31
|
-
Top =
|
|
32
|
-
Right =
|
|
33
|
-
Bottom =
|
|
34
|
-
Left =
|
|
31
|
+
Top = 'top',
|
|
32
|
+
Right = 'right',
|
|
33
|
+
Bottom = 'bottom',
|
|
34
|
+
Left = 'left',
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export interface HandleConfig {
|
|
@@ -71,7 +71,7 @@ export interface FlowNode<TData = Record<string, unknown>> {
|
|
|
71
71
|
|
|
72
72
|
// ─── Edge ────────────────────────────────────────────────────────────────────
|
|
73
73
|
|
|
74
|
-
export type EdgeType =
|
|
74
|
+
export type EdgeType = 'bezier' | 'smoothstep' | 'straight' | 'step'
|
|
75
75
|
|
|
76
76
|
export interface FlowEdge {
|
|
77
77
|
id?: string
|
|
@@ -104,10 +104,10 @@ export type ConnectionRule = Record<string, { outputs: string[] }>
|
|
|
104
104
|
// ─── Node Change Events ──────────────────────────────────────────────────────
|
|
105
105
|
|
|
106
106
|
export type NodeChange =
|
|
107
|
-
| { type:
|
|
108
|
-
| { type:
|
|
109
|
-
| { type:
|
|
110
|
-
| { type:
|
|
107
|
+
| { type: 'position'; id: string; position: XYPosition }
|
|
108
|
+
| { type: 'dimensions'; id: string; dimensions: Dimensions }
|
|
109
|
+
| { type: 'select'; id: string; selected: boolean }
|
|
110
|
+
| { type: 'remove'; id: string }
|
|
111
111
|
|
|
112
112
|
// ─── Edge path result ────────────────────────────────────────────────────────
|
|
113
113
|
|
|
@@ -390,23 +390,23 @@ export interface FlowInstance {
|
|
|
390
390
|
// ─── Layout ──────────────────────────────────────────────────────────────────
|
|
391
391
|
|
|
392
392
|
export type LayoutAlgorithm =
|
|
393
|
-
|
|
|
394
|
-
|
|
|
395
|
-
|
|
|
396
|
-
|
|
|
397
|
-
|
|
|
398
|
-
|
|
|
399
|
-
|
|
|
393
|
+
| 'layered'
|
|
394
|
+
| 'force'
|
|
395
|
+
| 'stress'
|
|
396
|
+
| 'tree'
|
|
397
|
+
| 'radial'
|
|
398
|
+
| 'box'
|
|
399
|
+
| 'rectpacking'
|
|
400
400
|
|
|
401
401
|
export interface LayoutOptions {
|
|
402
402
|
/** Layout direction — default: 'DOWN' */
|
|
403
|
-
direction?:
|
|
403
|
+
direction?: 'UP' | 'DOWN' | 'LEFT' | 'RIGHT'
|
|
404
404
|
/** Spacing between nodes — default: 50 */
|
|
405
405
|
nodeSpacing?: number
|
|
406
406
|
/** Spacing between layers — default: 80 */
|
|
407
407
|
layerSpacing?: number
|
|
408
408
|
/** Edge routing — default: 'orthogonal' */
|
|
409
|
-
edgeRouting?:
|
|
409
|
+
edgeRouting?: 'orthogonal' | 'splines' | 'polyline'
|
|
410
410
|
/** Whether to animate the layout transition — default: true */
|
|
411
411
|
animate?: boolean
|
|
412
412
|
/** Animation duration in ms — default: 300 */
|
|
@@ -423,7 +423,7 @@ export interface FlowProps {
|
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
export interface BackgroundProps {
|
|
426
|
-
variant?:
|
|
426
|
+
variant?: 'dots' | 'lines' | 'cross'
|
|
427
427
|
gap?: number
|
|
428
428
|
size?: number
|
|
429
429
|
color?: string
|
|
@@ -443,11 +443,11 @@ export interface ControlsProps {
|
|
|
443
443
|
showZoomOut?: boolean
|
|
444
444
|
showFitView?: boolean
|
|
445
445
|
showLock?: boolean
|
|
446
|
-
position?:
|
|
446
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
export interface PanelProps {
|
|
450
|
-
position?:
|
|
450
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
451
451
|
style?: string
|
|
452
452
|
class?: string
|
|
453
453
|
children?: VNodeChild
|