feat(ui): add type filter toggles
This commit is contained in:
87
node_modules/@xyflow/react/dist/esm/utils/changes.d.ts
generated
vendored
Normal file
87
node_modules/@xyflow/react/dist/esm/utils/changes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
import { EdgeLookup, NodeLookup, EdgeChange, NodeChange, NodeSelectionChange, EdgeSelectionChange, NodeRemoveChange, EdgeRemoveChange } from '@xyflow/system';
|
||||
import type { Node, Edge, InternalNode } from '../types';
|
||||
/**
|
||||
* Drop in function that applies node changes to an array of nodes.
|
||||
* @public
|
||||
* @param changes - Array of changes to apply.
|
||||
* @param nodes - Array of nodes to apply the changes to.
|
||||
* @returns Array of updated nodes.
|
||||
* @example
|
||||
*```tsx
|
||||
*import { useState, useCallback } from 'react';
|
||||
*import { ReactFlow, applyNodeChanges, type Node, type Edge, type OnNodesChange } from '@xyflow/react';
|
||||
*
|
||||
*export default function Flow() {
|
||||
* const [nodes, setNodes] = useState<Node[]>([]);
|
||||
* const [edges, setEdges] = useState<Edge[]>([]);
|
||||
* const onNodesChange: OnNodesChange = useCallback(
|
||||
* (changes) => {
|
||||
* setNodes((oldNodes) => applyNodeChanges(changes, oldNodes));
|
||||
* },
|
||||
* [setNodes],
|
||||
* );
|
||||
*
|
||||
* return (
|
||||
* <ReactFlow nodes={nodes} edges={edges} onNodesChange={onNodesChange} />
|
||||
* );
|
||||
*}
|
||||
*```
|
||||
* @remarks Various events on the <ReactFlow /> component can produce an {@link NodeChange}
|
||||
* that describes how to update the edges of your flow in some way.
|
||||
* If you don't need any custom behaviour, this util can be used to take an array
|
||||
* of these changes and apply them to your edges.
|
||||
*/
|
||||
export declare function applyNodeChanges<NodeType extends Node = Node>(changes: NodeChange<NodeType>[], nodes: NodeType[]): NodeType[];
|
||||
/**
|
||||
* Drop in function that applies edge changes to an array of edges.
|
||||
* @public
|
||||
* @param changes - Array of changes to apply.
|
||||
* @param edges - Array of edge to apply the changes to.
|
||||
* @returns Array of updated edges.
|
||||
* @example
|
||||
* ```tsx
|
||||
*import { useState, useCallback } from 'react';
|
||||
*import { ReactFlow, applyEdgeChanges } from '@xyflow/react';
|
||||
*
|
||||
*export default function Flow() {
|
||||
* const [nodes, setNodes] = useState([]);
|
||||
* const [edges, setEdges] = useState([]);
|
||||
* const onEdgesChange = useCallback(
|
||||
* (changes) => {
|
||||
* setEdges((oldEdges) => applyEdgeChanges(changes, oldEdges));
|
||||
* },
|
||||
* [setEdges],
|
||||
* );
|
||||
*
|
||||
* return (
|
||||
* <ReactFlow nodes={nodes} edges={edges} onEdgesChange={onEdgesChange} />
|
||||
* );
|
||||
*}
|
||||
*```
|
||||
* @remarks Various events on the <ReactFlow /> component can produce an {@link EdgeChange}
|
||||
* that describes how to update the edges of your flow in some way.
|
||||
* If you don't need any custom behaviour, this util can be used to take an array
|
||||
* of these changes and apply them to your edges.
|
||||
*/
|
||||
export declare function applyEdgeChanges<EdgeType extends Edge = Edge>(changes: EdgeChange<EdgeType>[], edges: EdgeType[]): EdgeType[];
|
||||
export declare function createSelectionChange(id: string, selected: boolean): NodeSelectionChange | EdgeSelectionChange;
|
||||
export declare function getSelectionChanges(items: Map<string, any>, selectedIds?: Set<string>, mutateItem?: boolean): NodeSelectionChange[] | EdgeSelectionChange[];
|
||||
/**
|
||||
* This function is used to find the changes between two sets of elements.
|
||||
* It is used to determine which nodes or edges have been added, removed or replaced.
|
||||
*
|
||||
* @internal
|
||||
* @param params.items = the next set of elements (nodes or edges)
|
||||
* @param params.lookup = a lookup map of the current store elements
|
||||
* @returns an array of changes
|
||||
*/
|
||||
export declare function getElementsDiffChanges({ items, lookup, }: {
|
||||
items: Node[] | undefined;
|
||||
lookup: NodeLookup<InternalNode<Node>>;
|
||||
}): NodeChange[];
|
||||
export declare function getElementsDiffChanges({ items, lookup, }: {
|
||||
items: Edge[] | undefined;
|
||||
lookup: EdgeLookup;
|
||||
}): EdgeChange[];
|
||||
export declare function elementToRemoveChange<T extends Node | Edge>(item: T): NodeRemoveChange | EdgeRemoveChange;
|
||||
//# sourceMappingURL=changes.d.ts.map
|
||||
1
node_modules/@xyflow/react/dist/esm/utils/changes.d.ts.map
generated
vendored
Normal file
1
node_modules/@xyflow/react/dist/esm/utils/changes.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/utils/changes.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA2IzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC3D,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,EAC/B,KAAK,EAAE,QAAQ,EAAE,GAChB,QAAQ,EAAE,CAEZ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC3D,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,EAC/B,KAAK,EAAE,QAAQ,EAAE,GAChB,QAAQ,EAAE,CAEZ;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,mBAAmB,GAAG,mBAAmB,CAM9G;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EACvB,WAAW,GAAE,GAAG,CAAC,MAAM,CAAa,EACpC,UAAU,UAAQ,GACjB,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAqB/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;CACxC,GAAG,UAAU,EAAE,CAAC;AACjB,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;CACpB,GAAG,UAAU,EAAE,CAAC;AAmCjB,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,gBAAgB,GAAG,gBAAgB,CAKzG"}
|
||||
48
node_modules/@xyflow/react/dist/esm/utils/general.d.ts
generated
vendored
Normal file
48
node_modules/@xyflow/react/dist/esm/utils/general.d.ts
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { type Ref, type RefAttributes, JSX } from 'react';
|
||||
import type { Edge, Node } from '../types';
|
||||
/**
|
||||
* Test whether an object is usable as an [`Node`](/api-reference/types/node).
|
||||
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
|
||||
* [`Node`](/api-reference/types/node) if it returns `true`.
|
||||
*
|
||||
* @public
|
||||
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true
|
||||
* @param element - The element to test.
|
||||
* @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript,
|
||||
* this function acts as a type guard and will narrow the type of the value to `Node` if it returns
|
||||
* `true`.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
*import { isNode } from '@xyflow/react';
|
||||
*
|
||||
*if (isNode(node)) {
|
||||
* // ...
|
||||
*}
|
||||
*```
|
||||
*/
|
||||
export declare const isNode: <NodeType extends Node = Node>(element: unknown) => element is NodeType;
|
||||
/**
|
||||
* Test whether an object is usable as an [`Edge`](/api-reference/types/edge).
|
||||
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
|
||||
* [`Edge`](/api-reference/types/edge) if it returns `true`.
|
||||
*
|
||||
* @public
|
||||
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true
|
||||
* @param element - The element to test
|
||||
* @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript,
|
||||
* this function acts as a type guard and will narrow the type of the value to `Edge` if it returns
|
||||
* `true`.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
*import { isEdge } from '@xyflow/react';
|
||||
*
|
||||
*if (isEdge(edge)) {
|
||||
* // ...
|
||||
*}
|
||||
*```
|
||||
*/
|
||||
export declare const isEdge: <EdgeType extends Edge = Edge>(element: unknown) => element is EdgeType;
|
||||
export declare function fixedForwardRef<T, P = {}>(render: (props: P, ref: Ref<T>) => JSX.Element): (props: P & RefAttributes<T>) => JSX.Element;
|
||||
//# sourceMappingURL=general.d.ts.map
|
||||
1
node_modules/@xyflow/react/dist/esm/utils/general.d.ts.map
generated
vendored
Normal file
1
node_modules/@xyflow/react/dist/esm/utils/general.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,aAAa,EAAc,GAAG,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,SAAS,IAAI,kBAAkB,OAAO,KAAG,OAAO,IAAI,QACpD,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,SAAS,IAAI,kBAAkB,OAAO,KAAG,OAAO,IAAI,QACpD,CAAC;AAGhC,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EACvC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,GAC7C,CAAC,KAAK,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAG9C"}
|
||||
3
node_modules/@xyflow/react/dist/esm/utils/index.d.ts
generated
vendored
Normal file
3
node_modules/@xyflow/react/dist/esm/utils/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './changes';
|
||||
export * from './general';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@xyflow/react/dist/esm/utils/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@xyflow/react/dist/esm/utils/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
||||
Reference in New Issue
Block a user