treege 3.0.0-beta.47 → 3.0.0-beta.49
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/DefaultInputs-CLKy3v8A.js +1761 -0
- package/dist/ThemeContext-Ct1JesKT.js +1353 -0
- package/dist/editor/constants/edgeTypes.d.ts +2 -2
- package/dist/editor/constants/nodeTypes.d.ts +0 -1
- package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/inputs/SelectNodeGroup.d.ts +16 -1
- package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +3 -1
- package/dist/editor/features/TreegeEditor/nodes/components/NodeGroupBadge.d.ts +2 -1
- package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +6 -1
- package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +2 -1
- package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +3 -1
- package/dist/editor/features/TreegeEditor/panel/MultiSelectionPanel.d.ts +7 -0
- package/dist/editor/hooks/useAvailableParentFields.d.ts +13 -0
- package/dist/editor/hooks/useFlowActions.d.ts +1 -0
- package/dist/editor/hooks/useIsStackedEdge.d.ts +8 -0
- package/dist/editor/hooks/useStackPosition.d.ts +2 -0
- package/dist/editor/utils/dagreLayout.d.ts +0 -12
- package/dist/editor/utils/stackPositionIndex.d.ts +9 -0
- package/dist/editor-DwBsZEzm.js +5495 -0
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -4
- package/dist/renderer/context/TreegeRendererContext.d.ts +2 -4
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +3 -4
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
- package/dist/renderer/types/renderer.d.ts +23 -5
- package/dist/renderer/utils/flow.d.ts +1 -18
- package/dist/renderer/utils/step.d.ts +1 -1
- package/dist/renderer-native.js +950 -950
- package/dist/renderer.js +3 -3
- package/dist/shared/constants/node.d.ts +0 -1
- package/dist/shared/locales/ar.json.d.ts +10 -8
- package/dist/shared/locales/de.json.d.ts +10 -8
- package/dist/shared/locales/en.json.d.ts +10 -8
- package/dist/shared/locales/es.json.d.ts +10 -8
- package/dist/shared/locales/fr.json.d.ts +10 -8
- package/dist/shared/locales/it.json.d.ts +10 -8
- package/dist/shared/locales/pt.json.d.ts +10 -8
- package/dist/shared/types/node.d.ts +1 -7
- package/dist/shared/utils/inputTypeGuards.d.ts +7 -0
- package/dist/shared/utils/nodeTypeGuards.d.ts +1 -6
- package/package.json +1 -1
- package/dist/DefaultInputs-UkiUaJcf.js +0 -1734
- package/dist/ThemeContext-CNsS53ku.js +0 -1454
- package/dist/editor/features/TreegeEditor/forms/FlowNodeForm.d.ts +0 -2
- package/dist/editor/features/TreegeEditor/nodes/components/NodeOptions.d.ts +0 -12
- package/dist/editor/hooks/useEdgesSelection.d.ts +0 -11
- package/dist/editor-DrGQB__b.js +0 -5313
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const EDGE_TYPES: {
|
|
2
|
-
conditional: import('react').MemoExoticComponent<({ id, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, markerEnd, style, data, }: import('../features/TreegeEditor/edges/ConditionalEdge').ConditionalEdgeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
|
-
default: import('react').MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, markerEnd, selected }: import('@xyflow/react').EdgeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
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>;
|
|
4
4
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare const NODE_TYPES: {
|
|
2
|
-
flow: import('react').MemoExoticComponent<(props: import('../features/TreegeEditor/nodes/TreegeNode').TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
2
|
group: () => null;
|
|
4
3
|
input: import('react').MemoExoticComponent<(props: import('../features/TreegeEditor/nodes/TreegeNode').TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
5
4
|
ui: import('react').MemoExoticComponent<(props: import('../features/TreegeEditor/nodes/TreegeNode').TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -2,5 +2,5 @@ import { Edge, EdgeProps } from '@xyflow/react';
|
|
|
2
2
|
import { ConditionalEdgeData } from '../../../../shared/types/edge';
|
|
3
3
|
export type ConditionalEdgeType = Edge<ConditionalEdgeData, "conditional">;
|
|
4
4
|
export type ConditionalEdgeProps = EdgeProps<ConditionalEdgeType>;
|
|
5
|
-
declare const _default: import('react').MemoExoticComponent<({ id, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, markerEnd, style, data, }: ConditionalEdgeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
5
|
+
declare const _default: import('react').MemoExoticComponent<({ id, source, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, markerEnd, style, data, }: ConditionalEdgeProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
6
6
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EdgeProps } from '@xyflow/react';
|
|
2
|
-
declare const _default: import('react').MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, markerEnd, selected }: EdgeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
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>;
|
|
3
3
|
export default _default;
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { TreegeNode } from '../../../../shared/types/node';
|
|
2
|
+
interface SelectNodeGroupProps {
|
|
3
|
+
/**
|
|
4
|
+
* Nodes to operate on. When omitted, falls back to the currently selected
|
|
5
|
+
* node from `useNodesSelection` (preserves the original Sheet behavior).
|
|
6
|
+
* Pass an array to drive the input from the multi-selection panel; all
|
|
7
|
+
* mutations (assign / create) are applied to every node in the list.
|
|
8
|
+
*/
|
|
9
|
+
targetNodes?: TreegeNode[];
|
|
10
|
+
/**
|
|
11
|
+
* When true, hides the label above the Select (used by compact panels
|
|
12
|
+
* where a label would be redundant).
|
|
13
|
+
*/
|
|
14
|
+
hideLabel?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const SelectNodeGroup: ({ targetNodes, hideLabel }?: SelectNodeGroupProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
17
|
export default SelectNodeGroup;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, NodeProps } from '@xyflow/react';
|
|
2
|
-
import {
|
|
3
|
-
export type TreegeNodeProps = NodeProps<Node<
|
|
2
|
+
import { InputNodeData, UINodeData } from '../../../../shared/types/node';
|
|
3
|
+
export type TreegeNodeProps = NodeProps<Node<InputNodeData, "input">> | NodeProps<Node<UINodeData, "ui">>;
|
|
4
4
|
declare const _default: import('react').MemoExoticComponent<(props: TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
5
5
|
export default _default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
interface BottomHandleDropdownProps {
|
|
2
2
|
nodeId: string;
|
|
3
3
|
isConnectable?: boolean;
|
|
4
|
+
hoverOnly?: boolean;
|
|
5
|
+
hidden?: boolean;
|
|
4
6
|
}
|
|
5
|
-
declare const BottomHandleDropdown: ({ nodeId, isConnectable }: BottomHandleDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const BottomHandleDropdown: ({ nodeId, isConnectable, hoverOnly, hidden }: BottomHandleDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default BottomHandleDropdown;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface NodeGroupBadgeProps {
|
|
2
|
+
nodeId: string;
|
|
2
3
|
groupId?: string;
|
|
3
4
|
}
|
|
4
|
-
declare const NodeGroupBadge: ({ groupId }: NodeGroupBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
+
declare const NodeGroupBadge: ({ nodeId, groupId }: NodeGroupBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
6
|
export default NodeGroupBadge;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { InputNodeData } from '../../../../../shared/types/node';
|
|
2
2
|
interface NodeInputPreviewProps {
|
|
3
3
|
nodeId: string;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Input node data. Optional so the parent can pass it unconditionally —
|
|
6
|
+
* the component returns `null` when undefined or when the runtime renderer
|
|
7
|
+
* for this input type isn't available.
|
|
8
|
+
*/
|
|
9
|
+
data?: InputNodeData;
|
|
5
10
|
}
|
|
6
11
|
declare const NodeInputPreview: ({ nodeId, data }: NodeInputPreviewProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
12
|
export default NodeInputPreview;
|
|
@@ -4,6 +4,7 @@ interface NodeLabelInputProps {
|
|
|
4
4
|
label?: Translatable;
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
className?: string;
|
|
7
|
+
autoFocus?: boolean;
|
|
7
8
|
}
|
|
8
|
-
declare const NodeLabelInput: ({ nodeId, label, placeholder, className }: NodeLabelInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const NodeLabelInput: ({ nodeId, label, placeholder, className, autoFocus }: NodeLabelInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default NodeLabelInput;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { StackPosition } from '../../../../utils/stackPositionIndex';
|
|
2
3
|
interface NodeWrapperProps extends PropsWithChildren {
|
|
3
4
|
isSubmit?: boolean;
|
|
5
|
+
stackPosition?: StackPosition;
|
|
4
6
|
}
|
|
5
|
-
declare const NodeWrapper: ({ children, isSubmit }: NodeWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const NodeWrapper: ({ children, isSubmit, stackPosition }: NodeWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default NodeWrapper;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Floating bar that appears at the top-center of the canvas when two or more
|
|
3
|
+
* nodes are selected. Exposes batch actions: assign a group (reuses
|
|
4
|
+
* `SelectNodeGroup`), delete the selection, or clear it.
|
|
5
|
+
*/
|
|
6
|
+
declare const MultiSelectionPanel: () => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export default MultiSelectionPanel;
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns every Input ancestor reachable from the given node, traversing
|
|
3
|
+
* incoming edges depth-first. Cycle-safe (visited set). The result is the
|
|
4
|
+
* pool of fields that a downstream node — typically a conditional edge —
|
|
5
|
+
* may reference: each entry exposes the ancestor's `nodeId`, resolved
|
|
6
|
+
* display `label`, raw `name`, input `type`, and static `options` (when
|
|
7
|
+
* defined), so consumers can render a Select/Input bound to the right
|
|
8
|
+
* source value.
|
|
9
|
+
*
|
|
10
|
+
* Non-Input ancestors (UI nodes, flow nodes, groups) are excluded because
|
|
11
|
+
* they cannot supply a runtime value to evaluate a condition against.
|
|
12
|
+
*/
|
|
1
13
|
declare const useAvailableParentFields: (currentNodeId?: string) => {
|
|
2
14
|
label: string;
|
|
3
15
|
name: string | undefined;
|
|
4
16
|
nodeId: string;
|
|
17
|
+
options: import('../../shared/types/node').InputOption[] | undefined;
|
|
5
18
|
type: import('../../shared/types/node').InputType;
|
|
6
19
|
}[];
|
|
7
20
|
export default useAvailableParentFields;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
declare const useFlowActions: () => {
|
|
6
6
|
clearSelection: () => void;
|
|
7
7
|
deleteNode: (id: string) => void;
|
|
8
|
+
deleteNodes: (ids: string[]) => void;
|
|
8
9
|
deleteSelectedNode: () => void;
|
|
9
10
|
selectNode: (id: string) => void;
|
|
10
11
|
updateNodeData: <T extends Record<string, unknown>>(id: string, data: Partial<T>) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An edge is "stacked" when it connects two nodes that belong to the same
|
|
3
|
+
* visual chain — i.e. the source has a linear child (position "first" or
|
|
4
|
+
* "middle") and the target has a linear parent (position "middle" or "last").
|
|
5
|
+
* Stacked edges are not rendered: their endpoints touch border-to-border in
|
|
6
|
+
* the layout, making the line redundant.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useIsStackedEdge: (source: string, target: string) => boolean;
|
|
@@ -5,16 +5,4 @@ export interface LayoutOptions {
|
|
|
5
5
|
horizontalSpacing?: number;
|
|
6
6
|
verticalSpacing?: number;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
9
|
-
* Runs Dagre to compute positions for the given nodes and returns a new
|
|
10
|
-
* `nodes` array with updated `position` fields. Nodes not yet measured by
|
|
11
|
-
* React Flow keep their current position.
|
|
12
|
-
*
|
|
13
|
-
* Groups are metadata only (rendered as colored badges on each child) and
|
|
14
|
-
* do not influence the layout. They are anchored at the origin (0, 0) and
|
|
15
|
-
* never moved, which means a child's `position` (parent-relative in React
|
|
16
|
-
* Flow) is numerically equal to its absolute canvas position — so we can
|
|
17
|
-
* lay out every non-group node in a single Dagre pass without converting
|
|
18
|
-
* coordinates.
|
|
19
|
-
*/
|
|
20
8
|
export declare const getLayoutedElements: (nodes: Node[], edges: Edge[], options?: LayoutOptions) => Node[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Edge } from '@xyflow/react';
|
|
2
|
+
export type StackPosition = "single" | "first" | "middle" | "last";
|
|
3
|
+
/**
|
|
4
|
+
* Memoizes the positions map keyed by the edges array reference. React Flow
|
|
5
|
+
* keeps that reference stable between unrelated updates (drag, selection, …),
|
|
6
|
+
* so selectors that read from this map effectively perform a Map lookup
|
|
7
|
+
* outside of edge mutations.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getPositions: (edges: Edge[]) => Map<string, StackPosition>;
|