@dschz/solid-flow 0.2.0 → 0.2.2
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/index/index.d.ts +29 -31
- package/dist/index/index.js +2 -1
- package/dist/index/index.jsx +2 -1
- package/package.json +1 -1
package/dist/index/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import * as solid_js from 'solid-js';
|
|
2
1
|
import { JSX, ParentProps, ParentComponent, Accessor } from 'solid-js';
|
|
3
|
-
import * as _xyflow_system from '@xyflow/system';
|
|
4
2
|
import { NodeProps as NodeProps$1, NodeBase, InternalNodeBase, EdgeBase, EdgePosition, BezierPathOptions, StepPathOptions, SmoothStepPathOptions, DefaultEdgeOptionsBase, OnReconnect, HandleType, FinalConnectionState, PanOnScrollMode as PanOnScrollMode$1, Position as Position$1, FitViewOptionsBase, ResizeControlVariant as ResizeControlVariant$1, ConnectionMode as ConnectionMode$1, SelectionMode as SelectionMode$1, ConnectionLineType as ConnectionLineType$2, Connection, OnBeforeDeleteBase, XYPosition, Handle as Handle$1, PanelPosition, Viewport, OnMove, OnMoveStart, OnMoveEnd, HandleProps as HandleProps$1, MarkerProps as MarkerProps$1, EdgeToolbarBaseProps, ShouldResize, OnResizeStart, OnResize, OnResizeEnd, ControlPosition, Align, NodeOrigin, SnapGrid, CoordinateExtent, ColorMode, ZIndexMode, ProOptions, OnError, OnConnectStart, OnConnectEnd, OnReconnectStart, OnReconnectEnd, AriaLabelConfig, ColorModeClass, ConnectionState, NodeConnection, ZoomInOut, ViewportHelperFunctionOptions, SetCenterOptions, Rect, FitBoundsOptions, HandleConnection, UpdateNodeInternals } from '@xyflow/system';
|
|
5
3
|
export { Align, AriaLabelConfig, BezierPathOptions, Box, ColorMode, ColorModeClass, Connection, ConnectionLineType, ConnectionMode, ControlLinePosition, ControlPosition, CoordinateExtent, Dimensions, EdgeMarker, EdgeMarkerType, FitBounds, FitBoundsOptions, GetBezierPathParams, GetSmoothStepPathParams, GetStraightPathParams, HandleConnection, IsValidConnection, MarkerType, NodeConnection, NodeOrigin, OnConnect, OnConnectEnd, OnConnectStart, OnConnectStartParams, OnError, OnMove, OnMoveEnd, OnMoveStart, OnReconnect, OnReconnectEnd, OnReconnectStart, OnResize, OnResizeEnd, OnResizeStart, OnSelectionDrag, PanOnScrollMode, PanelPosition, Position, ProOptions, Rect, ResizeControlVariant, ResizeDragEvent, ResizeParams, ResizeParamsWithDirection, SelectionMode, SelectionRect, SetCenter, SetCenterOptions, SetViewport, ShouldResize, SmoothStepPathOptions, SnapGrid, Transform, Viewport, ViewportHelperFunctionOptions, XYPosition, XYZPosition, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds } from '@xyflow/system';
|
|
6
4
|
import { Store, SetStoreFunction } from 'solid-js/store';
|
|
@@ -289,12 +287,12 @@ type EdgeRendererProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
|
|
|
289
287
|
readonly defaultEdgeOptions?: DefaultEdgeOptions;
|
|
290
288
|
readonly reconnectRadius: number;
|
|
291
289
|
};
|
|
292
|
-
declare const EdgeRenderer: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeRendererProps<EdgeType>) =>
|
|
290
|
+
declare const EdgeRenderer: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeRendererProps<EdgeType>) => JSX.Element;
|
|
293
291
|
|
|
294
292
|
type NodeRendererProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
|
|
295
293
|
readonly nodeClickDistance: number;
|
|
296
294
|
};
|
|
297
|
-
declare const NodeRenderer: <NodeType extends Node = Node>(props: NodeRendererProps<NodeType>) =>
|
|
295
|
+
declare const NodeRenderer: <NodeType extends Node = Node>(props: NodeRendererProps<NodeType>) => JSX.Element;
|
|
298
296
|
|
|
299
297
|
type PaneProps = PaneEvents & {
|
|
300
298
|
readonly panOnDrag?: boolean | number[];
|
|
@@ -317,7 +315,7 @@ type PanelProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
|
317
315
|
};
|
|
318
316
|
declare const Panel: (props: ParentProps<PanelProps>) => JSX.Element;
|
|
319
317
|
|
|
320
|
-
declare const ViewportPortal: (props: ParentProps) =>
|
|
318
|
+
declare const ViewportPortal: (props: ParentProps) => JSX.Element;
|
|
321
319
|
|
|
322
320
|
type ZoomProps = {
|
|
323
321
|
readonly initialViewport?: Viewport;
|
|
@@ -336,7 +334,7 @@ type ZoomProps = {
|
|
|
336
334
|
readonly paneClickDistance: number;
|
|
337
335
|
readonly selectionOnDrag?: boolean;
|
|
338
336
|
};
|
|
339
|
-
declare const Zoom: (props: ParentProps<ZoomProps>) =>
|
|
337
|
+
declare const Zoom: (props: ParentProps<ZoomProps>) => JSX.Element;
|
|
340
338
|
|
|
341
339
|
type ConnectionLineType = `${ConnectionLineType$2}`;
|
|
342
340
|
/**
|
|
@@ -370,11 +368,11 @@ type ConnectionLineProps<NodeType extends Node = Node> = {
|
|
|
370
368
|
};
|
|
371
369
|
declare const ConnectionLine: <NodeType extends Node = Node>(props: ParentProps<Partial<ConnectionLineProps<NodeType>>>) => JSX.Element;
|
|
372
370
|
|
|
373
|
-
declare const BaseEdge: (props: ParentProps<BaseEdgeProps>) =>
|
|
371
|
+
declare const BaseEdge: (props: ParentProps<BaseEdgeProps>) => JSX.Element;
|
|
374
372
|
|
|
375
|
-
declare const BezierEdge: (props: BezierEdgeProps) =>
|
|
373
|
+
declare const BezierEdge: (props: BezierEdgeProps) => JSX.Element;
|
|
376
374
|
|
|
377
|
-
declare const BezierEdgeInternal: (props: BezierEdgeProps) =>
|
|
375
|
+
declare const BezierEdgeInternal: (props: BezierEdgeProps) => JSX.Element;
|
|
378
376
|
|
|
379
377
|
type EdgeLabelProps = {
|
|
380
378
|
readonly x?: number;
|
|
@@ -387,7 +385,7 @@ type EdgeLabelProps = {
|
|
|
387
385
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
388
386
|
declare const EdgeLabel: (props: ParentProps<EdgeLabelProps>) => JSX.Element;
|
|
389
387
|
|
|
390
|
-
declare const EdgeLabelRenderer: (props: ParentProps) =>
|
|
388
|
+
declare const EdgeLabelRenderer: (props: ParentProps) => JSX.Element;
|
|
391
389
|
|
|
392
390
|
type EdgeReconnectAnchorProps = {
|
|
393
391
|
readonly type: HandleType;
|
|
@@ -402,19 +400,19 @@ declare const EdgeReconnectAnchor: (props: ParentProps<EdgeReconnectAnchorProps>
|
|
|
402
400
|
type EdgeWrapperProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
|
|
403
401
|
readonly edgeId: string;
|
|
404
402
|
};
|
|
405
|
-
declare const EdgeWrapper: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeWrapperProps<EdgeType>) =>
|
|
403
|
+
declare const EdgeWrapper: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeWrapperProps<EdgeType>) => JSX.Element;
|
|
406
404
|
|
|
407
|
-
declare const SmoothStepEdge: (props: SmoothStepEdgeProps) =>
|
|
405
|
+
declare const SmoothStepEdge: (props: SmoothStepEdgeProps) => JSX.Element;
|
|
408
406
|
|
|
409
|
-
declare const SmoothStepEdgeInternal: (props: SmoothStepEdgeProps) =>
|
|
407
|
+
declare const SmoothStepEdgeInternal: (props: SmoothStepEdgeProps) => JSX.Element;
|
|
410
408
|
|
|
411
|
-
declare const StepEdge: (props: StepEdgeProps) =>
|
|
409
|
+
declare const StepEdge: (props: StepEdgeProps) => JSX.Element;
|
|
412
410
|
|
|
413
|
-
declare const StepEdgeInternal: (props: StepEdgeProps) =>
|
|
411
|
+
declare const StepEdgeInternal: (props: StepEdgeProps) => JSX.Element;
|
|
414
412
|
|
|
415
|
-
declare const StraightEdge: (props: StraightEdgeProps) =>
|
|
413
|
+
declare const StraightEdge: (props: StraightEdgeProps) => JSX.Element;
|
|
416
414
|
|
|
417
|
-
declare const StraightEdgeInternal: (props: Omit<StraightEdgeProps, "sourcePosition" | "targetPosition">) =>
|
|
415
|
+
declare const StraightEdgeInternal: (props: Omit<StraightEdgeProps, "sourcePosition" | "targetPosition">) => JSX.Element;
|
|
418
416
|
|
|
419
417
|
type HandleProps = Omit<HandleProps$1, "position"> & {
|
|
420
418
|
readonly position: Position;
|
|
@@ -431,28 +429,28 @@ type MarkerProps = MarkerProps$1 & {
|
|
|
431
429
|
};
|
|
432
430
|
declare const Marker: (props: MarkerProps) => JSX.Element;
|
|
433
431
|
|
|
434
|
-
declare const MarkerDefinition: () =>
|
|
432
|
+
declare const MarkerDefinition: () => JSX.Element;
|
|
435
433
|
|
|
436
434
|
declare const DefaultNode: (props: NodeProps<{
|
|
437
435
|
label: string;
|
|
438
|
-
}, "default">) =>
|
|
436
|
+
}, "default">) => JSX.Element;
|
|
439
437
|
|
|
440
|
-
declare const GroupNode: (props: NodeProps<Record<string, never>>) =>
|
|
438
|
+
declare const GroupNode: (props: NodeProps<Record<string, never>>) => JSX.Element;
|
|
441
439
|
|
|
442
440
|
declare const InputNode: (props: NodeProps<{
|
|
443
441
|
label: string;
|
|
444
|
-
}>) =>
|
|
442
|
+
}>) => JSX.Element;
|
|
445
443
|
|
|
446
444
|
type NodeWrapperProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
|
|
447
445
|
readonly nodeId: string;
|
|
448
446
|
readonly resizeObserver: ResizeObserver;
|
|
449
447
|
readonly nodeClickDistance: number;
|
|
450
448
|
};
|
|
451
|
-
declare const NodeWrapper: <NodeType extends Node = Node>(props: NodeWrapperProps<NodeType>) =>
|
|
449
|
+
declare const NodeWrapper: <NodeType extends Node = Node>(props: NodeWrapperProps<NodeType>) => JSX.Element;
|
|
452
450
|
|
|
453
451
|
declare const OutputNode: (props: NodeProps<{
|
|
454
452
|
label: string;
|
|
455
|
-
}>) =>
|
|
453
|
+
}>) => JSX.Element;
|
|
456
454
|
|
|
457
455
|
type BackgroundVariant = "lines" | "dots" | "cross";
|
|
458
456
|
|
|
@@ -648,7 +646,7 @@ type NodeToolbarProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
|
648
646
|
declare const NodeToolbar: ParentComponent<Partial<NodeToolbarProps>>;
|
|
649
647
|
|
|
650
648
|
type NodeSelectionProps<NodeType extends Node = Node> = NodeSelectionEvents<NodeType> & Pick<NodeEvents<NodeType>, "onNodeDrag" | "onNodeDragStart" | "onNodeDragStop">;
|
|
651
|
-
declare const NodeSelection: <NodeType extends Node = Node>(props: NodeSelectionProps<NodeType>) =>
|
|
649
|
+
declare const NodeSelection: <NodeType extends Node = Node>(props: NodeSelectionProps<NodeType>) => JSX.Element;
|
|
652
650
|
|
|
653
651
|
type SelectionProps = {
|
|
654
652
|
readonly x?: number;
|
|
@@ -657,7 +655,7 @@ type SelectionProps = {
|
|
|
657
655
|
readonly height?: number | string;
|
|
658
656
|
readonly isVisible?: boolean;
|
|
659
657
|
};
|
|
660
|
-
declare const Selection: (props: SelectionProps) =>
|
|
658
|
+
declare const Selection: (props: SelectionProps) => JSX.Element;
|
|
661
659
|
|
|
662
660
|
type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = NodeEvents<NodeType> & NodeSelectionEvents<NodeType> & EdgeEvents<EdgeType> & DeleteEvents<NodeType, EdgeType> & PaneEvents & {
|
|
663
661
|
/**
|
|
@@ -1111,7 +1109,7 @@ type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge>
|
|
|
1111
1109
|
type SolidFlowComponentProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = ParentProps<SolidFlowProps<NodeType, EdgeType>> & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style" | "onselectionchange" | "onSelectionChange">;
|
|
1112
1110
|
declare const SolidFlow: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: SolidFlowComponentProps<NodeType, EdgeType>) => JSX.Element;
|
|
1113
1111
|
|
|
1114
|
-
declare const SolidFlowProvider: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<SolidFlowProps<NodeType, EdgeType>>) =>
|
|
1112
|
+
declare const SolidFlowProvider: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<SolidFlowProps<NodeType, EdgeType>>) => JSX.Element;
|
|
1115
1113
|
|
|
1116
1114
|
type ExtractEdgeInfo<T> = T extends (props: EdgeProps<infer TData, infer TType>) => unknown ? {
|
|
1117
1115
|
data: TData;
|
|
@@ -1305,21 +1303,21 @@ declare function useConnection(): Accessor<ConnectionState>;
|
|
|
1305
1303
|
* @public
|
|
1306
1304
|
* @returns store with an array of nodes
|
|
1307
1305
|
*/
|
|
1308
|
-
declare function useNodes<NodeType extends Node = Node>():
|
|
1306
|
+
declare function useNodes<NodeType extends Node = Node>(): Accessor<NodeType[]>;
|
|
1309
1307
|
/**
|
|
1310
1308
|
* Hook for getting the current edges from the store.
|
|
1311
1309
|
*
|
|
1312
1310
|
* @public
|
|
1313
1311
|
* @returns store with an array of edges
|
|
1314
1312
|
*/
|
|
1315
|
-
declare function useEdges<EdgeType extends Edge = Edge>():
|
|
1313
|
+
declare function useEdges<EdgeType extends Edge = Edge>(): Accessor<EdgeType[]>;
|
|
1316
1314
|
/**
|
|
1317
1315
|
* Hook for getting the current viewport from the store.
|
|
1318
1316
|
*
|
|
1319
1317
|
* @public
|
|
1320
1318
|
* @returns store with the viewport object
|
|
1321
1319
|
*/
|
|
1322
|
-
declare function useViewport():
|
|
1320
|
+
declare function useViewport(): Accessor<Viewport>;
|
|
1323
1321
|
|
|
1324
1322
|
declare function useHandleEdgeSelect(): (id: string) => void;
|
|
1325
1323
|
|
|
@@ -1332,7 +1330,7 @@ declare function useHandleEdgeSelect(): (id: string) => void;
|
|
|
1332
1330
|
* @public
|
|
1333
1331
|
* @returns an accessor that indicates whether the nodes are initialized
|
|
1334
1332
|
*/
|
|
1335
|
-
declare function useNodesInitialized():
|
|
1333
|
+
declare function useNodesInitialized(): Accessor<boolean>;
|
|
1336
1334
|
/**
|
|
1337
1335
|
* Hook for seeing if the viewport is initialized.
|
|
1338
1336
|
*
|
|
@@ -1341,7 +1339,7 @@ declare function useNodesInitialized(): () => boolean;
|
|
|
1341
1339
|
* @public
|
|
1342
1340
|
* @returns an accessor that indicates whether the viewport is initialized
|
|
1343
1341
|
*/
|
|
1344
|
-
declare function useViewportInitialized():
|
|
1342
|
+
declare function useViewportInitialized(): Accessor<boolean>;
|
|
1345
1343
|
|
|
1346
1344
|
/**
|
|
1347
1345
|
* Hook to get an internal node by id.
|
package/dist/index/index.js
CHANGED
|
@@ -62,6 +62,7 @@ function createWritableStore(accessor) {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
+
var scheduleIdleCallback = typeof requestIdleCallback === "function" ? requestIdleCallback : (callback) => setTimeout(callback, 0);
|
|
65
66
|
var EdgeLabelRenderer = (props) => {
|
|
66
67
|
const {
|
|
67
68
|
store
|
|
@@ -4312,7 +4313,7 @@ var createSolidFlow = (props) => {
|
|
|
4312
4313
|
return;
|
|
4313
4314
|
}
|
|
4314
4315
|
pendingEntries = updateEntries;
|
|
4315
|
-
|
|
4316
|
+
scheduleIdleCallback(() => {
|
|
4316
4317
|
batch(() => {
|
|
4317
4318
|
const updates = new Map(pendingEntries);
|
|
4318
4319
|
pendingEntries = void 0;
|
package/dist/index/index.jsx
CHANGED
|
@@ -96,6 +96,7 @@ function createWritableStore(accessor) {
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
+
var scheduleIdleCallback = typeof requestIdleCallback === "function" ? requestIdleCallback : (callback) => setTimeout(callback, 0);
|
|
99
100
|
|
|
100
101
|
// src/components/graph/edge/EdgeLabelRenderer.tsx
|
|
101
102
|
import { Show } from "solid-js";
|
|
@@ -1790,7 +1791,7 @@ var createSolidFlow = (props) => {
|
|
|
1790
1791
|
return;
|
|
1791
1792
|
}
|
|
1792
1793
|
pendingEntries = updateEntries;
|
|
1793
|
-
|
|
1794
|
+
scheduleIdleCallback(() => {
|
|
1794
1795
|
batch2(() => {
|
|
1795
1796
|
const updates = new Map(pendingEntries);
|
|
1796
1797
|
pendingEntries = void 0;
|
package/package.json
CHANGED