treege 3.0.0-beta.47 → 3.0.0-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DefaultInputs-CLKy3v8A.js +1761 -0
- package/dist/ThemeContext-Ct1JesKT.js +1353 -0
- package/dist/editor/constants/edgeTypes.d.ts +2 -2
- package/dist/editor/constants/nodeTypes.d.ts +0 -1
- package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/inputs/SelectNodeGroup.d.ts +16 -1
- package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +3 -1
- package/dist/editor/features/TreegeEditor/nodes/components/NodeGroupBadge.d.ts +2 -1
- package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +6 -1
- package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +2 -1
- package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +3 -1
- package/dist/editor/features/TreegeEditor/panel/MultiSelectionPanel.d.ts +7 -0
- package/dist/editor/hooks/useAvailableParentFields.d.ts +13 -0
- package/dist/editor/hooks/useFlowActions.d.ts +1 -0
- package/dist/editor/hooks/useIsStackedEdge.d.ts +8 -0
- package/dist/editor/hooks/useStackPosition.d.ts +2 -0
- package/dist/editor/utils/dagreLayout.d.ts +0 -12
- package/dist/editor/utils/stackPositionIndex.d.ts +9 -0
- package/dist/editor-DwBsZEzm.js +5495 -0
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -4
- package/dist/renderer/context/TreegeRendererContext.d.ts +2 -4
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +3 -4
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
- package/dist/renderer/types/renderer.d.ts +23 -5
- package/dist/renderer/utils/flow.d.ts +1 -18
- package/dist/renderer/utils/step.d.ts +1 -1
- package/dist/renderer-native.js +950 -950
- package/dist/renderer.js +3 -3
- package/dist/shared/constants/node.d.ts +0 -1
- package/dist/shared/locales/ar.json.d.ts +10 -8
- package/dist/shared/locales/de.json.d.ts +10 -8
- package/dist/shared/locales/en.json.d.ts +10 -8
- package/dist/shared/locales/es.json.d.ts +10 -8
- package/dist/shared/locales/fr.json.d.ts +10 -8
- package/dist/shared/locales/it.json.d.ts +10 -8
- package/dist/shared/locales/pt.json.d.ts +10 -8
- package/dist/shared/types/node.d.ts +1 -7
- package/dist/shared/utils/inputTypeGuards.d.ts +7 -0
- package/dist/shared/utils/nodeTypeGuards.d.ts +1 -6
- package/package.json +1 -1
- package/dist/DefaultInputs-UkiUaJcf.js +0 -1734
- package/dist/ThemeContext-CNsS53ku.js +0 -1454
- package/dist/editor/features/TreegeEditor/forms/FlowNodeForm.d.ts +0 -2
- package/dist/editor/features/TreegeEditor/nodes/components/NodeOptions.d.ts +0 -12
- package/dist/editor/hooks/useEdgesSelection.d.ts +0 -11
- package/dist/editor-DrGQB__b.js +0 -5313
package/dist/editor.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "./editor-
|
|
2
|
-
import { n as t, t as n } from "./ThemeContext-
|
|
1
|
+
import { t as e } from "./editor-DwBsZEzm.js";
|
|
2
|
+
import { n as t, t as n } from "./ThemeContext-Ct1JesKT.js";
|
|
3
3
|
export { n as ThemeProvider, e as TreegeEditor, t as useTheme };
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./editor-
|
|
2
|
-
import {
|
|
3
|
-
import { C as
|
|
4
|
-
export {
|
|
1
|
+
import { t as e } from "./editor-DwBsZEzm.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-Ct1JesKT.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-CLKy3v8A.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 };
|
|
@@ -4,8 +4,7 @@ import { FormValues } from '../types/renderer';
|
|
|
4
4
|
import { Flow, HttpHeader, InputNodeData } from '../../shared/types/node';
|
|
5
5
|
export interface TreegeRendererContextValue {
|
|
6
6
|
/**
|
|
7
|
-
* The flow currently being rendered
|
|
8
|
-
* are linked through `FlowNode`s). `null` when the renderer has no flow
|
|
7
|
+
* The flow currently being rendered. `null` when the renderer has no flow
|
|
9
8
|
* to display yet.
|
|
10
9
|
*/
|
|
11
10
|
flows?: Flow | null;
|
|
@@ -70,8 +69,7 @@ export declare const TreegeRendererProvider: ({ children, value }: TreegeRendere
|
|
|
70
69
|
export declare const useTreegeRendererContext: () => {
|
|
71
70
|
edges: import('@xyflow/react').Edge[];
|
|
72
71
|
/**
|
|
73
|
-
* The flow currently being rendered
|
|
74
|
-
* are linked through `FlowNode`s). `null` when the renderer has no flow
|
|
72
|
+
* The flow currently being rendered. `null` when the renderer has no flow
|
|
75
73
|
* to display yet.
|
|
76
74
|
*/
|
|
77
75
|
flows?: Flow | null;
|
|
@@ -31,19 +31,19 @@ export declare const useTreegeRenderer: ({ components, flows, googleApiKey, head
|
|
|
31
31
|
}) => import('react').ReactNode) | undefined;
|
|
32
32
|
inputs: {
|
|
33
33
|
number?: ((props: import('../../types/renderer').InputRenderProps<"number">) => import('react').ReactNode) | undefined;
|
|
34
|
+
checkbox?: ((props: import('../../types/renderer').InputRenderProps<"checkbox">) => import('react').ReactNode) | undefined;
|
|
35
|
+
radio?: ((props: import('../../types/renderer').InputRenderProps<"radio">) => import('react').ReactNode) | undefined;
|
|
36
|
+
switch?: ((props: import('../../types/renderer').InputRenderProps<"switch">) => import('react').ReactNode) | undefined;
|
|
34
37
|
address?: ((props: import('../../types/renderer').InputRenderProps<"address">) => import('react').ReactNode) | undefined;
|
|
35
38
|
autocomplete?: ((props: import('../../types/renderer').InputRenderProps<"autocomplete">) => import('react').ReactNode) | undefined;
|
|
36
|
-
checkbox?: ((props: import('../../types/renderer').InputRenderProps<"checkbox">) => import('react').ReactNode) | undefined;
|
|
37
39
|
date?: ((props: import('../../types/renderer').InputRenderProps<"date">) => import('react').ReactNode) | undefined;
|
|
38
40
|
daterange?: ((props: import('../../types/renderer').InputRenderProps<"daterange">) => import('react').ReactNode) | undefined;
|
|
39
41
|
file?: ((props: import('../../types/renderer').InputRenderProps<"file">) => import('react').ReactNode) | undefined;
|
|
40
42
|
hidden?: ((props: import('../../types/renderer').InputRenderProps<"hidden">) => import('react').ReactNode) | undefined;
|
|
41
43
|
http?: ((props: import('../../types/renderer').InputRenderProps<"http">) => import('react').ReactNode) | undefined;
|
|
42
44
|
password?: ((props: import('../../types/renderer').InputRenderProps<"password">) => import('react').ReactNode) | undefined;
|
|
43
|
-
radio?: ((props: import('../../types/renderer').InputRenderProps<"radio">) => import('react').ReactNode) | undefined;
|
|
44
45
|
select?: ((props: import('../../types/renderer').InputRenderProps<"select">) => import('react').ReactNode) | undefined;
|
|
45
46
|
submit?: ((props: import('../../types/renderer').InputRenderProps<"submit">) => import('react').ReactNode) | undefined;
|
|
46
|
-
switch?: ((props: import('../../types/renderer').InputRenderProps<"switch">) => import('react').ReactNode) | undefined;
|
|
47
47
|
text?: ((props: import('../../types/renderer').InputRenderProps<"text">) => import('react').ReactNode) | undefined;
|
|
48
48
|
textarea?: ((props: import('../../types/renderer').InputRenderProps<"textarea">) => import('react').ReactNode) | undefined;
|
|
49
49
|
time?: ((props: import('../../types/renderer').InputRenderProps<"time">) => import('react').ReactNode) | undefined;
|
|
@@ -90,7 +90,6 @@ export declare const useTreegeRenderer: ({ components, flows, googleApiKey, head
|
|
|
90
90
|
isFirstStep: boolean;
|
|
91
91
|
isLastStep: boolean;
|
|
92
92
|
isSubmitting: boolean;
|
|
93
|
-
mergedFlow: import('../../../shared/types/node').Flow;
|
|
94
93
|
missingRequiredFields: string[];
|
|
95
94
|
prevFormValuesRef: import('react').RefObject<FormValues>;
|
|
96
95
|
setFieldErrors: import('react').Dispatch<import('react').SetStateAction<Record<string, string>>>;
|
package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
-
declare const DefaultCheckboxInput: ({ node, value, setValue, error, label, helperText, id, name }: InputRenderProps<"checkbox">) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const DefaultCheckboxInput: ({ node, value, setValue, error, label, helperText, id, name, renderOptionExtras, compactOptions, }: InputRenderProps<"checkbox">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultCheckboxInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InputRenderProps } from '../../../../../types/renderer';
|
|
2
|
-
declare const DefaultRadioInput: ({ node, value, setValue, error, label, helperText, id, name }: InputRenderProps<"radio">) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const DefaultRadioInput: ({ node, value, setValue, error, label, helperText, id, name, renderOptionExtras, compactOptions, }: InputRenderProps<"radio">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultRadioInput;
|
|
@@ -2,7 +2,7 @@ import { Node } from '@xyflow/react';
|
|
|
2
2
|
import { FormEvent, ReactNode } from 'react';
|
|
3
3
|
import { SerializableFile } from '../utils/file';
|
|
4
4
|
import { FlowStep } from '../utils/step';
|
|
5
|
-
import { Flow, GroupNodeData, HttpHeader, InputNodeData, InputType, TreegeNodeData, UINodeData, UIType } from '../../shared/types/node';
|
|
5
|
+
import { Flow, GroupNodeData, HttpHeader, InputNodeData, InputOption, InputType, TreegeNodeData, UINodeData, UIType } from '../../shared/types/node';
|
|
6
6
|
/**
|
|
7
7
|
* Type mapping for input values based on input type
|
|
8
8
|
*/
|
|
@@ -88,6 +88,26 @@ export type InputRenderProps<T extends InputType = InputType> = {
|
|
|
88
88
|
* Whether the form is currently being submitted (for submit inputs)
|
|
89
89
|
*/
|
|
90
90
|
isSubmitting?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Editor-only extension slot: when provided, option-based renderers (radio,
|
|
93
|
+
* checkbox) call this for each option to paint inline extras next to it
|
|
94
|
+
* (e.g. value preview, edit / delete buttons). `variant` is a renderer-side
|
|
95
|
+
* layout hint (e.g. `"card"` for radio cards). Returning `null` skips the
|
|
96
|
+
* slot for that option. Left undefined in runtime so the renderers stay
|
|
97
|
+
* runtime-pure.
|
|
98
|
+
*/
|
|
99
|
+
renderOptionExtras?: (option: {
|
|
100
|
+
option: InputOption;
|
|
101
|
+
index: number;
|
|
102
|
+
variant?: string;
|
|
103
|
+
}) => ReactNode;
|
|
104
|
+
/**
|
|
105
|
+
* Editor-only layout flag. When `true`, option-based renderers force their
|
|
106
|
+
* option labels to a single truncated line (block + max-w-full + truncate)
|
|
107
|
+
* and reserve room on the right for the `renderOptionExtras` overlay.
|
|
108
|
+
* Defaults to `false` (multi-line, runtime-pure).
|
|
109
|
+
*/
|
|
110
|
+
compactOptions?: boolean;
|
|
91
111
|
};
|
|
92
112
|
export type UiRenderProps = {
|
|
93
113
|
node: Node<UINodeData>;
|
|
@@ -241,11 +261,9 @@ export interface TreegeRendererProps extends TreegeRendererConfig {
|
|
|
241
261
|
*/
|
|
242
262
|
className?: string;
|
|
243
263
|
/**
|
|
244
|
-
* Flow
|
|
245
|
-
* - If a single Flow: renders that flow
|
|
246
|
-
* - If an array: first flow is the main flow, others are sub-flows available for FlowNodes
|
|
264
|
+
* Flow to render. `null` / `undefined` renders nothing.
|
|
247
265
|
*/
|
|
248
|
-
flows?: Flow |
|
|
266
|
+
flows?: Flow | null;
|
|
249
267
|
/**
|
|
250
268
|
* Initial form values
|
|
251
269
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Edge, Node } from '@xyflow/react';
|
|
2
2
|
import { FormValues } from '../types/renderer';
|
|
3
3
|
import { ConditionalEdgeData } from '../../shared/types/edge';
|
|
4
|
-
import {
|
|
4
|
+
import { TreegeNodeData } from '../../shared/types/node';
|
|
5
5
|
/**
|
|
6
6
|
* Result from computing the flow render state
|
|
7
7
|
* Contains everything needed to render the form and determine its state
|
|
@@ -72,20 +72,3 @@ export declare const findStartNode: (nodes: Node<TreegeNodeData>[], edges: Edge[
|
|
|
72
72
|
* @returns Complete flow render state (visible nodes, end-of-path flag, etc.)
|
|
73
73
|
*/
|
|
74
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;
|
|
@@ -22,6 +22,6 @@ export type FlowStep = {
|
|
|
22
22
|
* time the `parentId` of the next renderable node changes (i.e. the flow
|
|
23
23
|
* crosses a group boundary, or moves between an orphan and a grouped node).
|
|
24
24
|
*
|
|
25
|
-
* Group
|
|
25
|
+
* Group nodes themselves are skipped — they're metadata only.
|
|
26
26
|
*/
|
|
27
27
|
export declare const computeSteps: (visibleNodes: Node<TreegeNodeData>[]) => FlowStep[];
|