treege 3.0.0-beta.39 → 3.0.0-beta.40
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-8yJMEyMh.js +1557 -0
- package/dist/ThemeContext-Ejgu9Mwr.js +1603 -0
- package/dist/editor/constants/nodeTypes.d.ts +3 -3
- package/dist/editor/context/TreegeEditorContext.d.ts +18 -1
- package/dist/editor/features/TreegeEditor/dialogs/ChangeNodeTypeDialog.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +7 -0
- package/dist/editor/hooks/useFlowActions.d.ts +2 -2
- package/dist/editor/utils/edge.d.ts +14 -0
- package/dist/{editor-CAj1BX2r.js → editor-DWJ95r4g.js} +1340 -1114
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -5
- package/dist/renderer/utils/node.d.ts +9 -0
- package/dist/renderer-native.js +680 -681
- package/dist/renderer.js +3 -4
- package/dist/shared/locales/ar.json.d.ts +7 -0
- package/dist/shared/locales/de.json.d.ts +7 -0
- package/dist/shared/locales/en.json.d.ts +7 -0
- package/dist/shared/locales/es.json.d.ts +7 -0
- package/dist/shared/locales/fr.json.d.ts +7 -0
- package/dist/shared/locales/it.json.d.ts +7 -0
- package/dist/shared/locales/pt.json.d.ts +7 -0
- package/package.json +1 -1
- package/dist/ThemeContext-PGG6Ht__.js +0 -813
- package/dist/editor/features/TreegeEditor/inputs/SelectInputType.d.ts +0 -7
- package/dist/editor/features/TreegeEditor/nodes/components/InputTypeBadge.d.ts +0 -7
- package/dist/renderer-BOjgk8F8.js +0 -1199
- package/dist/separator-Cdfv5nIR.js +0 -351
- package/dist/useRenderNode-OgRe_mb5.js +0 -775
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const NODE_TYPES: {
|
|
2
|
-
flow: import('react').MemoExoticComponent<(
|
|
2
|
+
flow: import('react').MemoExoticComponent<(props: import('../features/TreegeEditor/nodes/TreegeNode').TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
3
|
group: import('react').MemoExoticComponent<({ data, id }: import('../features/TreegeEditor/nodes/GroupNode').GroupNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
-
input: import('react').MemoExoticComponent<(
|
|
5
|
-
ui: import('react').MemoExoticComponent<(
|
|
4
|
+
input: import('react').MemoExoticComponent<(props: import('../features/TreegeEditor/nodes/TreegeNode').TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
5
|
+
ui: import('react').MemoExoticComponent<(props: import('../features/TreegeEditor/nodes/TreegeNode').TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
6
6
|
};
|
|
@@ -38,9 +38,26 @@ export interface TreegeEditorContextValue {
|
|
|
38
38
|
* Close the deletion confirmation dialog (cancels any pending deletion)
|
|
39
39
|
*/
|
|
40
40
|
closeDeleteNodeConfirmation: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Pending node type change that requires user confirmation (when the target type only supports a single outgoing edge).
|
|
43
|
+
*/
|
|
44
|
+
pendingNodeTypeChange: PendingNodeTypeChange | null;
|
|
45
|
+
/**
|
|
46
|
+
* Open the node type change confirmation dialog.
|
|
47
|
+
*/
|
|
48
|
+
openNodeTypeChangeConfirmation: (payload: PendingNodeTypeChange) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Close the node type change confirmation dialog (cancels the pending change).
|
|
51
|
+
*/
|
|
52
|
+
closeNodeTypeChangeConfirmation: () => void;
|
|
53
|
+
}
|
|
54
|
+
export interface PendingNodeTypeChange {
|
|
55
|
+
nodeId: string;
|
|
56
|
+
type: string;
|
|
57
|
+
subType?: string;
|
|
41
58
|
}
|
|
42
59
|
export interface TreegeEditorProviderProps extends PropsWithChildren {
|
|
43
|
-
value: Omit<TreegeEditorContextValue, "isNodeSheetOpen" | "setIsNodeSheetOpen" | "pendingDeleteNodeId" | "openDeleteNodeConfirmation" | "closeDeleteNodeConfirmation">;
|
|
60
|
+
value: Omit<TreegeEditorContextValue, "isNodeSheetOpen" | "setIsNodeSheetOpen" | "pendingDeleteNodeId" | "openDeleteNodeConfirmation" | "closeDeleteNodeConfirmation" | "pendingNodeTypeChange" | "openNodeTypeChangeConfirmation" | "closeNodeTypeChangeConfirmation">;
|
|
44
61
|
}
|
|
45
62
|
export declare const TreegeEditorContext: import('react').Context<TreegeEditorContextValue | null>;
|
|
46
63
|
export declare const TreegeEditorProvider: ({ children, value }: TreegeEditorProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Node, NodeProps } from '@xyflow/react';
|
|
2
2
|
import { FlowNodeData, InputNodeData, UINodeData } from '../../../../shared/types/node';
|
|
3
3
|
export type TreegeNodeType = Node<FlowNodeData, "flow"> | Node<InputNodeData, "input"> | Node<UINodeData, "ui">;
|
|
4
|
-
export type TreegeNodeProps = NodeProps<
|
|
5
|
-
declare const _default: import('react').MemoExoticComponent<(
|
|
4
|
+
export type TreegeNodeProps = NodeProps<Node<FlowNodeData, "flow">> | NodeProps<Node<InputNodeData, "input">> | NodeProps<Node<UINodeData, "ui">>;
|
|
5
|
+
declare const _default: import('react').MemoExoticComponent<(props: TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
6
6
|
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputNodeData } from '../../../../../shared/types/node';
|
|
2
|
+
interface NodeInputPreviewProps {
|
|
3
|
+
nodeId: string;
|
|
4
|
+
data: InputNodeData;
|
|
5
|
+
}
|
|
6
|
+
declare const NodeInputPreview: ({ nodeId, data }: NodeInputPreviewProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export default NodeInputPreview;
|
|
@@ -8,8 +8,8 @@ declare const useFlowActions: () => {
|
|
|
8
8
|
deleteSelectedNode: () => void;
|
|
9
9
|
selectNode: (id: string) => void;
|
|
10
10
|
updateNodeData: <T extends Record<string, unknown>>(id: string, data: Partial<T>) => void;
|
|
11
|
-
updateNodeType: (id: string, type: string) => void;
|
|
11
|
+
updateNodeType: (id: string, type: string, subType?: string) => void;
|
|
12
12
|
updateSelectedNodeData: <T extends Record<string, unknown>>(data: Partial<T>) => void;
|
|
13
|
-
updateSelectedNodeType: (type: string) => void;
|
|
13
|
+
updateSelectedNodeType: (type: string, subType?: string) => void;
|
|
14
14
|
};
|
|
15
15
|
export default useFlowActions;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Edge } from '@xyflow/react';
|
|
2
|
+
/**
|
|
3
|
+
* Re-normalize outgoing edges from a set of affected parent nodes: if a parent
|
|
4
|
+
* now has a single remaining child, convert its outgoing edge back to a
|
|
5
|
+
* "default" type and drop condition-specific data fields.
|
|
6
|
+
*
|
|
7
|
+
* Used after edge or node deletions to keep conditional edges in sync with the
|
|
8
|
+
* presence of siblings.
|
|
9
|
+
*
|
|
10
|
+
* @param edges - The edges remaining after deletion
|
|
11
|
+
* @param affectedParents - Source node IDs whose children changed
|
|
12
|
+
* @returns A new edges array with affected edges normalized
|
|
13
|
+
*/
|
|
14
|
+
export declare const normalizeConditionalEdges: (edges: Edge[], affectedParents: Set<string>) => Edge[];
|