treege 2.1.0 → 3.0.0-beta.2
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/README.md +378 -64
- package/dist/ThemeContext-BIvs8Kw-.js +758 -0
- package/dist/TreegeEditor-BSPfQQk3.js +2151 -0
- package/dist/TreegeRenderer-D3EvsEfJ.js +1413 -0
- package/dist/_name_.css +1 -0
- package/dist/editor/components/data-display/logo.d.ts +5 -0
- package/dist/editor/components/input/ComboboxWithCreate.d.ts +21 -0
- package/dist/editor/constants/defaultNode.d.ts +11 -0
- package/dist/editor/constants/edgeTypes.d.ts +3 -0
- package/dist/editor/constants/nodeTypes.d.ts +6 -0
- package/dist/editor/context/TreegeEditorContext.d.ts +12 -0
- package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +3 -0
- package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/forms/FlowNodeForm.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/forms/GroupNodeForm.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/forms/HttpConfigForm.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/forms/InputNodeForm.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/forms/UINodeForm.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/inputs/SelectInputType.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/inputs/SelectLanguage.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/inputs/SelectNodeGroup.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/inputs/SelectNodeType.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/sheets/NodeActionsSheet.d.ts +2 -0
- package/dist/editor/hooks/useAvailableParentFields.d.ts +7 -0
- package/dist/editor/hooks/useEdgesSelection.d.ts +11 -0
- package/dist/editor/hooks/useFlowActions.d.ts +12 -0
- package/dist/editor/hooks/useFlowConnections.d.ts +15 -0
- package/dist/editor/hooks/useNodesSelection.d.ts +54 -0
- package/dist/editor/hooks/useTranslate.d.ts +19 -0
- package/dist/editor/index.d.ts +4 -0
- package/dist/editor/types/editor.d.ts +37 -0
- package/dist/editor.d.ts +2 -0
- package/dist/editor.js +7 -0
- package/dist/favicon.svg +12 -0
- package/dist/main.d.ts +7 -4
- package/dist/main.js +50 -7672
- package/dist/renderer/context/TreegeConfigContext.d.ts +39 -0
- package/dist/renderer/context/TreegeRendererContext.d.ts +25 -0
- package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +13 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.d.ts +7 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultGroup.d.ts +7 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultHttpInput.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButton.d.ts +7 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +7 -0
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +50 -0
- package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +6 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultGroup.d.ts +6 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputs.d.ts +20 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButtonWrapper.d.ts +10 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultUI.d.ts +7 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +3 -0
- package/dist/renderer/hooks/useTranslate.d.ts +24 -0
- package/dist/renderer/index.d.ts +17 -0
- package/dist/renderer/types/renderer.d.ts +187 -0
- package/dist/renderer/utils/conditions.d.ts +14 -0
- package/dist/renderer/utils/file.d.ts +22 -0
- package/dist/renderer/utils/flow.d.ts +91 -0
- package/dist/renderer/utils/form.d.ts +26 -0
- package/dist/renderer/utils/node.d.ts +16 -0
- package/dist/renderer.d.ts +2 -0
- package/dist/renderer.js +45 -0
- package/dist/shared/components/ui/badge.d.ts +9 -0
- package/dist/shared/components/ui/button.d.ts +10 -0
- package/dist/shared/components/ui/calendar.d.ts +8 -0
- package/dist/shared/components/ui/checkbox.d.ts +4 -0
- package/dist/shared/components/ui/collapsible.d.ts +5 -0
- package/dist/shared/components/ui/command.d.ts +18 -0
- package/dist/shared/components/ui/dialog.d.ts +15 -0
- package/dist/shared/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/shared/components/ui/form.d.ts +5 -0
- package/dist/shared/components/ui/input.d.ts +3 -0
- package/dist/shared/components/ui/label.d.ts +4 -0
- package/dist/shared/components/ui/popover.d.ts +7 -0
- package/dist/shared/components/ui/radio-group.d.ts +5 -0
- package/dist/shared/components/ui/scroll-area.d.ts +5 -0
- package/dist/shared/components/ui/select.d.ts +15 -0
- package/dist/shared/components/ui/separator.d.ts +4 -0
- package/dist/shared/components/ui/sheet.d.ts +13 -0
- package/dist/shared/components/ui/sonner.d.ts +3 -0
- package/dist/shared/components/ui/switch.d.ts +4 -0
- package/dist/shared/components/ui/textarea.d.ts +3 -0
- package/dist/shared/components/ui/tooltip.d.ts +7 -0
- package/dist/shared/constants/inputType.d.ts +19 -0
- package/dist/shared/constants/languages.d.ts +10 -0
- package/dist/shared/constants/node.d.ts +6 -0
- package/dist/shared/constants/operator.d.ts +4 -0
- package/dist/shared/constants/pattern.d.ts +7 -0
- package/dist/shared/constants/uiType.d.ts +4 -0
- package/dist/shared/context/ThemeContext.d.ts +15 -0
- package/dist/shared/hooks/useTranslate.d.ts +23 -0
- package/dist/shared/lib/utils.d.ts +2 -0
- package/dist/shared/locales/ar.json.d.ts +229 -0
- package/dist/shared/locales/de.json.d.ts +229 -0
- package/dist/shared/locales/en.json.d.ts +229 -0
- package/dist/shared/locales/es.json.d.ts +229 -0
- package/dist/shared/locales/fr.json.d.ts +229 -0
- package/dist/shared/locales/it.json.d.ts +229 -0
- package/dist/shared/locales/pt.json.d.ts +229 -0
- package/dist/shared/types/edge.d.ts +34 -0
- package/dist/shared/types/languages.d.ts +5 -0
- package/dist/shared/types/node.d.ts +171 -0
- package/dist/shared/types/operator.d.ts +9 -0
- package/dist/shared/types/translate.d.ts +9 -0
- package/dist/shared/utils/nodeTypeGuards.d.ts +22 -0
- package/dist/shared/utils/translations.d.ts +30 -0
- package/package.json +69 -41
- package/CHANGELOG.md +0 -7
- package/dist/components/DataDisplay/Icons/TreePlusIcon.d.ts +0 -7
- package/dist/components/DataDisplay/Logo/Logo.d.ts +0 -2
- package/dist/components/DataDisplay/Tree/Tree.d.ts +0 -14
- package/dist/components/DataDisplay/Tree/useTree.d.ts +0 -12
- package/dist/components/DataDisplay/TreeCard/TreeCard.d.ts +0 -14
- package/dist/components/DataDisplay/ViewerJSON/ViewerJSON.d.ts +0 -6
- package/dist/components/DataDisplay/ViewerJSON/useViewerJSON.d.ts +0 -4
- package/dist/components/DataDisplay/ViewerJSONAction/ViewerJSONAction.d.ts +0 -6
- package/dist/components/DataDisplay/ViewerJSONAction/useViewerJSONAction.d.ts +0 -11
- package/dist/components/FeedBack/MainModal/MainModal.d.ts +0 -10
- package/dist/components/FeedBack/TreeModal/TreeModal.d.ts +0 -13
- package/dist/components/Layouts/Action/Action.d.ts +0 -6
- package/dist/components/Layouts/Header/Header.d.ts +0 -6
- package/dist/components/Layouts/Main/Main.d.ts +0 -6
- package/dist/components/Layouts/MosaicLayout/MosaicLayout.d.ts +0 -6
- package/dist/components/Layouts/Sidebar/Sidebar.d.ts +0 -6
- package/dist/components/Theme/DarkTheme/DarkTheme.d.ts +0 -6
- package/dist/config/i18n.config.d.ts +0 -2
- package/dist/config/query.config.d.ts +0 -3
- package/dist/config/test.config.d.ts +0 -0
- package/dist/config/theme.config.d.ts +0 -3
- package/dist/constants/colors.d.ts +0 -10
- package/dist/constants/fields.d.ts +0 -152
- package/dist/context/Auth/AuthContext.d.ts +0 -7
- package/dist/context/Auth/AuthProvider.d.ts +0 -7
- package/dist/features/Treege/Treege.d.ts +0 -24
- package/dist/features/Treege/components/Feedback/EndPointWarning.d.ts +0 -8
- package/dist/features/Treege/components/Forms/AssignValueToChildren/AssignValueToChildren.d.ts +0 -8
- package/dist/features/Treege/components/Forms/AssignValueToChildren/Examples/ObjectMappingExample.d.ts +0 -2
- package/dist/features/Treege/components/Forms/FormTreeCardDelete/FormTreeCardDelete.d.ts +0 -5
- package/dist/features/Treege/components/Forms/FormTreeCardDelete/useFormTreeCardDelete.d.ts +0 -5
- package/dist/features/Treege/components/Forms/FormTreeCardMutation/Fields/ApiFieldsConfigAccordion.d.ts +0 -32
- package/dist/features/Treege/components/Forms/FormTreeCardMutation/Fields/ExtraField.d.ts +0 -15
- package/dist/features/Treege/components/Forms/FormTreeCardMutation/Fields/FillerFieldAccordion.d.ts +0 -14
- package/dist/features/Treege/components/Forms/FormTreeCardMutation/FormTreeCardMutation.d.ts +0 -6
- package/dist/features/Treege/components/Forms/FormTreeCardMutation/useFormTreeCardMutation.d.ts +0 -110
- package/dist/features/Treege/components/Inputs/AutocompleteSelectType/AutocompleteSelectType.d.ts +0 -12
- package/dist/features/Treege/components/Inputs/AutocompleteSelectType/index.d.ts +0 -3
- package/dist/features/Treege/components/Inputs/AutocompleteSelectType/useAutocompleteSelectType.d.ts +0 -305
- package/dist/features/Treege/components/Inputs/ButtonCreateTree/ButtonCreateTree.d.ts +0 -2
- package/dist/features/Treege/components/Inputs/ButtonCreateTree/useButtonCreateTree.d.ts +0 -4
- package/dist/features/Treege/components/Inputs/FieldSelectAutocompleteCreatable.d.ts +0 -12
- package/dist/features/Treege/components/TreeCardContainer/TreeCardContainer.d.ts +0 -8
- package/dist/features/Treege/components/TreeCardContainer/useTreeCardContainer.d.ts +0 -10
- package/dist/features/Treege/components/TreeGrid/TreeGrid.d.ts +0 -2
- package/dist/features/Treege/components/TreeGrid/useTreeGrid.d.ts +0 -9
- package/dist/features/Treege/components/TreeNameTextField/TreeNameTextField.d.ts +0 -2
- package/dist/features/Treege/components/TreeNameTextField/index.d.ts +0 -2
- package/dist/features/Treege/components/TreeNameTextField/useTreeNameTextField.d.ts +0 -9
- package/dist/features/Treege/components/TreeSelect/TreeSelect.d.ts +0 -12
- package/dist/features/Treege/components/TreeSelect/index.d.ts +0 -2
- package/dist/features/Treege/components/TreeSelect/useTreeSelect.d.ts +0 -16
- package/dist/features/Treege/context/TreegeProvider.d.ts +0 -90
- package/dist/features/Treege/reducer/treeReducer.d.ts +0 -35
- package/dist/hooks/useTreegeContext/index.d.ts +0 -3
- package/dist/hooks/useTreegeContext/useTreegeContext.d.ts +0 -2
- package/dist/locales/en/button-en.d.ts +0 -11
- package/dist/locales/en/form-en.d.ts +0 -93
- package/dist/locales/en/modal-en.d.ts +0 -9
- package/dist/locales/en/snackMessage-en.d.ts +0 -13
- package/dist/locales/en/translation-en.d.ts +0 -30
- package/dist/locales/fr/button-fr.d.ts +0 -11
- package/dist/locales/fr/form-fr.d.ts +0 -93
- package/dist/locales/fr/modal-fr.d.ts +0 -9
- package/dist/locales/fr/snackMessage-fr.d.ts +0 -13
- package/dist/locales/fr/translation-fr.d.ts +0 -30
- package/dist/main.umd.cjs +0 -97
- package/dist/services/workflows/mutation/usePatchWorkflowsMutation.d.ts +0 -12
- package/dist/services/workflows/mutation/usePostWorkflowMutation.d.ts +0 -11
- package/dist/services/workflows/query/useWorkflowQuery.d.ts +0 -10
- package/dist/services/workflows/query/useWorkflowsQuery.d.ts +0 -10
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/tree/appendNode/appendNode.d.ts +0 -83
- package/dist/utils/tree/appendNode/test/mock.d.ts +0 -16
- package/dist/utils/tree/findNodeByUUIDInTree/findNodeByUUIDInTree.d.ts +0 -8
- package/dist/utils/tree/findNodeByUUIDInTree/test/mock.d.ts +0 -12
- package/dist/utils/tree/findParentNodeByUUIDInTree/findParentNodeByUUIDInTree.d.ts +0 -9
- package/dist/utils/tree/findParentNodeByUUIDInTree/test/mock.d.ts +0 -11
- package/dist/utils/tree/getAllAncestorFromTree/getAllAncestorFromTree.d.ts +0 -12
- package/dist/utils/tree/getAllAncestorFromTree/test/mock.d.ts +0 -3
- package/dist/utils/tree/getNode/getNode.d.ts +0 -9
- package/dist/utils/tree/getNode/test/mock.d.ts +0 -12
- package/dist/utils/tree/getTree/getTree.d.ts +0 -9
- package/dist/utils/tree/getTree/test/mock.d.ts +0 -13
- package/dist/utils/tree/getUniqueTagsInTree/getUniqueTagsInTree.d.ts +0 -7
- package/dist/utils/tree/getUniqueTagsInTree/test/getUniqueTagsInTree.d.ts +0 -1
- package/dist/utils/tree/getUniqueTagsInTree/test/mock.d.ts +0 -10
- package/dist/utils/tree/index.d.ts +0 -9
- package/dist/utils/tree/removeNode/removeNode.d.ts +0 -14
- package/dist/utils/tree/removeNode/test/mock.d.ts +0 -14
- package/dist/utils/tree/updateNodeInTree/test/mock.d.ts +0 -14
- package/dist/utils/tree/updateNodeInTree/updateNodeInTree.d.ts +0 -16
- package/dist/utils/uuid/getUUID.d.ts +0 -5
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Edge, Node } from '@xyflow/react';
|
|
2
|
+
import { FormValues } from '../types/renderer';
|
|
3
|
+
import { ConditionalEdgeData } from '../../shared/types/edge';
|
|
4
|
+
import { Flow, TreegeNodeData } from '../../shared/types/node';
|
|
5
|
+
/**
|
|
6
|
+
* Result from computing the flow render state
|
|
7
|
+
* Contains everything needed to render the form and determine its state
|
|
8
|
+
*
|
|
9
|
+
* This is the output of getFlowRenderState and represents which nodes should be visible
|
|
10
|
+
* based on the current form values and conditional logic.
|
|
11
|
+
*/
|
|
12
|
+
export interface FlowRenderState {
|
|
13
|
+
/**
|
|
14
|
+
* Whether the end of the flow path has been reached (no more unexplored paths)
|
|
15
|
+
* This does NOT mean the form is valid - just that we've traversed as far as possible
|
|
16
|
+
*
|
|
17
|
+
* Use case: Determines if the submit button should be enabled (endOfPathReached + valid form)
|
|
18
|
+
*/
|
|
19
|
+
endOfPathReached: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Set of all visible node IDs for quick lookup
|
|
22
|
+
*
|
|
23
|
+
* Use case: O(1) check if a node is visible (includes parent groups)
|
|
24
|
+
*/
|
|
25
|
+
visibleNodeIds: Set<string>;
|
|
26
|
+
/**
|
|
27
|
+
* All visible nodes (for validation, includes children of groups)
|
|
28
|
+
*
|
|
29
|
+
* Use case: Running validation on all visible input nodes
|
|
30
|
+
*/
|
|
31
|
+
visibleNodes: Node<TreegeNodeData>[];
|
|
32
|
+
/**
|
|
33
|
+
* Visible nodes at root level (to render at top-level, ordered by flow)
|
|
34
|
+
*
|
|
35
|
+
* Use case: Rendering the form - only these nodes need to be rendered at the root
|
|
36
|
+
* (their children will be rendered by group components)
|
|
37
|
+
*/
|
|
38
|
+
visibleRootNodes: Node<TreegeNodeData>[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check if a node is the start node (has no incoming edges)
|
|
42
|
+
* Used by UI components to determine if a node is the first in the flow
|
|
43
|
+
*/
|
|
44
|
+
export declare const isStartNode: (nodeId: string, edges: Edge[]) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Find the start node (node without incoming edges)
|
|
47
|
+
* Prefers input nodes as the start, otherwise takes the first node found
|
|
48
|
+
*/
|
|
49
|
+
export declare const findStartNode: (nodes: Node<TreegeNodeData>[], edges: Edge[]) => Node<TreegeNodeData> | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Get the complete render state for the flow
|
|
52
|
+
*
|
|
53
|
+
* This is the MAIN function that computes everything needed to render the form:
|
|
54
|
+
* 1. Finds the start node (node without incoming edges)
|
|
55
|
+
* 2. Determines which nodes should be visible based on form values and edge conditions
|
|
56
|
+
* 3. Orders them in the correct flow sequence for rendering
|
|
57
|
+
* 4. Detects if we've reached the end of the path (important for submit button state)
|
|
58
|
+
*
|
|
59
|
+
* Progressive Rendering Logic:
|
|
60
|
+
* - Start from the first node (no incoming edges)
|
|
61
|
+
* - Show the current node
|
|
62
|
+
* - If the node has outgoing edges:
|
|
63
|
+
* - Unconditional edges: always follow
|
|
64
|
+
* - Conditional edges: only follow if conditions are met AND all required fields are filled
|
|
65
|
+
* - Fallback edges: follow only if no conditional edges match
|
|
66
|
+
* - If we encounter a node where conditional fields are not yet filled, STOP (wait for user input)
|
|
67
|
+
* - Continue until no more nodes can be revealed
|
|
68
|
+
*
|
|
69
|
+
* @param nodes - All nodes from the editor
|
|
70
|
+
* @param edges - All edges from the editor
|
|
71
|
+
* @param formValues - Current form values
|
|
72
|
+
* @returns Complete flow render state (visible nodes, end-of-path flag, etc.)
|
|
73
|
+
*/
|
|
74
|
+
export declare const getFlowRenderState: (nodes: Node<TreegeNodeData>[], edges: Edge<ConditionalEdgeData>[], formValues: FormValues) => FlowRenderState;
|
|
75
|
+
/**
|
|
76
|
+
* Merge multiple flows into a single flow by recursively replacing FlowNodes with their target flow's nodes
|
|
77
|
+
*
|
|
78
|
+
* This function takes a flow or an array of flows, automatically detects the main flow, then:
|
|
79
|
+
* 1. Replaces each FlowNode with the nodes from its target flow
|
|
80
|
+
* 2. Preserves the order of nodes by inserting sub-flow nodes at the FlowNode position
|
|
81
|
+
* 3. Redirects edges that point to FlowNodes to the first node of the target flow
|
|
82
|
+
* 4. Connects the last nodes of sub-flows to the nodes that followed the FlowNode
|
|
83
|
+
*
|
|
84
|
+
* Main flow detection:
|
|
85
|
+
* - The main flow is automatically identified as the one that references other flows but is not referenced itself
|
|
86
|
+
* - This allows flows to be passed in any order without breaking the merge logic
|
|
87
|
+
*
|
|
88
|
+
* @param flows - A single Flow or an array of flows (can be null/undefined)
|
|
89
|
+
* @returns A single merged Flow containing all nodes and edges
|
|
90
|
+
*/
|
|
91
|
+
export declare const mergeFlows: (flows?: Flow | Flow[] | null) => Flow;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Node } from '@xyflow/react';
|
|
2
|
+
import { FormValues } from '../types/renderer';
|
|
3
|
+
import { InputNodeData } from '../../shared/types/node';
|
|
4
|
+
/**
|
|
5
|
+
* Check if a form field value is considered empty for validation purposes
|
|
6
|
+
* Used for required field validation
|
|
7
|
+
* @param value - The field value to check
|
|
8
|
+
* @returns True if the value is empty (undefined, null, empty string, or empty array)
|
|
9
|
+
*/
|
|
10
|
+
export declare const isFieldEmpty: (value: unknown) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Check if a form field has been filled by the user (presence check)
|
|
13
|
+
* Considers false, 0, and "" as valid filled values
|
|
14
|
+
* Used for conditional edge evaluation in progressive rendering
|
|
15
|
+
* @param fieldName - The name of the form field
|
|
16
|
+
* @param formValues - The current form values
|
|
17
|
+
* @returns True if the field has been filled (any value except undefined/null), false otherwise
|
|
18
|
+
*/
|
|
19
|
+
export declare const checkFormFieldHasValue: (fieldName: string | undefined, formValues: FormValues) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Convert internal form values (keyed by nodeId) to external format (keyed by name)
|
|
22
|
+
* When multiple nodes share the same name, later values overwrite earlier ones
|
|
23
|
+
* example: convertFormValuesToNamedFormat({ id1: 'Alice', id2: 'Bob' }, [ { id: 'id1', data: { name: 'firstName' } }, { id: 'id2', data: { name: 'lastName' } } ])
|
|
24
|
+
* returns { firstName: 'Alice', lastName: 'Bob' }
|
|
25
|
+
*/
|
|
26
|
+
export declare const convertFormValuesToNamedFormat: (formValues: FormValues, nodes: Node<InputNodeData>[]) => Record<string, unknown>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Node } from '@xyflow/react';
|
|
2
|
+
import { InputNodeData, TreegeNodeData } from '../../shared/types/node';
|
|
3
|
+
/**
|
|
4
|
+
* Filter nodes to get only input nodes
|
|
5
|
+
* @param nodes - Array of nodes to filter
|
|
6
|
+
* @returns Array of input nodes only
|
|
7
|
+
*/
|
|
8
|
+
export declare const getInputNodes: (nodes: Node<TreegeNodeData>[]) => Node<InputNodeData>[];
|
|
9
|
+
/**
|
|
10
|
+
* Get the field name (DOM name attribute) for a given node ID
|
|
11
|
+
* Uses node.data.name if available, otherwise falls back to nodeId
|
|
12
|
+
* @param nodeId - The ID of the input node
|
|
13
|
+
* @param nodes - Array of input nodes
|
|
14
|
+
* @returns The field name to use in the DOM, or undefined if node not found
|
|
15
|
+
*/
|
|
16
|
+
export declare const getFieldNameFromNodeId: (nodeId: string, nodes: Node<InputNodeData>[]) => string | undefined;
|
package/dist/renderer.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { c as t, d as s, e as u, f as l, g as r, h as n, D as i, i as o, j as f, k as d, l as p, m as D, n as I, o as T, p as m, q as g, r as F, s as c, v, w as x, T as R, b as S, J as b, K as h, t as C, x as w, y as z, z as A, A as H, C as N, F as k, G as P, I as y, E, H as G, B as V, u as j, a as q } from "./TreegeRenderer-D3EvsEfJ.js";
|
|
2
|
+
import { T as J, g as K, u as U } from "./ThemeContext-BIvs8Kw-.js";
|
|
3
|
+
export {
|
|
4
|
+
t as DefaultAddressInput,
|
|
5
|
+
s as DefaultAutocompleteInput,
|
|
6
|
+
u as DefaultCheckboxInput,
|
|
7
|
+
l as DefaultDateInput,
|
|
8
|
+
r as DefaultDateRangeInput,
|
|
9
|
+
n as DefaultFileInput,
|
|
10
|
+
i as DefaultGroup,
|
|
11
|
+
o as DefaultHiddenInput,
|
|
12
|
+
f as DefaultHttpInput,
|
|
13
|
+
d as DefaultNumberInput,
|
|
14
|
+
p as DefaultPasswordInput,
|
|
15
|
+
D as DefaultRadioInput,
|
|
16
|
+
I as DefaultSelectInput,
|
|
17
|
+
T as DefaultSwitchInput,
|
|
18
|
+
m as DefaultTextAreaInput,
|
|
19
|
+
g as DefaultTextInput,
|
|
20
|
+
F as DefaultTimeInput,
|
|
21
|
+
c as DefaultTimeRangeInput,
|
|
22
|
+
v as Divider,
|
|
23
|
+
J as ThemeProvider,
|
|
24
|
+
x as Title,
|
|
25
|
+
R as TreegeConfigProvider,
|
|
26
|
+
S as TreegeRenderer,
|
|
27
|
+
b as checkFormFieldHasValue,
|
|
28
|
+
h as convertFormValuesToNamedFormat,
|
|
29
|
+
C as defaultInputRenderers,
|
|
30
|
+
w as defaultUI,
|
|
31
|
+
z as evaluateCondition,
|
|
32
|
+
A as evaluateConditions,
|
|
33
|
+
H as fileToSerializable,
|
|
34
|
+
N as filesToSerializable,
|
|
35
|
+
k as findStartNode,
|
|
36
|
+
P as getFlowRenderState,
|
|
37
|
+
K as getTranslatedText,
|
|
38
|
+
y as isFieldEmpty,
|
|
39
|
+
E as isStartNode,
|
|
40
|
+
G as mergeFlows,
|
|
41
|
+
V as serializableToFile,
|
|
42
|
+
U as useTheme,
|
|
43
|
+
j as useTreegeConfig,
|
|
44
|
+
q as useTreegeRenderer
|
|
45
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "purple" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
size?: "default" | "icon" | "icon-lg" | "icon-sm" | "lg" | "sm" | null | undefined;
|
|
5
|
+
variant?: "default" | "link" | "destructive" | "ghost" | "outline" | "secondary" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DayButton, DayPicker } from 'react-day-picker';
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
|
5
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
|
+
declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import { Dialog } from './dialog';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: "default" | "destructive";
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function FormItem({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function FormError({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { FormError, FormItem, FormDescription };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Select: ({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const SelectGroup: ({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const SelectValue: ({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const SelectTrigger: ({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: "sm" | "default";
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const SelectContent: ({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const SelectLabel: ({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const SelectItem: ({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const SelectSeparator: ({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const SelectScrollUpButton: ({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const SelectScrollDownButton: ({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
7
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const INPUT_TYPE: {
|
|
2
|
+
readonly address: "address";
|
|
3
|
+
readonly autocomplete: "autocomplete";
|
|
4
|
+
readonly checkbox: "checkbox";
|
|
5
|
+
readonly date: "date";
|
|
6
|
+
readonly daterange: "daterange";
|
|
7
|
+
readonly file: "file";
|
|
8
|
+
readonly hidden: "hidden";
|
|
9
|
+
readonly http: "http";
|
|
10
|
+
readonly number: "number";
|
|
11
|
+
readonly password: "password";
|
|
12
|
+
readonly radio: "radio";
|
|
13
|
+
readonly select: "select";
|
|
14
|
+
readonly switch: "switch";
|
|
15
|
+
readonly text: "text";
|
|
16
|
+
readonly textarea: "textarea";
|
|
17
|
+
readonly time: "time";
|
|
18
|
+
readonly timerange: "timerange";
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Theme = "dark" | "light" | "system";
|
|
3
|
+
interface ThemeProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
defaultTheme?: Theme;
|
|
6
|
+
storageKey?: string;
|
|
7
|
+
theme?: "dark" | "light";
|
|
8
|
+
}
|
|
9
|
+
interface ThemeProviderState {
|
|
10
|
+
theme: Theme;
|
|
11
|
+
setTheme: (theme: Theme) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const ThemeProvider: ({ children, defaultTheme, storageKey, theme: controlledTheme, ...props }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const useTheme: () => ThemeProviderState;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Translatable } from '../types/translate';
|
|
2
|
+
import { TranslationKey } from '../utils/translations';
|
|
3
|
+
/**
|
|
4
|
+
* Unified hook for translating text (both static and dynamic translations)
|
|
5
|
+
*
|
|
6
|
+
* This hook handles two types of translations:
|
|
7
|
+
* 1. Static translations: Internal UI strings from translation files (passed as string keys)
|
|
8
|
+
* 2. Dynamic translations: User-defined translatable content from nodes (passed as Translatable objects)
|
|
9
|
+
*
|
|
10
|
+
* @param language - The language code to use for translations
|
|
11
|
+
* @returns A function that translates either a translation key or a Translatable object
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Static translation (from translation files)
|
|
15
|
+
* const t = useTranslate("fr");
|
|
16
|
+
* const saveButton = t("common.save"); // "Enregistrer"
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Dynamic translation (from node data)
|
|
20
|
+
* const t = useTranslate("en");
|
|
21
|
+
* const label = t(node.data.label); // Translates user-defined content
|
|
22
|
+
*/
|
|
23
|
+
export declare const useTranslate: (language: string) => (key?: Translatable | TranslationKey | string) => string;
|