treege 3.0.0-beta.8 → 3.0.0-beta.80
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/LICENSE +18 -12
- package/README.md +448 -79
- package/dist/DefaultSubmitButton-Bk5U_6Qm.js +1819 -0
- package/dist/ThemeContext-DeWmeqHK.js +978 -0
- package/dist/editor/components/input/ComboboxWithCreate.d.ts +2 -1
- package/dist/editor/components/styles/EditorStyles.d.ts +2 -0
- package/dist/editor/constants/defaultNode.d.ts +1 -1
- package/dist/editor/constants/edgeTypes.d.ts +3 -2
- package/dist/editor/constants/inputTypeIcons.d.ts +3 -0
- package/dist/editor/constants/nodeSpacing.d.ts +25 -0
- package/dist/editor/constants/nodeTypes.d.ts +4 -5
- package/dist/editor/context/OpenApiContext.d.ts +79 -0
- package/dist/editor/context/TreegeEditorRuntimeProvider.d.ts +78 -0
- package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/controls/MiniMapControl.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +20 -0
- package/dist/editor/features/TreegeEditor/dialogs/ChangeNodeTypeDialog.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/dialogs/DeleteNodeDialog.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/dialogs/HeadersDialog.d.ts +19 -0
- package/dist/editor/features/TreegeEditor/dialogs/OpenApiDialog.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +3 -0
- package/dist/editor/features/TreegeEditor/forms/HttpConfigForm.d.ts +4 -1
- package/dist/editor/features/TreegeEditor/forms/JsonTemplateEditor.d.ts +13 -0
- package/dist/editor/features/TreegeEditor/forms/OptionsMappingFields.d.ts +34 -0
- package/dist/editor/features/TreegeEditor/forms/OptionsSourceForm.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/forms/SensitiveHeaderWarning.d.ts +13 -0
- package/dist/editor/features/TreegeEditor/forms/SubmitConfigForm.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +20 -0
- package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +2 -1
- package/dist/editor/features/TreegeEditor/inputs/OptionImageField.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/inputs/SelectNodeGroup.d.ts +22 -1
- package/dist/editor/features/TreegeEditor/layout/AutoLayout.d.ts +15 -0
- package/dist/editor/features/TreegeEditor/listeners/FlowChangeEmitter.d.ts +19 -0
- package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +5 -0
- package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +25 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeGroupBadge.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeImage.d.ts +5 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeImageButton.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +12 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +10 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeRequiredButton.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeStackOrderButtons.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeTypePickerMenuContent.d.ts +12 -0
- package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +4 -2
- package/dist/editor/features/TreegeEditor/panel/AIGeneratorDialog.d.ts +16 -0
- package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +7 -2
- 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 +6 -2
- package/dist/editor/hooks/useFlowConnections.d.ts +14 -0
- package/dist/editor/hooks/useFlowContent.d.ts +16 -0
- package/dist/editor/hooks/useHistoryStore.d.ts +26 -0
- package/dist/editor/hooks/useIsStackedEdge.d.ts +8 -0
- package/dist/editor/hooks/useKeyValueRows.d.ts +15 -0
- package/dist/editor/hooks/useNodesSelection.d.ts +5 -5
- package/dist/editor/hooks/useStackPosition.d.ts +14 -0
- package/dist/editor/hooks/useTranslate.d.ts +1 -1
- package/dist/editor/hooks/useUndoRedo.d.ts +31 -0
- package/dist/editor/types/ai.d.ts +65 -0
- package/dist/editor/types/editor.d.ts +106 -10
- package/dist/editor/types/openapi.d.ts +106 -0
- package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
- package/dist/editor/utils/cleanEmptyData.d.ts +18 -0
- package/dist/editor/utils/cleanNodeConfig.d.ts +5 -0
- package/dist/editor/utils/dagreLayout.d.ts +8 -0
- package/dist/editor/utils/edge.d.ts +50 -0
- package/dist/editor/utils/groupColor.d.ts +14 -0
- package/dist/editor/utils/image.d.ts +7 -0
- package/dist/editor/utils/inputTypeIcon.d.ts +6 -0
- package/dist/editor/utils/jsonBindTarget.d.ts +15 -0
- package/dist/editor/utils/openApiPayload.d.ts +12 -0
- package/dist/editor/utils/openapi.d.ts +35 -0
- package/dist/editor/utils/sensitiveHeaders.d.ts +20 -0
- package/dist/editor/utils/stackPositionIndex.d.ts +9 -0
- package/dist/editor-Dw_ODEe1.js +6507 -0
- package/dist/editor.js +3 -7
- package/dist/main.js +6 -52
- package/dist/renderer/context/TreegeRenderRuntimeProvider.d.ts +135 -0
- package/dist/renderer/context/TreegeRendererProvider.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +19 -11
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.d.ts +7 -7
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputLabel.d.ts +10 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputWrapper.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +20 -15
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultLoadingSkeleton.d.ts +8 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultStep.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButton.d.ts +9 -7
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButtonWrapper.d.ts +11 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +8 -7
- package/dist/renderer/features/TreegeRenderer/native/components/DependencyHint.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/components/OptionItemContent.d.ts +17 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSubmitInput.d.ts +11 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +97 -24
- package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +3 -2
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputLabel.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputWrapper.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultLoadingSkeleton.d.ts +7 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultStep.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +5 -1
- package/dist/renderer/features/TreegeRenderer/web/components/DependencyHint.d.ts +22 -0
- package/dist/renderer/features/TreegeRenderer/web/components/OptionItemContent.d.ts +17 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +11 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/styles/RendererStyles.d.ts +2 -0
- package/dist/renderer/hooks/useInputOptions.d.ts +28 -0
- package/dist/renderer/hooks/useRenderNode.d.ts +62 -0
- package/dist/renderer/hooks/useSubmitHandler.d.ts +36 -0
- package/dist/renderer/hooks/useTranslate.d.ts +7 -5
- package/dist/renderer/index.d.ts +5 -2
- package/dist/renderer/index.native.d.ts +20 -0
- package/dist/renderer/types/renderer.d.ts +316 -42
- package/dist/renderer/utils/flow.d.ts +1 -18
- package/dist/renderer/utils/form.d.ts +54 -2
- package/dist/renderer/utils/http.d.ts +177 -0
- package/dist/renderer/utils/jsonTemplate.d.ts +30 -0
- package/dist/renderer/utils/node.d.ts +29 -1
- package/dist/renderer/utils/sanitize.d.ts +85 -0
- package/dist/renderer/utils/sanitize.native.d.ts +69 -0
- package/dist/renderer/utils/step.d.ts +27 -0
- package/dist/renderer/utils/submit.d.ts +49 -0
- package/dist/renderer/utils/templateDependencies.d.ts +17 -0
- package/dist/renderer-CN83AtIp.js +256 -0
- package/dist/renderer-native.d.ts +2 -0
- package/dist/renderer-native.js +3703 -0
- package/dist/renderer.js +5 -45
- package/dist/shared/components/ui/badge.d.ts +2 -2
- package/dist/shared/components/ui/button.d.ts +3 -3
- package/dist/shared/components/ui/collapsible.d.ts +1 -1
- package/dist/shared/components/ui/command.d.ts +1 -1
- package/dist/shared/components/ui/dropdown-menu.d.ts +1 -1
- package/dist/shared/components/ui/field.d.ts +24 -0
- package/dist/shared/components/ui/form.d.ts +1 -1
- package/dist/shared/components/ui/item.d.ts +23 -0
- package/dist/shared/components/ui/popover.d.ts +10 -2
- package/dist/shared/components/ui/select.d.ts +3 -1
- package/dist/shared/components/ui/sheet.d.ts +1 -1
- package/dist/shared/components/ui/skeleton.d.ts +3 -0
- package/dist/shared/components/ui/toggle-group.d.ts +7 -0
- package/dist/shared/components/ui/toggle.d.ts +9 -0
- package/dist/shared/components/ui/tooltip.d.ts +1 -1
- package/dist/shared/constants/colors.d.ts +45 -0
- package/dist/shared/constants/inputType.d.ts +6 -0
- package/dist/shared/constants/node.d.ts +0 -1
- package/dist/shared/context/PortalContainerContext.d.ts +5 -0
- package/dist/shared/context/ThemeContext.d.ts +2 -0
- package/dist/shared/context/ThemeContext.native.d.ts +22 -0
- package/dist/shared/hooks/useMediaQuery.d.ts +12 -0
- package/dist/shared/hooks/useThemeColors.d.ts +37 -0
- package/dist/shared/locales/ar.json.d.ts +258 -19
- package/dist/shared/locales/de.json.d.ts +259 -20
- package/dist/shared/locales/en.json.d.ts +260 -21
- package/dist/shared/locales/es.json.d.ts +259 -20
- package/dist/shared/locales/fr.json.d.ts +259 -20
- package/dist/shared/locales/it.json.d.ts +259 -20
- package/dist/shared/locales/pt.json.d.ts +259 -20
- package/dist/shared/types/edge.d.ts +6 -0
- package/dist/shared/types/node.d.ts +153 -18
- package/dist/shared/utils/httpRecord.d.ts +20 -0
- package/dist/shared/utils/inputTypeGuards.d.ts +7 -0
- package/dist/shared/utils/nodeTypeGuards.d.ts +1 -6
- package/dist/shared/utils/normalizeLabel.d.ts +21 -0
- package/dist/useRenderNode-BZ7fZJxT.js +527 -0
- package/package.json +54 -22
- package/dist/ThemeContext-BIvs8Kw-.js +0 -758
- package/dist/TreegeEditor-Lv5Tn9_F.js +0 -2152
- package/dist/TreegeRenderer-D3EvsEfJ.js +0 -1413
- package/dist/editor/context/TreegeEditorContext.d.ts +0 -12
- package/dist/editor/features/TreegeEditor/forms/FlowNodeForm.d.ts +0 -2
- package/dist/editor/features/TreegeEditor/inputs/SelectInputType.d.ts +0 -7
- package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +0 -6
- package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +0 -6
- package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +0 -6
- package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +0 -6
- package/dist/editor/hooks/useEdgesSelection.d.ts +0 -11
- package/dist/renderer/context/TreegeConfigContext.d.ts +0 -39
- package/dist/renderer/context/TreegeRendererContext.d.ts +0 -25
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultGroup.d.ts +0 -7
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultGroup.d.ts +0 -6
- /package/dist/editor/components/{data-display/logo.d.ts → branding/Logo.d.ts} +0 -0
|
@@ -5,7 +5,8 @@ export type ComboboxOption = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Reusable Combobox component with search, create, and clear functionality
|
|
7
7
|
*/
|
|
8
|
-
declare const ComboboxWithCreate: ({ options, value, onValueChange, placeholder, searchPlaceholder, createLabel, clearLabel, emptyLabel, className, allowClear, allowCreate, }: {
|
|
8
|
+
declare const ComboboxWithCreate: ({ options, id, value, onValueChange, placeholder, searchPlaceholder, createLabel, clearLabel, emptyLabel, className, allowClear, allowCreate, }: {
|
|
9
|
+
id?: string;
|
|
9
10
|
options: ComboboxOption[];
|
|
10
11
|
value?: string | null;
|
|
11
12
|
onValueChange?: (newValue: string) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
conditional: ({ id, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, markerEnd, style, data, }: import('../features/TreegeEditor/edges/ConditionalEdge').ConditionalEdgeProps) => import("react/jsx-runtime").JSX.Element
|
|
1
|
+
export declare const EDGE_TYPES: {
|
|
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
4
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
export declare const INPUT_TYPE_ICONS: Record<string, LucideIcon>;
|
|
3
|
+
export declare const DEFAULT_INPUT_TYPE_ICON: import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for node spacing and positioning in the flow editor
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Vertical spacing between nodes (in pixels)
|
|
6
|
+
* Used when creating nodes via handle click or AI generation
|
|
7
|
+
*/
|
|
8
|
+
export declare const VERTICAL_NODE_SPACING = 100;
|
|
9
|
+
/**
|
|
10
|
+
* Horizontal offset when placing sibling nodes (in pixels)
|
|
11
|
+
*/
|
|
12
|
+
export declare const HORIZONTAL_NODE_OFFSET = 50;
|
|
13
|
+
/**
|
|
14
|
+
* Default direction for the auto-layout algorithm.
|
|
15
|
+
* "TB" = top to bottom, "LR" = left to right.
|
|
16
|
+
*/
|
|
17
|
+
export declare const LAYOUT_DIRECTION = "TB";
|
|
18
|
+
/**
|
|
19
|
+
* Vertical gap between ranks (parent → child) used by the auto-layout (in pixels).
|
|
20
|
+
*/
|
|
21
|
+
export declare const LAYOUT_VERTICAL_SPACING = 80;
|
|
22
|
+
/**
|
|
23
|
+
* Horizontal gap between siblings used by the auto-layout (in pixels).
|
|
24
|
+
*/
|
|
25
|
+
export declare const LAYOUT_HORIZONTAL_SPACING = 60;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ui: ({ data, isConnectable, type, parentId }: import('../features/TreegeEditor/nodes/UINode').UINodeProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const NODE_TYPES: {
|
|
2
|
+
group: () => null;
|
|
3
|
+
input: import('react').MemoExoticComponent<(props: import('../features/TreegeEditor/nodes/TreegeNode').TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
+
ui: import('react').MemoExoticComponent<(props: import('../features/TreegeEditor/nodes/TreegeNode').TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
6
5
|
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ApiRoute, OpenApiDocument } from '../types/openapi';
|
|
3
|
+
/**
|
|
4
|
+
* The exact input the user fed to the OpenAPI dialog last time it loaded
|
|
5
|
+
* successfully. Kept around so re-opening the dialog can pre-fill the field
|
|
6
|
+
* (the user may want to tweak/re-load the same source).
|
|
7
|
+
*/
|
|
8
|
+
export type OpenApiSourceInput = {
|
|
9
|
+
mode: "url";
|
|
10
|
+
value: string;
|
|
11
|
+
} | {
|
|
12
|
+
mode: "json";
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
interface OpenApiContextValue {
|
|
16
|
+
/**
|
|
17
|
+
* The currently loaded OpenAPI document, or `null` when none is set.
|
|
18
|
+
*/
|
|
19
|
+
document: OpenApiDocument | null;
|
|
20
|
+
/**
|
|
21
|
+
* Memoized flat list of routes derived from `document`.
|
|
22
|
+
*/
|
|
23
|
+
routes: ApiRoute[];
|
|
24
|
+
/**
|
|
25
|
+
* User-provided base URL that overrides the document's `servers[0].url`.
|
|
26
|
+
* Useful when the OpenAPI spec points at a different environment than the
|
|
27
|
+
* one the user wants to call (e.g. staging vs prod). Empty string means
|
|
28
|
+
* "no override — use the document's declared server".
|
|
29
|
+
*/
|
|
30
|
+
baseUrlOverride: string;
|
|
31
|
+
/**
|
|
32
|
+
* Effective base URL: the override when non-empty, otherwise the document's
|
|
33
|
+
* first declared server. Trailing slash trimmed.
|
|
34
|
+
*/
|
|
35
|
+
baseUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Last source input (URL or pasted JSON) used to load the document. `null`
|
|
38
|
+
* before the user has loaded anything.
|
|
39
|
+
*/
|
|
40
|
+
lastSourceInput: OpenApiSourceInput | null;
|
|
41
|
+
/**
|
|
42
|
+
* Replace the loaded document. Pass `null` to clear.
|
|
43
|
+
*/
|
|
44
|
+
setDocument: (next: OpenApiDocument | null) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Replace the base URL override. Pass `""` to clear.
|
|
47
|
+
*/
|
|
48
|
+
setBaseUrlOverride: (next: string) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Record the last source input the user used to load the document.
|
|
51
|
+
*/
|
|
52
|
+
setLastSourceInput: (next: OpenApiSourceInput | null) => void;
|
|
53
|
+
}
|
|
54
|
+
interface OpenApiProviderProps {
|
|
55
|
+
children: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Initial OpenAPI source. Accepts either a pre-parsed document or a URL
|
|
58
|
+
* string — when a URL is given, the provider fetches it on mount and
|
|
59
|
+
* toasts on failure (matching the runtime behavior of the dialog).
|
|
60
|
+
*/
|
|
61
|
+
initialDocument?: OpenApiDocument | string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Initial base URL. When set, takes precedence over the document's
|
|
64
|
+
* `servers[0].url`. Empty string means "no override".
|
|
65
|
+
*/
|
|
66
|
+
initialBaseUrl?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Holds the current OpenAPI document at editor scope. The document is
|
|
70
|
+
* editor-local state (not persisted in the flow JSON), so reloading the
|
|
71
|
+
* editor with a different consumer-supplied initial document is supported.
|
|
72
|
+
*/
|
|
73
|
+
export declare const OpenApiProvider: ({ children, initialDocument, initialBaseUrl }: OpenApiProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
/**
|
|
75
|
+
* Read the OpenAPI context. Returns a no-op default outside of the provider
|
|
76
|
+
* so consumers (e.g., URL combobox) don't have to null-check.
|
|
77
|
+
*/
|
|
78
|
+
export declare const useOpenApi: () => OpenApiContextValue;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { AIConfig } from '../types/ai';
|
|
3
|
+
import { HttpHeaders } from '../../shared/types/node';
|
|
4
|
+
export interface TreegeEditorRuntimeContextValue {
|
|
5
|
+
/**
|
|
6
|
+
* Current language of the editor UI. Also used as the default language for
|
|
7
|
+
* the per-node translation editor in `InputNodeForm`.
|
|
8
|
+
*/
|
|
9
|
+
language: string;
|
|
10
|
+
/**
|
|
11
|
+
* Set the editor UI language at runtime (driven by the language switcher in
|
|
12
|
+
* the actions panel). Seeded from the `language` prop, then owned internally;
|
|
13
|
+
* the consumer can observe changes via `TreegeEditor`'s `onLanguageChange`.
|
|
14
|
+
*/
|
|
15
|
+
setLanguage: (language: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Current flow ID
|
|
18
|
+
*/
|
|
19
|
+
flowId?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Global HTTP headers used by editor-time HTTP calls (e.g. the
|
|
22
|
+
* "Detect fields" button). Forwarded by the consumer; same shape and
|
|
23
|
+
* semantics as `TreegeRenderer`'s `headers`.
|
|
24
|
+
*/
|
|
25
|
+
headers?: HttpHeaders;
|
|
26
|
+
/**
|
|
27
|
+
* Function to set the current flow ID
|
|
28
|
+
* @param flow
|
|
29
|
+
*/
|
|
30
|
+
setFlowId?: (flow?: string) => void;
|
|
31
|
+
/**
|
|
32
|
+
* AI configuration for tree generation
|
|
33
|
+
*/
|
|
34
|
+
aiConfig?: AIConfig;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the node actions sheet is open
|
|
37
|
+
*/
|
|
38
|
+
isNodeSheetOpen: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Function to open or close the node actions sheet
|
|
41
|
+
*/
|
|
42
|
+
setIsNodeSheetOpen: (open: boolean) => void;
|
|
43
|
+
/**
|
|
44
|
+
* ID of the node pending deletion confirmation, or null if no deletion is pending
|
|
45
|
+
*/
|
|
46
|
+
pendingDeleteNodeId: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Open the deletion confirmation dialog for a given node
|
|
49
|
+
*/
|
|
50
|
+
openDeleteNodeConfirmation: (id: string) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Close the deletion confirmation dialog (cancels any pending deletion)
|
|
53
|
+
*/
|
|
54
|
+
closeDeleteNodeConfirmation: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* Pending node type change that requires user confirmation (when the target type only supports a single outgoing edge).
|
|
57
|
+
*/
|
|
58
|
+
pendingNodeTypeChange: PendingNodeTypeChange | null;
|
|
59
|
+
/**
|
|
60
|
+
* Open the node type change confirmation dialog.
|
|
61
|
+
*/
|
|
62
|
+
openNodeTypeChangeConfirmation: (payload: PendingNodeTypeChange) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Close the node type change confirmation dialog (cancels the pending change).
|
|
65
|
+
*/
|
|
66
|
+
closeNodeTypeChangeConfirmation: () => void;
|
|
67
|
+
}
|
|
68
|
+
export interface PendingNodeTypeChange {
|
|
69
|
+
nodeId: string;
|
|
70
|
+
type: string;
|
|
71
|
+
subType?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface TreegeEditorRuntimeProviderProps extends PropsWithChildren {
|
|
74
|
+
value: Omit<TreegeEditorRuntimeContextValue, "isNodeSheetOpen" | "setIsNodeSheetOpen" | "pendingDeleteNodeId" | "openDeleteNodeConfirmation" | "closeDeleteNodeConfirmation" | "pendingNodeTypeChange" | "openNodeTypeChangeConfirmation" | "closeNodeTypeChangeConfirmation">;
|
|
75
|
+
}
|
|
76
|
+
export declare const TreegeEditorRuntimeContext: import('react').Context<TreegeEditorRuntimeContextValue | null>;
|
|
77
|
+
export declare const TreegeEditorRuntimeProvider: ({ children, value }: TreegeEditorRuntimeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
export declare const useTreegeEditorRuntime: () => TreegeEditorRuntimeContextValue;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TreegeEditorProps } from '../../types/editor';
|
|
2
|
-
declare const TreegeEditor: ({
|
|
2
|
+
declare const TreegeEditor: ({ flow, onExportJson, onSave, onChange, onLanguageChange, aiConfig, extraMenuItems, openApi, baseUrl, onAuthorize, headers, onHeadersChange, language: controlledLanguage, theme, defaultLanguage, }: TreegeEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TreegeEditor;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HttpHeaders } from '../../../../shared/types/node';
|
|
2
|
+
interface AuthorizeDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
onAuthorize?: (headers: HttpHeaders) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Reads supported security schemes from the loaded OpenAPI document and
|
|
9
|
+
* collects credentials from the user (Bearer token, API key value, or
|
|
10
|
+
* OAuth2 password grant). On submit, exchanges OAuth2 credentials at the
|
|
11
|
+
* token endpoint, builds the resulting `HttpHeaders`, and calls
|
|
12
|
+
* `onAuthorize` so the consumer can forward them to the renderer's
|
|
13
|
+
* global `headers`.
|
|
14
|
+
*
|
|
15
|
+
* Inspired by Swagger UI's "Authorize" modal. OAuth2 flows other than
|
|
16
|
+
* `password` (auth_code, client_credentials, implicit) are out of scope —
|
|
17
|
+
* they require browser redirects, server-side state, or PKCE.
|
|
18
|
+
*/
|
|
19
|
+
declare const AuthorizeDialog: ({ open, onOpenChange, onAuthorize }: AuthorizeDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default AuthorizeDialog;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HttpHeaders } from '../../../../shared/types/node';
|
|
2
|
+
interface HeadersDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
headers: HttpHeaders;
|
|
6
|
+
onChange: (headers: HttpHeaders) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Edit the editor's "global headers" — forwarded to every HTTP request the
|
|
10
|
+
* runtime form issues (HTTP inputs, submit buttons, options-source fetches).
|
|
11
|
+
* Field-level headers configured on individual nodes override these on key
|
|
12
|
+
* collision (case-insensitive).
|
|
13
|
+
*
|
|
14
|
+
* The dialog is fully controlled: the parent owns the headers list and
|
|
15
|
+
* receives every mutation via `onChange`, so the same value can be forwarded
|
|
16
|
+
* to `TreegeRenderer` without any state duplication.
|
|
17
|
+
*/
|
|
18
|
+
declare const HeadersDialog: ({ open, onOpenChange, headers, onChange }: HeadersDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default HeadersDialog;
|
|
@@ -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
|
|
6
|
-
export default
|
|
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
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
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>;
|
|
3
|
+
export default _default;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { HttpConfig } from '../../../../shared/types/node';
|
|
2
3
|
interface HttpConfigFormProps {
|
|
3
4
|
value: HttpConfig | undefined;
|
|
4
5
|
onChange: (config: HttpConfig | undefined) => void;
|
|
6
|
+
/** Rendered right under the response mapping fields (label/value/description/image). */
|
|
7
|
+
afterMapping?: ReactNode;
|
|
5
8
|
}
|
|
6
|
-
declare const HttpConfigForm: ({ value, onChange }: HttpConfigFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const HttpConfigForm: ({ value, onChange, afterMapping }: HttpConfigFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
export default HttpConfigForm;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface FieldRef {
|
|
2
|
+
nodeId: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
interface JsonTemplateEditorProps {
|
|
6
|
+
/** The raw JSON template string (source of truth). */
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (next: string) => void;
|
|
9
|
+
/** Fields that can be bound to a key or value. */
|
|
10
|
+
fields: FieldRef[];
|
|
11
|
+
}
|
|
12
|
+
declare const JsonTemplateEditor: ({ value, onChange, fields }: JsonTemplateEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default JsonTemplateEditor;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HttpHeaders, OptionsSourceMapping, QueryParams } from '../../../../shared/types/node';
|
|
2
|
+
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
3
|
+
export interface OptionsMappingRequest {
|
|
4
|
+
url?: string;
|
|
5
|
+
method?: HttpMethod;
|
|
6
|
+
headers?: HttpHeaders;
|
|
7
|
+
queryParams?: QueryParams;
|
|
8
|
+
body?: string;
|
|
9
|
+
responsePath?: string;
|
|
10
|
+
}
|
|
11
|
+
interface OptionsMappingFieldsProps {
|
|
12
|
+
/** Request config used by the "Detect fields" button to call the API. */
|
|
13
|
+
request: OptionsMappingRequest;
|
|
14
|
+
/** Current field-to-property mapping. */
|
|
15
|
+
mapping: Partial<OptionsSourceMapping>;
|
|
16
|
+
/** Called with a partial patch whenever a mapping field changes. */
|
|
17
|
+
onMappingChange: (patch: Partial<OptionsSourceMapping>) => void;
|
|
18
|
+
/** When true, also exposes the optional description/image mappings. */
|
|
19
|
+
showOptionalFields?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Walks the first array item to enumerate field paths usable as mapping keys.
|
|
23
|
+
* Includes top-level keys and one level of nested object dot-paths.
|
|
24
|
+
*/
|
|
25
|
+
export declare const detectFieldPaths: (response: unknown, responsePath: string) => string[];
|
|
26
|
+
/**
|
|
27
|
+
* Shared "map response to options" UI: a "Detect fields" button that probes
|
|
28
|
+
* the configured endpoint to enumerate response field paths, plus the
|
|
29
|
+
* value/label (and optionally description/image) mapping inputs. Once fields
|
|
30
|
+
* are detected the inputs become dropdowns of the detected paths. Used by both
|
|
31
|
+
* the HTTP input config and the dynamic options source so they stay identical.
|
|
32
|
+
*/
|
|
33
|
+
declare const OptionsMappingFields: ({ request, mapping, onMappingChange, showOptionalFields }: OptionsMappingFieldsProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export default OptionsMappingFields;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OptionsSource } from '../../../../shared/types/node';
|
|
2
|
+
interface OptionsSourceFormProps {
|
|
3
|
+
value: OptionsSource | undefined;
|
|
4
|
+
onChange: (value: OptionsSource | undefined) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const OptionsSourceForm: ({ value, onChange }: OptionsSourceFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default OptionsSourceForm;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { KeyValueEntry } from '../../../../shared/utils/httpRecord';
|
|
2
|
+
interface SensitiveHeaderWarningProps {
|
|
3
|
+
headers?: KeyValueEntry[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Inline alert shown when a field-level header carries credentials (e.g. an
|
|
7
|
+
* `Authorization` bearer or API key). These headers are persisted in the
|
|
8
|
+
* exported/saved tree, so the user is nudged toward the non-persisted global
|
|
9
|
+
* headers (Authorize) for authentication. Renders nothing when no sensitive
|
|
10
|
+
* header is present.
|
|
11
|
+
*/
|
|
12
|
+
declare const SensitiveHeaderWarning: ({ headers }: SensitiveHeaderWarningProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export default SensitiveHeaderWarning;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SubmitConfig } from '../../../../shared/types/node';
|
|
2
|
+
interface SubmitConfigFormProps {
|
|
3
|
+
value: SubmitConfig | undefined;
|
|
4
|
+
onChange: (config: SubmitConfig | undefined) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const SubmitConfigForm: ({ value, onChange }: SubmitConfigFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default SubmitConfigForm;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { ApiRouteMethod } from '../../../types/openapi';
|
|
3
|
+
import { Input } from '../../../../shared/components/ui/input';
|
|
4
|
+
interface ApiUrlComboboxProps extends Omit<ComponentProps<typeof Input>, "onChange" | "value" | "children"> {
|
|
5
|
+
value: string;
|
|
6
|
+
/**
|
|
7
|
+
* Called whenever the URL changes. When `method` is set, the user picked
|
|
8
|
+
* a route from the OpenAPI document — callers should also update their
|
|
9
|
+
* HTTP method state accordingly.
|
|
10
|
+
*/
|
|
11
|
+
onChange: (url: string, method?: ApiRouteMethod) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Optional trailing adornments rendered next to the input (e.g. a variable
|
|
14
|
+
* picker). Always rendered, regardless of whether an OpenAPI document is
|
|
15
|
+
* loaded.
|
|
16
|
+
*/
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const ApiUrlCombobox: ({ value, onChange, placeholder, children, ...inputProps }: ApiUrlComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default ApiUrlCombobox;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface ComboboxPatternProps {
|
|
2
2
|
value?: string | null;
|
|
3
3
|
onValueChange?: (newValue: string) => void;
|
|
4
|
+
id?: string;
|
|
4
5
|
}
|
|
5
|
-
declare const ComboboxPattern: ({ value, onValueChange }: ComboboxPatternProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const ComboboxPattern: ({ id, value, onValueChange }: ComboboxPatternProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export default ComboboxPattern;
|
|
@@ -1,2 +1,23 @@
|
|
|
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
|
+
* 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;
|
|
21
|
+
}
|
|
22
|
+
declare const SelectNodeGroup: ({ targetNodes, hideLabel, onChange }?: SelectNodeGroupProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
23
|
export default SelectNodeGroup;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LayoutOptions } from '../../../utils/dagreLayout';
|
|
2
|
+
/**
|
|
3
|
+
* Keeps the flow laid out automatically using Dagre.
|
|
4
|
+
*
|
|
5
|
+
* Runs once all nodes have been measured, then re-runs whenever any node's
|
|
6
|
+
* measured size changes. Positions computed by Dagre replace the current
|
|
7
|
+
* `position` of each node — manual repositioning is therefore overridden,
|
|
8
|
+
* which is the expected behavior for a decision-tree editor where topology
|
|
9
|
+
* drives layout.
|
|
10
|
+
*
|
|
11
|
+
* Group children are laid out independently within their parent, preserving
|
|
12
|
+
* React Flow's parent-relative coordinate system.
|
|
13
|
+
*/
|
|
14
|
+
declare const AutoLayout: ({ direction, horizontalSpacing, verticalSpacing }?: LayoutOptions) => null;
|
|
15
|
+
export default AutoLayout;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Flow } from '../../../../shared/types/node';
|
|
2
|
+
type FlowChangeEmitterProps = {
|
|
3
|
+
/** Called (debounced) with the current flow whenever the canvas changes. */
|
|
4
|
+
onChange?: (flow: Flow) => void;
|
|
5
|
+
/** Debounce window in ms. @default 150 */
|
|
6
|
+
debounceMs?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Emits the current flow (id + nodes + edges) through `onChange` whenever the
|
|
10
|
+
* canvas changes, debounced. This is the editor's live outbound channel:
|
|
11
|
+
* unlike Save (gated on having input nodes) it also reports an emptied canvas
|
|
12
|
+
* after Clear, and unlike Save/Export it does NOT strip sensitive headers,
|
|
13
|
+
* since live consumers (e.g. the renderer) need the real flow.
|
|
14
|
+
*
|
|
15
|
+
* Renders nothing — mount it inside `<ReactFlow>` alongside the canvas, like
|
|
16
|
+
* `AutoLayout`.
|
|
17
|
+
*/
|
|
18
|
+
declare const FlowChangeEmitter: ({ onChange, debounceMs }: FlowChangeEmitterProps) => null;
|
|
19
|
+
export default FlowChangeEmitter;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Node, NodeProps } from '@xyflow/react';
|
|
2
|
+
import { InputNodeData, UINodeData } from '../../../../shared/types/node';
|
|
3
|
+
export type TreegeNodeProps = NodeProps<Node<InputNodeData, "input">> | NodeProps<Node<UINodeData, "ui">>;
|
|
4
|
+
declare const _default: import('react').MemoExoticComponent<(props: TreegeNodeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface BottomHandleDropdownProps {
|
|
2
|
+
nodeId: string;
|
|
3
|
+
isConnectable?: boolean;
|
|
4
|
+
/** Submit nodes / multi-selection: the handle stays in the DOM so edges keep an anchor, but it is invisible and non-interactive. */
|
|
5
|
+
hidden?: boolean;
|
|
6
|
+
/** Whether branching (a second outgoing path) is allowed — only for input nodes. */
|
|
7
|
+
canBranch?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* True when the node sits before a linear successor (stack first/middle). The
|
|
10
|
+
* controls then reveal on hover (the bottom border overlaps the next node) and
|
|
11
|
+
* offer "insert between". On a tail (last/single) the controls stay visible.
|
|
12
|
+
*/
|
|
13
|
+
isJunction?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Bottom-of-node controls anchored on the node's bottom border.
|
|
17
|
+
*
|
|
18
|
+
* The branch/add affordance is a real React Flow source `Handle`, so dragging it
|
|
19
|
+
* goes through the native connection system (cursor line, target snapping, leaf
|
|
20
|
+
* convergence, `isValidConnection`) — both for adding a child on a tail node and
|
|
21
|
+
* for branching a new path on a junction node. On junctions an extra "insert
|
|
22
|
+
* between" button splices a node before the existing successor.
|
|
23
|
+
*/
|
|
24
|
+
declare const BottomHandleDropdown: ({ nodeId, isConnectable, hidden, canBranch, isJunction }: BottomHandleDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default BottomHandleDropdown;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputNodeData } from '../../../../../shared/types/node';
|
|
2
|
+
interface NodeInputPreviewProps {
|
|
3
|
+
nodeId: string;
|
|
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;
|
|
10
|
+
}
|
|
11
|
+
declare const NodeInputPreview: ({ nodeId, data }: NodeInputPreviewProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export default NodeInputPreview;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Translatable } from '../../../../../shared/types/translate';
|
|
2
|
+
interface NodeLabelInputProps {
|
|
3
|
+
nodeId: string;
|
|
4
|
+
label?: Translatable;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
autoFocus?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const NodeLabelInput: ({ nodeId, label, placeholder, className, autoFocus }: NodeLabelInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default NodeLabelInput;
|