treege 3.0.0-beta.16 → 3.0.0-beta.18
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/ThemeContext-zQO8nZ9d.js +745 -0
- package/dist/TreegeEditor-DXhj6fWi.js +3300 -0
- package/dist/TreegeRenderer-CjLeK7_j.js +1740 -0
- package/dist/editor/components/input/ComboboxWithCreate.d.ts +2 -1
- package/dist/editor/constants/edgeTypes.d.ts +2 -1
- package/dist/editor/constants/nodeTypes.d.ts +4 -4
- 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/SubmitConfigForm.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +2 -1
- package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +2 -1
- package/dist/editor/hooks/useFlowActions.d.ts +1 -0
- package/dist/editor.js +2 -2
- package/dist/main.js +34 -32
- package/dist/renderer/context/TreegeRendererContext.d.ts +4 -1
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +2 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +3 -0
- package/dist/renderer/hooks/useSubmitHandler.d.ts +34 -0
- package/dist/renderer/types/renderer.d.ts +16 -2
- package/dist/renderer/utils/form.d.ts +19 -0
- package/dist/renderer/utils/http.d.ts +101 -0
- package/dist/renderer/utils/submit.d.ts +47 -0
- package/dist/renderer.js +30 -28
- package/dist/shared/components/ui/alert-dialog.d.ts +14 -0
- package/dist/shared/components/ui/badge.d.ts +1 -1
- package/dist/shared/components/ui/popover.d.ts +3 -1
- package/dist/shared/components/ui/select.d.ts +3 -1
- package/dist/shared/constants/inputType.d.ts +1 -0
- package/dist/shared/locales/ar.json.d.ts +48 -3
- package/dist/shared/locales/de.json.d.ts +48 -3
- package/dist/shared/locales/en.json.d.ts +49 -4
- package/dist/shared/locales/es.json.d.ts +48 -3
- package/dist/shared/locales/fr.json.d.ts +48 -3
- package/dist/shared/locales/it.json.d.ts +48 -3
- package/dist/shared/locales/pt.json.d.ts +48 -3
- package/dist/shared/types/node.d.ts +47 -0
- package/package.json +4 -3
- package/dist/ThemeContext-XefwjIme.js +0 -760
- package/dist/TreegeEditor-DOj2aQTI.js +0 -2735
- package/dist/TreegeRenderer-BKVKtiO4.js +0 -1441
|
@@ -4,6 +4,7 @@ declare const _default: {
|
|
|
4
4
|
"clear": "Limpar",
|
|
5
5
|
"close": "Fechar",
|
|
6
6
|
"create": "Criar",
|
|
7
|
+
"delete": "Excluir",
|
|
7
8
|
"retry": "Tentar novamente",
|
|
8
9
|
"save": "Salvar",
|
|
9
10
|
"submit": "Enviar",
|
|
@@ -114,8 +115,8 @@ declare const _default: {
|
|
|
114
115
|
"methodPut": "PUT",
|
|
115
116
|
"noFieldsAvailable": "Nenhum campo disponível",
|
|
116
117
|
"requestBody": "Corpo da requisição (JSON)",
|
|
117
|
-
"requestBodyDesc": "Use
|
|
118
|
-
"requestBodyPlaceholder": "{\"
|
|
118
|
+
"requestBodyDesc": "Use {{fieldId}} para referenciar outros campos. Certifique-se de que a formatação JSON está correta, incluindo aspas ao redor de valores de string.",
|
|
119
|
+
"requestBodyPlaceholder": "{\"nome\": \"{{nomeUsuario}}\", \"idade\": {{idadeUsuario}}}",
|
|
119
120
|
"responseConfiguration": "Configuração da resposta",
|
|
120
121
|
"responsePath": "Caminho da resposta",
|
|
121
122
|
"responsePathDesc": "Extrair dados da resposta usando notação de ponto ou indexação de array",
|
|
@@ -124,6 +125,8 @@ declare const _default: {
|
|
|
124
125
|
"searchParameterDesc": "Se definido, habilita uma caixa de pesquisa que adiciona este parâmetro às chamadas de API (ex: ?q=Paris)",
|
|
125
126
|
"searchParameterPlaceholder": "q, pesquisa, consulta...",
|
|
126
127
|
"selectMethod": "Selecionar método",
|
|
128
|
+
"sendFormData": "Enviar todos os dados do formulário",
|
|
129
|
+
"sendFormDataDesc": "Enviar automaticamente todos os valores do formulário como corpo JSON",
|
|
127
130
|
"showLoadingState": "Mostrar estado de carregamento",
|
|
128
131
|
"valueField": "Campo de valor",
|
|
129
132
|
"valueFieldDesc": "Campo a ser usado como valor da opção (ex: id)",
|
|
@@ -165,6 +168,7 @@ declare const _default: {
|
|
|
165
168
|
"sourceKey": "Chave de origem",
|
|
166
169
|
"staticValue": "Valor estático",
|
|
167
170
|
"staticValuePlaceholder": "Digite o valor padrão",
|
|
171
|
+
"submitConfiguration": "Configuração de envio",
|
|
168
172
|
"targetKey": "Chave de destino",
|
|
169
173
|
"transformArray": "Converter para array",
|
|
170
174
|
"transformBoolean": "Converter para booleano",
|
|
@@ -176,6 +180,12 @@ declare const _default: {
|
|
|
176
180
|
"transformType": "Tipo de transformação",
|
|
177
181
|
"validation": "Validação"
|
|
178
182
|
},
|
|
183
|
+
"nodeActionsSheet": {
|
|
184
|
+
"deleteNode": "Excluir nó",
|
|
185
|
+
"deleteNodeConfirm": "Tem certeza de que deseja excluir este nó?",
|
|
186
|
+
"deleteNodeSuccess": "Nó excluído com sucesso",
|
|
187
|
+
"editNode": "Editar nó"
|
|
188
|
+
},
|
|
179
189
|
"selectInputType": {
|
|
180
190
|
"type": "Tipo"
|
|
181
191
|
},
|
|
@@ -195,6 +205,40 @@ declare const _default: {
|
|
|
195
205
|
"selectNodeType": {
|
|
196
206
|
"nodeType": "Tipo de nó"
|
|
197
207
|
},
|
|
208
|
+
"submitConfigForm": {
|
|
209
|
+
"addHeader": "Adicionar cabeçalho",
|
|
210
|
+
"apiUrl": "URL da API",
|
|
211
|
+
"apiUrlDesc": "Use {{fieldId}} para referenciar outros campos",
|
|
212
|
+
"apiUrlPlaceholder": "https://api.exemplo.com/submit",
|
|
213
|
+
"behavior": "Comportamento",
|
|
214
|
+
"errorMessage": "Mensagem de erro",
|
|
215
|
+
"errorMessageDesc": "Mensagem exibida quando o envio falha",
|
|
216
|
+
"errorMessagePlaceholder": "Ocorreu um erro. Por favor, tente novamente.",
|
|
217
|
+
"headerName": "Nome do cabeçalho",
|
|
218
|
+
"headers": "Cabeçalhos",
|
|
219
|
+
"headerValue": "Valor do cabeçalho",
|
|
220
|
+
"httpMethod": "Método HTTP",
|
|
221
|
+
"insertVariable": "Inserir variável",
|
|
222
|
+
"methodDelete": "DELETE",
|
|
223
|
+
"methodPatch": "PATCH",
|
|
224
|
+
"methodPost": "POST",
|
|
225
|
+
"methodPut": "PUT",
|
|
226
|
+
"noFieldsAvailable": "Nenhum campo disponível",
|
|
227
|
+
"postSubmission": "Após o envio",
|
|
228
|
+
"redirectUrl": "URL de redirecionamento",
|
|
229
|
+
"redirectUrlDesc": "URL para redirecionar após envio bem-sucedido",
|
|
230
|
+
"redirectUrlPlaceholder": "/success ou https://exemplo.com/obrigado",
|
|
231
|
+
"requestBody": "Corpo da requisição (JSON)",
|
|
232
|
+
"requestBodyDesc": "Use {{fieldId}} para referenciar outros campos. Certifique-se de que a formatação JSON está correta, incluindo aspas ao redor de valores de string.",
|
|
233
|
+
"requestBodyPlaceholder": "{\"nome\": \"{{nomeUsuario}}\", \"email\": \"{{emailUsuario}}\"}",
|
|
234
|
+
"selectMethod": "Selecionar método",
|
|
235
|
+
"sendFormData": "Enviar todos os dados do formulário",
|
|
236
|
+
"sendFormDataDesc": "Enviar automaticamente todos os valores do formulário como corpo JSON",
|
|
237
|
+
"showLoadingState": "Mostrar estado de carregamento",
|
|
238
|
+
"successMessage": "Mensagem de sucesso",
|
|
239
|
+
"successMessageDesc": "Mensagem exibida quando o envio é bem-sucedido",
|
|
240
|
+
"successMessagePlaceholder": "Formulário enviado com sucesso!"
|
|
241
|
+
},
|
|
198
242
|
"uiNodeForm": {
|
|
199
243
|
"label": "Rótulo",
|
|
200
244
|
"type": "Tipo",
|
|
@@ -221,7 +265,8 @@ declare const _default: {
|
|
|
221
265
|
"retry": "Tentar novamente",
|
|
222
266
|
"search": "Pesquisar...",
|
|
223
267
|
"searching": "Pesquisando...",
|
|
224
|
-
"selectOption": "Selecione uma opção"
|
|
268
|
+
"selectOption": "Selecione uma opção",
|
|
269
|
+
"waitingForRequiredFields": "Aguardando campos obrigatórios"
|
|
225
270
|
},
|
|
226
271
|
"defaultInputs": {
|
|
227
272
|
"endDate": "Data de fim",
|
|
@@ -68,6 +68,10 @@ export type HttpConfig = {
|
|
|
68
68
|
* Request body (for POST/PUT/PATCH methods)
|
|
69
69
|
*/
|
|
70
70
|
body?: string;
|
|
71
|
+
/**
|
|
72
|
+
* If true, automatically sends all form data as JSON body (overrides custom body)
|
|
73
|
+
*/
|
|
74
|
+
sendFormData?: boolean;
|
|
71
75
|
/**
|
|
72
76
|
* JSONPath or key to extract from the response
|
|
73
77
|
* Examples: "data.users", "results[0].name"
|
|
@@ -100,6 +104,45 @@ export type HttpConfig = {
|
|
|
100
104
|
*/
|
|
101
105
|
showLoading?: boolean;
|
|
102
106
|
};
|
|
107
|
+
export type SubmitConfig = {
|
|
108
|
+
/**
|
|
109
|
+
* The HTTP method to use for form submission
|
|
110
|
+
*/
|
|
111
|
+
method?: "POST" | "PUT" | "PATCH" | "DELETE";
|
|
112
|
+
/**
|
|
113
|
+
* The API URL to call on submit (supports template variables like {{fieldId}})
|
|
114
|
+
*/
|
|
115
|
+
url?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Custom headers for the HTTP request
|
|
118
|
+
*/
|
|
119
|
+
headers?: HttpHeader[];
|
|
120
|
+
/**
|
|
121
|
+
* Request body (for POST/PUT/PATCH methods, supports template variables like {{fieldId}})
|
|
122
|
+
* Strings are automatically quoted, use: {"name": {{userName}}}
|
|
123
|
+
*/
|
|
124
|
+
body?: string;
|
|
125
|
+
/**
|
|
126
|
+
* If true, automatically sends all form data as JSON body (overrides custom body)
|
|
127
|
+
*/
|
|
128
|
+
sendFormData?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* URL to redirect to after successful submission (supports template variables from response)
|
|
131
|
+
*/
|
|
132
|
+
redirectUrl?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Success message to display after successful submission (translatable)
|
|
135
|
+
*/
|
|
136
|
+
successMessage?: Translatable;
|
|
137
|
+
/**
|
|
138
|
+
* Error message to display if submission fails (translatable)
|
|
139
|
+
*/
|
|
140
|
+
errorMessage?: Translatable;
|
|
141
|
+
/**
|
|
142
|
+
* Whether to show a loading state while submitting
|
|
143
|
+
*/
|
|
144
|
+
showLoading?: boolean;
|
|
145
|
+
};
|
|
103
146
|
export type InputNodeData = BaseNodeData & {
|
|
104
147
|
/**
|
|
105
148
|
* The name of the input field, used for identification and form submission
|
|
@@ -154,6 +197,10 @@ export type InputNodeData = BaseNodeData & {
|
|
|
154
197
|
* HTTP configuration for the input field (used with type="http")
|
|
155
198
|
*/
|
|
156
199
|
httpConfig?: HttpConfig;
|
|
200
|
+
/**
|
|
201
|
+
* Submit configuration for the input field (used with type="submit")
|
|
202
|
+
*/
|
|
203
|
+
submitConfig?: SubmitConfig;
|
|
157
204
|
};
|
|
158
205
|
export type UINodeData = BaseNodeData & {
|
|
159
206
|
/**
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "treege",
|
|
3
3
|
"description": "Powerful form generator",
|
|
4
4
|
"license": "ISC",
|
|
5
|
-
"version": "3.0.0-beta.
|
|
5
|
+
"version": "3.0.0-beta.18",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./dist/main.d.ts",
|
|
8
8
|
"module": "./dist/main.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"test:watch": "vitest"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
47
48
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
48
49
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
49
50
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
55
56
|
"@radix-ui/react-select": "^2.2.6",
|
|
56
57
|
"@radix-ui/react-separator": "^1.1.7",
|
|
57
|
-
"@radix-ui/react-slot": "^1.2.
|
|
58
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
58
59
|
"@radix-ui/react-switch": "^1.2.6",
|
|
59
60
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
60
61
|
"@tanstack/react-form": "^1.23.5",
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
"@testing-library/jest-dom": "^6.9.1",
|
|
80
81
|
"@testing-library/react": "^16.3.0",
|
|
81
82
|
"@testing-library/react-hooks": "^8.0.1",
|
|
82
|
-
"@tracktor/biome-config-react": "^1.
|
|
83
|
+
"@tracktor/biome-config-react": "^1.4.0",
|
|
83
84
|
"@types/google.maps": "^3.58.1",
|
|
84
85
|
"@types/node": "^24.5.2",
|
|
85
86
|
"@types/react": "^19.1.0",
|