treege 3.0.0-beta.5 → 3.0.0-beta.51
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 +313 -52
- package/dist/DefaultInputs-tsNo-XJa.js +1761 -0
- package/dist/ThemeContext-DRLlkF0n.js +1353 -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 +33 -0
- package/dist/editor/constants/nodeTypes.d.ts +4 -5
- package/dist/editor/context/OpenApiContext.d.ts +79 -0
- package/dist/editor/context/TreegeEditorContext.d.ts +60 -1
- 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/OptionsSourceForm.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/forms/SubmitConfigForm.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +30 -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/nodes/TreegeNode.d.ts +5 -0
- package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +9 -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/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/useHistoryStore.d.ts +26 -0
- package/dist/editor/hooks/useIsStackedEdge.d.ts +8 -0
- package/dist/editor/hooks/useNodesSelection.d.ts +5 -5
- package/dist/editor/hooks/useStackPosition.d.ts +14 -0
- 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 +71 -9
- package/dist/editor/types/openapi.d.ts +81 -0
- package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
- package/dist/editor/utils/dagreLayout.d.ts +8 -0
- package/dist/editor/utils/edge.d.ts +14 -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/openapi.d.ts +35 -0
- package/dist/editor/utils/stackPositionIndex.d.ts +9 -0
- package/dist/editor-HlDmu9kn.js +5831 -0
- package/dist/editor.js +3 -8
- package/dist/main.js +4 -53
- package/dist/renderer/context/TreegeConfigContext.d.ts +3 -27
- package/dist/renderer/context/TreegeRendererContext.d.ts +100 -2
- 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/DefaultInputWrapper.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +21 -15
- 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/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/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 +92 -24
- package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputWrapper.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultStep.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +1 -1
- 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 +3 -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 +57 -0
- package/dist/renderer/hooks/useSubmitHandler.d.ts +35 -0
- package/dist/renderer/hooks/useTranslate.d.ts +6 -4
- package/dist/renderer/index.d.ts +3 -1
- package/dist/renderer/index.native.d.ts +19 -0
- package/dist/renderer/types/renderer.d.ts +131 -33
- package/dist/renderer/utils/flow.d.ts +1 -18
- package/dist/renderer/utils/form.d.ts +22 -2
- package/dist/renderer/utils/http.d.ts +129 -0
- package/dist/renderer/utils/node.d.ts +18 -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 +48 -0
- package/dist/renderer-native.d.ts +2 -0
- package/dist/renderer-native.js +3580 -0
- package/dist/renderer.js +3 -46
- 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/popover.d.ts +4 -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/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 +1 -0
- package/dist/shared/constants/node.d.ts +0 -1
- 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 +221 -18
- package/dist/shared/locales/de.json.d.ts +222 -19
- package/dist/shared/locales/en.json.d.ts +223 -20
- package/dist/shared/locales/es.json.d.ts +222 -19
- package/dist/shared/locales/fr.json.d.ts +222 -19
- package/dist/shared/locales/it.json.d.ts +222 -19
- package/dist/shared/locales/pt.json.d.ts +222 -19
- package/dist/shared/types/edge.d.ts +6 -0
- package/dist/shared/types/node.d.ts +109 -7
- package/dist/shared/utils/inputTypeGuards.d.ts +7 -0
- package/dist/shared/utils/nodeTypeGuards.d.ts +1 -6
- package/package.json +48 -22
- package/dist/ThemeContext-D4xMOrdt.js +0 -759
- package/dist/TreegeEditor-B8FP1rKR.js +0 -2153
- package/dist/TreegeRenderer-BOCobRLr.js +0 -1414
- 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/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
package/dist/editor.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
T as ThemeProvider,
|
|
6
|
-
o as TreegeEditor,
|
|
7
|
-
m as useTheme
|
|
8
|
-
};
|
|
1
|
+
import { t as e } from "./editor-HlDmu9kn.js";
|
|
2
|
+
import { n as t, t as n } from "./ThemeContext-DRLlkF0n.js";
|
|
3
|
+
export { n as ThemeProvider, e as TreegeEditor, t as useTheme };
|
package/dist/main.js
CHANGED
|
@@ -1,53 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { T as
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
D as DefaultAddressInput,
|
|
7
|
-
I as DefaultAutocompleteInput,
|
|
8
|
-
T as DefaultCheckboxInput,
|
|
9
|
-
m as DefaultDateInput,
|
|
10
|
-
g as DefaultDateRangeInput,
|
|
11
|
-
c as DefaultFileInput,
|
|
12
|
-
F as DefaultGroup,
|
|
13
|
-
x as DefaultHiddenInput,
|
|
14
|
-
N as DefaultHttpInput,
|
|
15
|
-
S as DefaultNumberInput,
|
|
16
|
-
b as DefaultPasswordInput,
|
|
17
|
-
v as DefaultRadioInput,
|
|
18
|
-
R as DefaultSelectInput,
|
|
19
|
-
h as DefaultSwitchInput,
|
|
20
|
-
w as DefaultTextAreaInput,
|
|
21
|
-
C as DefaultTextInput,
|
|
22
|
-
z as DefaultTimeInput,
|
|
23
|
-
A as DefaultTimeRangeInput,
|
|
24
|
-
H as Divider,
|
|
25
|
-
u as ThemeProvider,
|
|
26
|
-
k as Title,
|
|
27
|
-
E as TreegeConfigProvider,
|
|
28
|
-
t as TreegeEditor,
|
|
29
|
-
G as TreegeRenderer,
|
|
30
|
-
P as checkFormFieldHasValue,
|
|
31
|
-
y as convertFormValuesToNamedFormat,
|
|
32
|
-
U as defaultInputRenderers,
|
|
33
|
-
V as defaultUI,
|
|
34
|
-
j as evaluateCondition,
|
|
35
|
-
q as evaluateConditions,
|
|
36
|
-
B as fileToSerializable,
|
|
37
|
-
J as filesToSerializable,
|
|
38
|
-
K as findStartNode,
|
|
39
|
-
L as getFlowRenderState,
|
|
40
|
-
l as getStaticTranslations,
|
|
41
|
-
r as getTranslatedText,
|
|
42
|
-
M as isFieldEmpty,
|
|
43
|
-
i as isFlowNode,
|
|
44
|
-
o as isGroupNode,
|
|
45
|
-
n as isInputNode,
|
|
46
|
-
O as isStartNode,
|
|
47
|
-
d as isUINode,
|
|
48
|
-
Q as mergeFlows,
|
|
49
|
-
W as serializableToFile,
|
|
50
|
-
f as useTheme,
|
|
51
|
-
X as useTreegeConfig,
|
|
52
|
-
Y as useTreegeRenderer
|
|
53
|
-
};
|
|
1
|
+
import { t as e } from "./editor-HlDmu9kn.js";
|
|
2
|
+
import { A as t, B as n, I as r, L as i, R as a, S as o, a as s, b as c, c as l, d as u, f as d, g as f, h as p, i as m, k as h, l as g, m as _, n as v, o as y, p as b, s as x, t as S, u as C, x as w, z as T } from "./ThemeContext-DRLlkF0n.js";
|
|
3
|
+
import { C as E, E as D, S as O, T as k, _ as A, a as j, b as M, d as N, f as P, i as F, l as I, m as L, n as R, p as z, r as B, s as V, t as H, u as U, v as W, w as G, x as K, y as q } from "./DefaultInputs-tsNo-XJa.js";
|
|
4
|
+
export { D as DefaultAddressInput, k as DefaultAutocompleteInput, G as DefaultCheckboxInput, E as DefaultDateInput, O as DefaultDateRangeInput, K as DefaultFileInput, M as DefaultHiddenInput, q as DefaultHttpInput, W as DefaultNumberInput, A as DefaultPasswordInput, L as DefaultRadioInput, z as DefaultSelectInput, V as DefaultSwitchInput, j as DefaultTextAreaInput, F as DefaultTextInput, B as DefaultTimeInput, R as DefaultTimeRangeInput, U as Divider, S as ThemeProvider, N as Title, C as TreegeConfigProvider, e as TreegeEditor, I as TreegeRenderer, d as applyReferenceTransformation, b as calculateReferenceFieldUpdates, _ as checkFormFieldHasValue, p as convertFormValuesToNamedFormat, H as defaultInputRenderers, P as defaultUI, l as evaluateCondition, g as evaluateConditions, c as fileToSerializable, w as filesToSerializable, s as findStartNode, y as getFlowRenderState, r as getStaticTranslations, i as getTranslatedText, f as isFieldEmpty, a as isGroupNode, T as isInputNode, x as isStartNode, n as isUINode, h as sanitize, t as sanitizeHttpResponse, o as serializableToFile, v as useTheme, u as useTreegeConfig, m as useTreegeRenderer };
|
|
@@ -1,39 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TreegeRendererConfig } from '../types/renderer';
|
|
3
3
|
/**
|
|
4
4
|
* Hook to access the global Treege configuration
|
|
5
5
|
* Returns undefined if used outside of TreegeConfigProvider
|
|
6
6
|
*/
|
|
7
7
|
export declare const useTreegeConfig: () => TreegeRendererConfig | undefined;
|
|
8
|
-
export type TreegeConfigProviderProps = {
|
|
8
|
+
export type TreegeConfigProviderProps = TreegeRendererConfig & {
|
|
9
9
|
children: ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
* Custom component renderers (can be overridden per TreegeRenderer instance)
|
|
12
|
-
*/
|
|
13
|
-
components?: TreegeRendererComponents;
|
|
14
|
-
/**
|
|
15
|
-
* Google Maps API key for address autocomplete
|
|
16
|
-
* If not provided, falls back to free Nominatim (OpenStreetMap)
|
|
17
|
-
*/
|
|
18
|
-
googleApiKey?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Default language for translations
|
|
21
|
-
* @default "en"
|
|
22
|
-
*/
|
|
23
|
-
language?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Default theme for all renderers
|
|
26
|
-
* @default "dark"
|
|
27
|
-
*/
|
|
28
|
-
theme?: "dark" | "light";
|
|
29
|
-
/**
|
|
30
|
-
* Default validation mode
|
|
31
|
-
* @default "onSubmit"
|
|
32
|
-
*/
|
|
33
|
-
validationMode?: "onChange" | "onSubmit";
|
|
34
10
|
};
|
|
35
11
|
/**
|
|
36
12
|
* Provider for global Treege configuration
|
|
37
13
|
* Wrap your app with this provider to set default options for all TreegeRenderer instances
|
|
38
14
|
*/
|
|
39
|
-
export declare const TreegeConfigProvider: ({ children,
|
|
15
|
+
export declare const TreegeConfigProvider: ({ children, ...config }: TreegeConfigProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,25 +1,123 @@
|
|
|
1
|
+
import { Node } from '@xyflow/react';
|
|
1
2
|
import { PropsWithChildren } from 'react';
|
|
2
3
|
import { FormValues } from '../types/renderer';
|
|
3
|
-
import { Flow } from '../../shared/types/node';
|
|
4
|
+
import { Flow, HttpHeader, InputNodeData } from '../../shared/types/node';
|
|
4
5
|
export interface TreegeRendererContextValue {
|
|
6
|
+
/**
|
|
7
|
+
* The flow currently being rendered. `null` when the renderer has no flow
|
|
8
|
+
* to display yet.
|
|
9
|
+
*/
|
|
5
10
|
flows?: Flow | null;
|
|
11
|
+
/**
|
|
12
|
+
* Validation errors keyed by field id (`node.id`). Empty when the form
|
|
13
|
+
* is valid. Renderers read their own entry to display field-level errors.
|
|
14
|
+
*/
|
|
6
15
|
formErrors: Record<string, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Current form values keyed by field id (`node.id`). Read by inputs to
|
|
18
|
+
* resolve template variables (`{{fieldId}}` in URLs/headers/body) and to
|
|
19
|
+
* drive conditional visibility from `useRenderNode`.
|
|
20
|
+
*/
|
|
7
21
|
formValues: FormValues;
|
|
22
|
+
/**
|
|
23
|
+
* Google Maps Places API key for the address autocomplete input. When
|
|
24
|
+
* unset, the address input falls back to the free Nominatim provider.
|
|
25
|
+
*/
|
|
8
26
|
googleApiKey?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Global HTTP headers (already merged from provider + props) to apply
|
|
29
|
+
* to every request issued by inputs. Field-level headers override these
|
|
30
|
+
* on key collision (case-insensitive).
|
|
31
|
+
*/
|
|
32
|
+
headers?: HttpHeader[];
|
|
33
|
+
/**
|
|
34
|
+
* The flow's input nodes — exposed so renderers can resolve references
|
|
35
|
+
* between fields (e.g. `convertFormValuesToNamedFormat`, reference-field
|
|
36
|
+
* defaults).
|
|
37
|
+
*/
|
|
38
|
+
inputNodes: Node<InputNodeData>[];
|
|
39
|
+
/**
|
|
40
|
+
* Active UI language (e.g. `"en"`, `"fr"`). Used both for static UI
|
|
41
|
+
* strings (via `useTranslate`) and for resolving `Translatable` values
|
|
42
|
+
* inside node data.
|
|
43
|
+
*/
|
|
9
44
|
language: string;
|
|
45
|
+
/**
|
|
46
|
+
* Soft cap on the number of options rendered for option-based inputs
|
|
47
|
+
* (radio, checkbox). When set, options past this count are replaced by
|
|
48
|
+
* an ellipsis row. Used by the editor's `NodeInputPreview` to keep node
|
|
49
|
+
* cards compact when an OpenAPI source returns hundreds of options.
|
|
50
|
+
* Unset at runtime — every option is rendered.
|
|
51
|
+
*/
|
|
52
|
+
optionsDisplayLimit?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Update the value of a single field. Inputs call this from their
|
|
55
|
+
* `onChange` to push edits up to the form's state.
|
|
56
|
+
*/
|
|
10
57
|
setFieldValue: (fieldName: string, value: unknown) => void;
|
|
11
58
|
}
|
|
12
59
|
export interface TreegeRendererProviderProps extends PropsWithChildren {
|
|
13
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Any subset of `TreegeRendererContextValue`. Missing fields default to
|
|
62
|
+
* sensible no-op values, so callers only need to supply what they actually
|
|
63
|
+
* want to expose to descendants.
|
|
64
|
+
*/
|
|
65
|
+
value: Partial<TreegeRendererContextValue>;
|
|
14
66
|
}
|
|
15
67
|
export declare const TreegeRendererContext: import('react').Context<TreegeRendererContextValue | null>;
|
|
16
68
|
export declare const TreegeRendererProvider: ({ children, value }: TreegeRendererProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
69
|
export declare const useTreegeRendererContext: () => {
|
|
18
70
|
edges: import('@xyflow/react').Edge[];
|
|
71
|
+
/**
|
|
72
|
+
* The flow currently being rendered. `null` when the renderer has no flow
|
|
73
|
+
* to display yet.
|
|
74
|
+
*/
|
|
19
75
|
flows?: Flow | null;
|
|
76
|
+
/**
|
|
77
|
+
* Validation errors keyed by field id (`node.id`). Empty when the form
|
|
78
|
+
* is valid. Renderers read their own entry to display field-level errors.
|
|
79
|
+
*/
|
|
20
80
|
formErrors: Record<string, string>;
|
|
81
|
+
/**
|
|
82
|
+
* Current form values keyed by field id (`node.id`). Read by inputs to
|
|
83
|
+
* resolve template variables (`{{fieldId}}` in URLs/headers/body) and to
|
|
84
|
+
* drive conditional visibility from `useRenderNode`.
|
|
85
|
+
*/
|
|
21
86
|
formValues: FormValues;
|
|
87
|
+
/**
|
|
88
|
+
* Google Maps Places API key for the address autocomplete input. When
|
|
89
|
+
* unset, the address input falls back to the free Nominatim provider.
|
|
90
|
+
*/
|
|
22
91
|
googleApiKey?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Global HTTP headers (already merged from provider + props) to apply
|
|
94
|
+
* to every request issued by inputs. Field-level headers override these
|
|
95
|
+
* on key collision (case-insensitive).
|
|
96
|
+
*/
|
|
97
|
+
headers?: HttpHeader[];
|
|
98
|
+
/**
|
|
99
|
+
* The flow's input nodes — exposed so renderers can resolve references
|
|
100
|
+
* between fields (e.g. `convertFormValuesToNamedFormat`, reference-field
|
|
101
|
+
* defaults).
|
|
102
|
+
*/
|
|
103
|
+
inputNodes: Node<InputNodeData>[];
|
|
104
|
+
/**
|
|
105
|
+
* Active UI language (e.g. `"en"`, `"fr"`). Used both for static UI
|
|
106
|
+
* strings (via `useTranslate`) and for resolving `Translatable` values
|
|
107
|
+
* inside node data.
|
|
108
|
+
*/
|
|
23
109
|
language: string;
|
|
110
|
+
/**
|
|
111
|
+
* Soft cap on the number of options rendered for option-based inputs
|
|
112
|
+
* (radio, checkbox). When set, options past this count are replaced by
|
|
113
|
+
* an ellipsis row. Used by the editor's `NodeInputPreview` to keep node
|
|
114
|
+
* cards compact when an OpenAPI source returns hundreds of options.
|
|
115
|
+
* Unset at runtime — every option is rendered.
|
|
116
|
+
*/
|
|
117
|
+
optionsDisplayLimit?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Update the value of a single field. Inputs call this from their
|
|
120
|
+
* `onChange` to push edits up to the form's state.
|
|
121
|
+
*/
|
|
24
122
|
setFieldValue: (fieldName: string, value: unknown) => void;
|
|
25
123
|
};
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
import { ViewStyle } from 'react-native';
|
|
2
|
+
import { TreegeRendererProps } from '../../../types/renderer';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* The implementation should:
|
|
8
|
-
* - Import and use useTreegeRenderer hook (platform-agnostic)
|
|
9
|
-
* - Import and use utils from @/renderer/utils (platform-agnostic)
|
|
10
|
-
* - Use React Native UI components instead of web components
|
|
11
|
-
* - Share the same props interface (TreegeRendererProps)
|
|
4
|
+
* Props for the TreegeRenderer component (React Native)
|
|
5
|
+
* Same as TreegeRendererProps but:
|
|
6
|
+
* - Omits className (not used in React Native)
|
|
7
|
+
* - Adds style and contentContainerStyle (React Native specific)
|
|
12
8
|
*/
|
|
13
|
-
export {
|
|
9
|
+
export type TreegeRendererNativeProps = Omit<TreegeRendererProps, "className"> & {
|
|
10
|
+
/**
|
|
11
|
+
* Style for the ScrollView container
|
|
12
|
+
*/
|
|
13
|
+
style?: ViewStyle;
|
|
14
|
+
/**
|
|
15
|
+
* Style for the ScrollView content container
|
|
16
|
+
* Use this to center content vertically with flexGrow: 1 and justifyContent: 'center'
|
|
17
|
+
*/
|
|
18
|
+
contentContainerStyle?: ViewStyle;
|
|
19
|
+
};
|
|
20
|
+
declare const TreegeRenderer: (props: TreegeRendererNativeProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default TreegeRenderer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface DefaultFormWrapperProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
onSubmit?: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const DefaultFormWrapper: ({ children }: DefaultFormWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default DefaultFormWrapper;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Node } from '@xyflow/react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { InputNodeData } from '../../../../../shared/types/node';
|
|
4
|
+
interface DefaultInputWrapperProps {
|
|
5
|
+
node: Node<InputNodeData>;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const DefaultInputWrapper: ({ node, children }: DefaultInputWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default DefaultInputWrapper;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { default as DefaultAddressInput } from './inputs/DefaultAddressInput';
|
|
2
|
+
import { default as DefaultAutocompleteInput } from './inputs/DefaultAutocompleteInput';
|
|
3
|
+
import { default as DefaultCheckboxInput } from './inputs/DefaultCheckboxInput';
|
|
4
|
+
import { default as DefaultDateInput } from './inputs/DefaultDateInput';
|
|
5
|
+
import { default as DefaultDateRangeInput } from './inputs/DefaultDateRangeInput';
|
|
6
|
+
import { default as DefaultFileInput } from './inputs/DefaultFileInput';
|
|
7
|
+
import { default as DefaultHiddenInput } from './inputs/DefaultHiddenInput';
|
|
8
|
+
import { default as DefaultHttpInput } from './inputs/DefaultHttpInput';
|
|
9
|
+
import { default as DefaultNumberInput } from './inputs/DefaultNumberInput';
|
|
10
|
+
import { default as DefaultPasswordInput } from './inputs/DefaultPasswordInput';
|
|
11
|
+
import { default as DefaultRadioInput } from './inputs/DefaultRadioInput';
|
|
12
|
+
import { default as DefaultSelectInput } from './inputs/DefaultSelectInput';
|
|
13
|
+
import { default as DefaultSwitchInput } from './inputs/DefaultSwitchInput';
|
|
14
|
+
import { default as DefaultTextareaInput } from './inputs/DefaultTextareaInput';
|
|
15
|
+
import { default as DefaultTextInput } from './inputs/DefaultTextInput';
|
|
16
|
+
import { default as DefaultTimeInput } from './inputs/DefaultTimeInput';
|
|
17
|
+
import { default as DefaultTimeRangeInput } from './inputs/DefaultTimeRangeInput';
|
|
18
|
+
import { InputRenderers, InputRenderProps } from '../../../../types/renderer';
|
|
19
|
+
export { DefaultAddressInput, DefaultAutocompleteInput, DefaultCheckboxInput, DefaultDateInput, DefaultDateRangeInput, DefaultFileInput, DefaultHiddenInput, DefaultHttpInput, DefaultNumberInput, DefaultPasswordInput, DefaultRadioInput, DefaultSelectInput, DefaultSwitchInput, DefaultTextareaInput, DefaultTextInput, DefaultTimeInput, DefaultTimeRangeInput, };
|
|
20
|
+
export declare const DefaultSubmitInput: ({ node }: InputRenderProps<"submit">) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const defaultInputRenderers: InputRenderers;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface DefaultSubmitButtonProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
isSubmitting?: boolean;
|
|
6
|
+
onPress?: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const DefaultSubmitButton: ({ children, disabled, isSubmitting, onPress }: DefaultSubmitButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default DefaultSubmitButton;
|
package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButtonWrapper.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SubmitButtonWrapperProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
missingFields?: string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Default submit button wrapper for React Native
|
|
8
|
+
* Simple wrapper that renders children (no tooltip like web version)
|
|
9
|
+
*/
|
|
10
|
+
declare const DefaultSubmitButtonWrapper: ({ children }: SubmitButtonWrapperProps) => ReactNode;
|
|
11
|
+
export default DefaultSubmitButtonWrapper;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { UiRenderProps } from '../../../../types/renderer';
|
|
2
|
+
declare const DefaultTitleUI: ({ node }: UiRenderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const DefaultDividerUI: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { DefaultDividerUI, DefaultTitleUI };
|
|
5
|
+
export declare const defaultUI: {
|
|
6
|
+
divider: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
title: ({ node }: UiRenderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
};
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultAddressInput: ({ node, value, setValue, error, label, placeholder, helperText, id: _id, name: _name, }: InputRenderProps<"address">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default DefaultAddressInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultAutocompleteInput: ({ node, value, setValue, error, label, placeholder, helperText }: InputRenderProps<"autocomplete">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default DefaultAutocompleteInput;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultHttpInput: ({ node, value, setValue, error, label, placeholder, helperText, id: _id, name: _name, }: InputRenderProps<"http">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default DefaultHttpInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultNumberInput: ({ node, value, setValue, error, label, placeholder, helperText, name }: InputRenderProps<"number">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default DefaultNumberInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultPasswordInput: ({ node, value, setValue, error, label, placeholder, helperText, name }: InputRenderProps<"password">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default DefaultPasswordInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultSelectInput: ({ node, value, setValue, error, label, placeholder, helperText }: InputRenderProps<"select">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default DefaultSelectInput;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTextInput: ({ node, value, setValue, error, label, placeholder, helperText, name }: InputRenderProps<"text">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default DefaultTextInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTextareaInput: ({ node, value, setValue, error, label, placeholder, helperText, name }: InputRenderProps<"textarea">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default DefaultTextareaInput;
|