@barefootjs/xyflow 0.9.2 → 0.9.4
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/compat.d.ts +3 -3
- package/dist/compat.d.ts.map +1 -1
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/flow-subsystems.d.ts +1 -1
- package/dist/flow-subsystems.d.ts.map +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/index.d.ts +16 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/node-resizer.d.ts +1 -1
- package/dist/node-resizer.d.ts.map +1 -1
- package/dist/node-type-dispatch.d.ts +1 -2
- package/dist/node-type-dispatch.d.ts.map +1 -1
- package/dist/selection.d.ts +1 -1
- package/dist/selection.d.ts.map +1 -1
- package/dist/store.d.ts +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/xyflow.browser.min.js.map +10 -10
- package/package.json +1 -1
- package/src/compat.ts +3 -3
- package/src/connection.ts +2 -2
- package/src/context.ts +1 -1
- package/src/flow-subsystems.ts +4 -4
- package/src/hooks.ts +2 -2
- package/src/index.ts +16 -16
- package/src/node-resizer.ts +1 -1
- package/src/node-type-dispatch.ts +1 -2
- package/src/selection.ts +1 -1
- package/src/store.ts +2 -2
package/package.json
CHANGED
package/src/compat.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { untrack } from '@barefootjs/client'
|
|
9
9
|
import { addEdge as addEdgeUtil, reconnectEdge as reconnectEdgeUtil, pointToRendererPoint } from '@xyflow/system'
|
|
10
|
-
import { useFlow } from './hooks'
|
|
11
|
-
import type { NodeBase, EdgeBase, Viewport, XYPosition } from './types'
|
|
10
|
+
import { useFlow } from './hooks.ts'
|
|
11
|
+
import type { NodeBase, EdgeBase, Viewport, XYPosition } from './types.ts'
|
|
12
12
|
import type { Connection, NodeChange, EdgeChange } from '@xyflow/system'
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -143,7 +143,7 @@ export function useReactFlow<
|
|
|
143
143
|
/**
|
|
144
144
|
* useViewport — reactive viewport getter.
|
|
145
145
|
*/
|
|
146
|
-
export { useViewport } from './hooks'
|
|
146
|
+
export { useViewport } from './hooks.ts'
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* addEdge utility — wraps @xyflow/system's addEdge.
|
package/src/connection.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { untrack } from '@barefootjs/client'
|
|
2
2
|
import { getSmoothStepPath, Position, reconnectEdge as reconnectEdgeUtil } from '@xyflow/system'
|
|
3
|
-
import type { FlowStore, NodeBase, EdgeBase, Connection } from './types'
|
|
4
|
-
import { SVG_NS } from './constants'
|
|
3
|
+
import type { FlowStore, NodeBase, EdgeBase, Connection } from './types.ts'
|
|
4
|
+
import { SVG_NS } from './constants.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Build a connection object for the given source handle / target handle pair.
|
package/src/context.ts
CHANGED
package/src/flow-subsystems.ts
CHANGED
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
import { createEffect, onCleanup, untrack } from '@barefootjs/client'
|
|
20
20
|
import { PanOnScrollMode, XYPanZoom } from '@xyflow/system'
|
|
21
21
|
import type { InternalNodeBase, NodeLookup, Transform, Viewport, XYPosition } from '@xyflow/system'
|
|
22
|
-
import { INFINITE_EXTENT } from './constants'
|
|
23
|
-
import { computeEdgePosition, getEdgePath } from './edge-path'
|
|
24
|
-
import { setupKeyboardHandlers, setupSelectionRectangle } from './selection'
|
|
25
|
-
import type { FlowProps, InternalFlowStore, NodeBase, EdgeBase } from './types'
|
|
22
|
+
import { INFINITE_EXTENT } from './constants.ts'
|
|
23
|
+
import { computeEdgePosition, getEdgePath } from './edge-path.ts'
|
|
24
|
+
import { setupKeyboardHandlers, setupSelectionRectangle } from './selection.ts'
|
|
25
|
+
import type { FlowProps, InternalFlowStore, NodeBase, EdgeBase } from './types.ts'
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Clamp a child node's drag position so the node's rect stays inside
|
package/src/hooks.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useContext } from '@barefootjs/client/runtime'
|
|
2
2
|
import { createMemo, untrack } from '@barefootjs/client/runtime'
|
|
3
3
|
import { pointToRendererPoint } from '@xyflow/system'
|
|
4
|
-
import { FlowContext } from './context'
|
|
5
|
-
import type { FlowStore, Viewport, NodeBase, EdgeBase, XYPosition } from './types'
|
|
4
|
+
import { FlowContext } from './context.ts'
|
|
5
|
+
import type { FlowStore, Viewport, NodeBase, EdgeBase, XYPosition } from './types.ts'
|
|
6
6
|
import type { Signal, Memo } from '@barefootjs/client/runtime'
|
|
7
7
|
|
|
8
8
|
/**
|
package/src/index.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
// via `ref` callbacks.
|
|
10
10
|
|
|
11
11
|
// Store / context / signal hooks
|
|
12
|
-
export { createFlowStore } from './store'
|
|
13
|
-
export { FlowContext } from './context'
|
|
12
|
+
export { createFlowStore } from './store.ts'
|
|
13
|
+
export { FlowContext } from './context.ts'
|
|
14
14
|
export {
|
|
15
15
|
useFlow,
|
|
16
16
|
useViewport,
|
|
@@ -19,22 +19,22 @@ export {
|
|
|
19
19
|
useNodesInitialized,
|
|
20
20
|
useStore,
|
|
21
21
|
screenToFlowPosition,
|
|
22
|
-
} from './hooks'
|
|
22
|
+
} from './hooks.ts'
|
|
23
23
|
|
|
24
24
|
// Geometry helpers consumed by the JSX `<SimpleEdge>` component
|
|
25
|
-
export { computeEdgePosition, getEdgePath } from './edge-path'
|
|
26
|
-
export type { EdgePathTuple } from './edge-path'
|
|
25
|
+
export { computeEdgePosition, getEdgePath } from './edge-path.ts'
|
|
26
|
+
export type { EdgePathTuple } from './edge-path.ts'
|
|
27
27
|
|
|
28
28
|
// Pointer-paced subsystems attached via `<Flow>` / `<Handle>` `ref`
|
|
29
29
|
// callbacks. JSX gives these no leverage — pan/zoom is owned by
|
|
30
30
|
// `XYPanZoom` (D3-zoom-derived), the selection rectangle owns global
|
|
31
31
|
// pointer capture, connection drag uses `elementFromPoint`, and the
|
|
32
32
|
// node resizer needs raw dimension math.
|
|
33
|
-
export { attachFlowSubsystems, clampDragPositionToParent } from './flow-subsystems'
|
|
34
|
-
export { attachConnectionHandler, attachReconnectionHandler } from './connection'
|
|
35
|
-
export { dispatchNodeType } from './node-type-dispatch'
|
|
36
|
-
export type { NodeInitFn } from './node-type-dispatch'
|
|
37
|
-
export { initNodeResizer, ResizeControlVariant } from './node-resizer'
|
|
33
|
+
export { attachFlowSubsystems, clampDragPositionToParent } from './flow-subsystems.ts'
|
|
34
|
+
export { attachConnectionHandler, attachReconnectionHandler } from './connection.ts'
|
|
35
|
+
export { dispatchNodeType } from './node-type-dispatch.ts'
|
|
36
|
+
export type { NodeInitFn } from './node-type-dispatch.ts'
|
|
37
|
+
export { initNodeResizer, ResizeControlVariant } from './node-resizer.ts'
|
|
38
38
|
export type {
|
|
39
39
|
NodeResizerOptions,
|
|
40
40
|
ControlPosition,
|
|
@@ -44,9 +44,9 @@ export type {
|
|
|
44
44
|
OnResizeEnd,
|
|
45
45
|
ShouldResize,
|
|
46
46
|
ResizeControlDirection,
|
|
47
|
-
} from './node-resizer'
|
|
48
|
-
export { setupKeyboardHandlers, setupNodeSelection, setupSelectionRectangle } from './selection'
|
|
49
|
-
export type { SelectionRectOptions } from './selection'
|
|
47
|
+
} from './node-resizer.ts'
|
|
48
|
+
export { setupKeyboardHandlers, setupNodeSelection, setupSelectionRectangle } from './selection.ts'
|
|
49
|
+
export type { SelectionRectOptions } from './selection.ts'
|
|
50
50
|
|
|
51
51
|
// Stable CSS class names for the registry-side JSX components.
|
|
52
52
|
// Imported (rather than declared as inline literals) so site/ui's
|
|
@@ -73,7 +73,7 @@ export {
|
|
|
73
73
|
BF_FLOW_MINIMAP,
|
|
74
74
|
BF_FLOW_MINIMAP_MASK,
|
|
75
75
|
XYFLOW_VIEWPORT,
|
|
76
|
-
} from './classes'
|
|
76
|
+
} from './classes.ts'
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
// Types
|
|
@@ -108,14 +108,14 @@ export type {
|
|
|
108
108
|
SelectionMode,
|
|
109
109
|
OnReconnect,
|
|
110
110
|
Connection,
|
|
111
|
-
} from './types'
|
|
111
|
+
} from './types.ts'
|
|
112
112
|
// HandleType is consumed by the JSX `<Handle>` component (registry-side)
|
|
113
113
|
// for its `type` prop typing. Re-exported here from `@xyflow/system` so
|
|
114
114
|
// consumers don't need a separate import.
|
|
115
115
|
export type { HandleType } from '@xyflow/system'
|
|
116
116
|
|
|
117
117
|
// Compat layer (React Flow API shims for desk migration)
|
|
118
|
-
export { useNodesState, useEdgesState, useReactFlow, addEdge, reconnectEdge } from './compat'
|
|
118
|
+
export { useNodesState, useEdgesState, useReactFlow, addEdge, reconnectEdge } from './compat.ts'
|
|
119
119
|
|
|
120
120
|
// Re-export useful utilities from @xyflow/system
|
|
121
121
|
export {
|
package/src/node-resizer.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type {
|
|
|
18
18
|
ResizeControlDirection,
|
|
19
19
|
} from '@xyflow/system'
|
|
20
20
|
import type { XYResizerChange, XYResizerChildChange, XYResizerInstance } from '@xyflow/system'
|
|
21
|
-
import type { FlowStore } from './types'
|
|
21
|
+
import type { FlowStore } from './types.ts'
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Options for initNodeResizer.
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
* See piconic-ai/barefootjs#1236 for the migration motivation.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import type { NodeBase } from './types'
|
|
20
|
-
import type { NodeComponentProps } from './types'
|
|
19
|
+
import type { NodeBase, NodeComponentProps } from './types.ts'
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* Cross-shape `nodeTypes` entry. The return type covers both supported
|
package/src/selection.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { onCleanup, untrack } from '@barefootjs/client'
|
|
2
2
|
import type { NodeBase, EdgeBase, InternalNodeBase, Transform } from '@xyflow/system'
|
|
3
|
-
import type { FlowStore, InternalFlowStore, SelectionMode } from './types'
|
|
3
|
+
import type { FlowStore, InternalFlowStore, SelectionMode } from './types.ts'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Set up keyboard handlers for the flow container.
|
package/src/store.ts
CHANGED
|
@@ -27,8 +27,8 @@ import type {
|
|
|
27
27
|
NodeDragItem,
|
|
28
28
|
XYPosition,
|
|
29
29
|
} from '@xyflow/system'
|
|
30
|
-
import type { FlowStoreOptions, InternalFlowStore, FitViewOptions } from './types'
|
|
31
|
-
import { INFINITE_EXTENT } from './constants'
|
|
30
|
+
import type { FlowStoreOptions, InternalFlowStore, FitViewOptions } from './types.ts'
|
|
31
|
+
import { INFINITE_EXTENT } from './constants.ts'
|
|
32
32
|
|
|
33
33
|
const DEFAULT_VIEWPORT: Viewport = { x: 0, y: 0, zoom: 1 }
|
|
34
34
|
|