treege 3.0.0-beta.49 → 3.0.0-beta.50

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.
@@ -1,4 +1,4 @@
1
1
  export declare const EDGE_TYPES: {
2
2
  conditional: import('react').MemoExoticComponent<({ id, source, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, markerEnd, style, data, }: import('../features/TreegeEditor/edges/ConditionalEdge').ConditionalEdgeProps) => import("react/jsx-runtime").JSX.Element | null>;
3
- default: import('react').MemoExoticComponent<({ id, source, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, markerEnd, selected, }: import('@xyflow/react').EdgeProps) => import("react/jsx-runtime").JSX.Element | null>;
3
+ default: import('react').MemoExoticComponent<({ id, source, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, markerEnd, selected, }: import('@xyflow/react').EdgeProps) => import("react/jsx-runtime").JSX.Element>;
4
4
  };
@@ -1,3 +1,3 @@
1
1
  import { EdgeProps } from '@xyflow/react';
2
- declare const _default: import('react').MemoExoticComponent<({ id, source, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, markerEnd, selected, }: EdgeProps) => import("react/jsx-runtime").JSX.Element | null>;
2
+ declare const _default: import('react').MemoExoticComponent<({ id, source, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, markerEnd, selected, }: EdgeProps) => import("react/jsx-runtime").JSX.Element>;
3
3
  export default _default;
@@ -12,6 +12,12 @@ interface SelectNodeGroupProps {
12
12
  * where a label would be redundant).
13
13
  */
14
14
  hideLabel?: boolean;
15
+ /**
16
+ * Fired after a successful group assignment or creation. Lets the parent
17
+ * dismiss its surrounding surface (e.g. the badge popover) on commit.
18
+ * Rename is intentionally excluded — it keeps the surface open.
19
+ */
20
+ onChange?: () => void;
15
21
  }
16
- declare const SelectNodeGroup: ({ targetNodes, hideLabel }?: SelectNodeGroupProps) => import("react/jsx-runtime").JSX.Element | null;
22
+ declare const SelectNodeGroup: ({ targetNodes, hideLabel, onChange }?: SelectNodeGroupProps) => import("react/jsx-runtime").JSX.Element | null;
17
23
  export default SelectNodeGroup;
@@ -1,8 +1,7 @@
1
1
  interface BottomHandleDropdownProps {
2
2
  nodeId: string;
3
3
  isConnectable?: boolean;
4
- hoverOnly?: boolean;
5
4
  hidden?: boolean;
6
5
  }
7
- declare const BottomHandleDropdown: ({ nodeId, isConnectable, hoverOnly, hidden }: BottomHandleDropdownProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const BottomHandleDropdown: ({ nodeId, isConnectable, hidden }: BottomHandleDropdownProps) => import("react/jsx-runtime").JSX.Element;
8
7
  export default BottomHandleDropdown;
@@ -2,5 +2,5 @@ interface NodeGroupBadgeProps {
2
2
  nodeId: string;
3
3
  groupId?: string;
4
4
  }
5
- declare const NodeGroupBadge: ({ nodeId, groupId }: NodeGroupBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
5
+ declare const NodeGroupBadge: ({ nodeId, groupId }: NodeGroupBadgeProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export default NodeGroupBadge;
@@ -0,0 +1,6 @@
1
+ interface NodeStackOrderButtonsProps {
2
+ nodeId: string;
3
+ selected?: boolean;
4
+ }
5
+ declare const NodeStackOrderButtons: ({ nodeId, selected }: NodeStackOrderButtonsProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export default NodeStackOrderButtons;
@@ -1,4 +1,13 @@
1
1
  import { OnConnect, OnConnectEnd, OnEdgesDelete } from '@xyflow/react';
2
+ /**
3
+ * Shape passed to the node-creating actions (`onAddFromHandle`, `onInsertAfter`,
4
+ * and the internal `createNodeAndConnect`). Lets callers seed the new node's
5
+ * `type` and `data` while React Flow handles position, id, etc.
6
+ */
7
+ export type NodeInit = {
8
+ type: string;
9
+ data?: Record<string, unknown>;
10
+ };
2
11
  /**
3
12
  * Custom hook to manage flow connections, including connecting nodes,
4
13
  * handling connection ends, and deleting edges with conditional logic.
@@ -8,12 +17,12 @@ declare const useFlowConnections: () => {
8
17
  source: string;
9
18
  target: string;
10
19
  }) => boolean;
11
- onAddFromHandle: (sourceNodeId: string, nodeInit?: {
12
- type: string;
13
- data?: Record<string, unknown>;
14
- }) => void;
20
+ moveStackNodeDown: (nodeId: string) => void;
21
+ moveStackNodeUp: (nodeId: string) => void;
22
+ onAddFromHandle: (sourceNodeId: string, nodeInit?: NodeInit) => void;
15
23
  onConnect: OnConnect;
16
24
  onConnectEnd: OnConnectEnd;
17
25
  onEdgesDelete: OnEdgesDelete;
26
+ onInsertAfter: (sourceNodeId: string, nodeInit?: NodeInit) => void;
18
27
  };
19
28
  export default useFlowConnections;
@@ -1,2 +1,14 @@
1
1
  import { StackPosition } from '../utils/stackPositionIndex';
2
- export declare const useStackPosition: (nodeId: string) => StackPosition;
2
+ export type StackPositionInfo = {
3
+ position: StackPosition;
4
+ isStackHead: boolean;
5
+ isStackTail: boolean;
6
+ isStackMiddle: boolean;
7
+ isStackSingle: boolean;
8
+ };
9
+ /**
10
+ * Returns the stack position of `nodeId` plus convenience booleans derived from
11
+ * it. Uses a shallow equality selector so consumers only re-render when one of
12
+ * the booleans actually flips, not on every edge mutation.
13
+ */
14
+ export declare const useStackPosition: (nodeId: string) => StackPositionInfo;