treege 3.0.0-beta.43 → 3.0.0-beta.45
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 +16 -9
- package/dist/DefaultInputs-DYKtphqY.js +1701 -0
- package/dist/ThemeContext-O482h1XZ.js +1397 -0
- package/dist/editor/components/styles/EditorStyles.d.ts +2 -0
- package/dist/editor/context/OpenApiContext.d.ts +79 -0
- package/dist/editor/context/TreegeEditorContext.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +20 -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/forms/OptionsSourceForm.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +30 -0
- package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +0 -1
- 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/NodeOptions.d.ts +12 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeRequiredButton.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +5 -2
- package/dist/editor/types/editor.d.ts +39 -1
- package/dist/editor/types/openapi.d.ts +81 -0
- package/dist/editor/utils/openapi.d.ts +35 -0
- package/dist/editor-DBCMmZtt.js +5147 -0
- package/dist/editor.js +2 -3
- package/dist/main.js +4 -5
- package/dist/renderer/context/TreegeConfigContext.d.ts +3 -27
- package/dist/renderer/context/TreegeRendererContext.d.ts +99 -2
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputWrapper.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +3 -2
- 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/styles/RendererStyles.d.ts +2 -0
- package/dist/renderer/hooks/useInputOptions.d.ts +28 -0
- package/dist/renderer/hooks/useRenderNode.d.ts +7 -3
- package/dist/renderer/hooks/useSubmitHandler.d.ts +3 -2
- package/dist/renderer/types/renderer.d.ts +13 -25
- package/dist/renderer/utils/http.d.ts +29 -1
- package/dist/renderer/utils/submit.d.ts +3 -2
- package/dist/renderer-native.js +794 -782
- package/dist/renderer.js +3 -4
- package/dist/shared/components/ui/button.d.ts +1 -1
- package/dist/shared/components/ui/field.d.ts +24 -0
- package/dist/shared/components/ui/toggle-group.d.ts +7 -0
- package/dist/shared/components/ui/toggle.d.ts +9 -0
- package/dist/shared/locales/ar.json.d.ts +80 -0
- package/dist/shared/locales/de.json.d.ts +80 -0
- package/dist/shared/locales/en.json.d.ts +80 -0
- package/dist/shared/locales/es.json.d.ts +80 -0
- package/dist/shared/locales/fr.json.d.ts +80 -0
- package/dist/shared/locales/it.json.d.ts +80 -0
- package/dist/shared/locales/pt.json.d.ts +80 -0
- package/dist/shared/types/node.d.ts +44 -0
- package/package.json +3 -2
- package/dist/DefaultInputs-Cr6wTVNE.js +0 -1558
- package/dist/ThemeContext-CUHjGVUf.js +0 -1602
- package/dist/editor/features/TreegeEditor/nodes/components/OptionsEditor.d.ts +0 -7
- package/dist/editor/features/TreegeEditor/nodes/components/RequiredBadge.d.ts +0 -6
- package/dist/editor-CE8g1o72.js +0 -4037
- /package/dist/editor/components/{data-display/logo.d.ts → branding/Logo.d.ts} +0 -0
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
"editor": {
|
|
16
16
|
"actionsPanel": {
|
|
17
17
|
"addNode": "Adicionar elemento",
|
|
18
|
+
"authorize": "Authorize",
|
|
18
19
|
"clear": "Limpar",
|
|
19
20
|
"clearSuccess": "Fluxo limpo!",
|
|
20
21
|
"clearSuccessDesc": "Todos os nós e arestas foram removidos.",
|
|
@@ -22,12 +23,14 @@ declare const _default: {
|
|
|
22
23
|
"downloadSuccess": "Download bem-sucedido.",
|
|
23
24
|
"downloadSuccessDesc": "O fluxo foi exportado com sucesso.",
|
|
24
25
|
"exportJson": "Exportar JSON",
|
|
26
|
+
"globalHeaders": "Global headers",
|
|
25
27
|
"idCopied": "ID do fluxo copiado!",
|
|
26
28
|
"importJson": "Importar JSON",
|
|
27
29
|
"importSuccess": "Importação bem-sucedida!",
|
|
28
30
|
"importSuccessDesc": "O fluxo foi importado com sucesso.",
|
|
29
31
|
"invalidJson": "Arquivo JSON inválido.",
|
|
30
32
|
"invalidJsonDesc": "O arquivo deve conter arrays de nós e arestas.",
|
|
33
|
+
"openApi": "OpenAPI",
|
|
31
34
|
"parseError": "Erro ao analisar o arquivo JSON.",
|
|
32
35
|
"parseErrorDesc": "Tente corrigir o arquivo e importá-lo novamente."
|
|
33
36
|
},
|
|
@@ -51,6 +54,24 @@ declare const _default: {
|
|
|
51
54
|
"titleDescription": "Descreva o formulário ou árvore de decisão que deseja criar, e a IA irá gerá-lo para você.",
|
|
52
55
|
"unknownError": "Erro desconhecido"
|
|
53
56
|
},
|
|
57
|
+
"apiUrlCombobox": {
|
|
58
|
+
"browseRoutes": "Browse OpenAPI routes",
|
|
59
|
+
"noRoutes": "No matching route",
|
|
60
|
+
"searchRoutes": "Search by method, path, or summary"
|
|
61
|
+
},
|
|
62
|
+
"authorizeDialog": {
|
|
63
|
+
"apiKeyLabel": "API key",
|
|
64
|
+
"apply": "Apply",
|
|
65
|
+
"bearerLabel": "Bearer token",
|
|
66
|
+
"clear": "Clear",
|
|
67
|
+
"description": "Authenticate against the API to forward credentials to every request issued by the form.",
|
|
68
|
+
"exchangeFailed": "Failed to fetch access token",
|
|
69
|
+
"noSchemes": "No supported security schemes are declared in this OpenAPI document.",
|
|
70
|
+
"oauth2PasswordLabel": "OAuth2 password",
|
|
71
|
+
"passwordPlaceholder": "Password",
|
|
72
|
+
"title": "Authorize",
|
|
73
|
+
"usernamePlaceholder": "Username"
|
|
74
|
+
},
|
|
54
75
|
"changeNodeTypeDialog": {
|
|
55
76
|
"description": "Este nó possui várias ramificações de saída. O novo tipo suporta apenas uma. Escolha qual ramificação manter; as outras serão removidas.",
|
|
56
77
|
"keepBranch": "Manter esta ramificação",
|
|
@@ -101,6 +122,15 @@ declare const _default: {
|
|
|
101
122
|
"groupNodeForm": {
|
|
102
123
|
"label": "Rótulo"
|
|
103
124
|
},
|
|
125
|
+
"headersDialog": {
|
|
126
|
+
"addHeader": "Add header",
|
|
127
|
+
"description": "These headers are forwarded to every HTTP request issued by the form (HTTP inputs, submit, options sources). Field-level headers with the same key override these.",
|
|
128
|
+
"empty": "No headers yet.",
|
|
129
|
+
"keyPlaceholder": "Authorization",
|
|
130
|
+
"removeHeader": "Remove header",
|
|
131
|
+
"title": "Global headers",
|
|
132
|
+
"valuePlaceholder": "Bearer ..."
|
|
133
|
+
},
|
|
104
134
|
"httpConfigForm": {
|
|
105
135
|
"addHeader": "Adicionar cabeçalho",
|
|
106
136
|
"apiUrl": "URL da API",
|
|
@@ -153,7 +183,9 @@ declare const _default: {
|
|
|
153
183
|
"defaultValueTypeNone": "Nenhum",
|
|
154
184
|
"defaultValueTypeReference": "Campo de referência",
|
|
155
185
|
"defaultValueTypeStatic": "Valor estático",
|
|
186
|
+
"deleteOption": "Excluir opção",
|
|
156
187
|
"disablePast": "Desativar datas passadas",
|
|
188
|
+
"editOption": "Editar opção",
|
|
157
189
|
"errorMessage": "Mensagem de erro",
|
|
158
190
|
"helperText": "Texto de ajuda",
|
|
159
191
|
"httpConfiguration": "Configuração HTTP",
|
|
@@ -209,6 +241,48 @@ declare const _default: {
|
|
|
209
241
|
"deleteNodeSuccess": "Nó excluído com sucesso",
|
|
210
242
|
"editNode": "Editar nó"
|
|
211
243
|
},
|
|
244
|
+
"openApiDialog": {
|
|
245
|
+
"baseUrlHint": "Optional. Overrides the document's first server URL — useful when the spec points at a different environment.",
|
|
246
|
+
"baseUrlLabel": "Base URL override",
|
|
247
|
+
"clear": "Clear",
|
|
248
|
+
"cleared": "OpenAPI cleared.",
|
|
249
|
+
"description": "Provide an OpenAPI 3.x document to power URL suggestions and Authorize.",
|
|
250
|
+
"emptyInput": "Please provide a URL or paste a JSON document.",
|
|
251
|
+
"jsonLabel": "Paste your OpenAPI JSON",
|
|
252
|
+
"load": "Load",
|
|
253
|
+
"loadFailed": "Failed to load OpenAPI document",
|
|
254
|
+
"loadSuccess": "OpenAPI loaded.",
|
|
255
|
+
"modeJson": "Paste JSON",
|
|
256
|
+
"modeUrl": "From URL",
|
|
257
|
+
"title": "OpenAPI source",
|
|
258
|
+
"urlLabel": "OpenAPI document URL"
|
|
259
|
+
},
|
|
260
|
+
"optionsSourceForm": {
|
|
261
|
+
"descriptionField": "Description",
|
|
262
|
+
"descriptionFieldPlaceholder": "Path to description (optional)",
|
|
263
|
+
"detect": "Detect fields",
|
|
264
|
+
"detectFailed": "Failed to fetch the API.",
|
|
265
|
+
"detectSuccess": "Fields detected.",
|
|
266
|
+
"disable": "Use static options",
|
|
267
|
+
"dynamicHint": "Options are fetched from this API at runtime.",
|
|
268
|
+
"enable": "Fetch from API",
|
|
269
|
+
"imageField": "Image",
|
|
270
|
+
"imageFieldPlaceholder": "Path to image URL (optional)",
|
|
271
|
+
"labelField": "Label",
|
|
272
|
+
"labelFieldPlaceholder": "Path to label (e.g., name)",
|
|
273
|
+
"noFieldsDetected": "No fields detected — check the URL or response path.",
|
|
274
|
+
"none": "— None —",
|
|
275
|
+
"previewCount": "{count} options detected",
|
|
276
|
+
"responsePath": "Response path",
|
|
277
|
+
"responsePathHint": "Optional. Use a path like \"data.users\" if the array is nested.",
|
|
278
|
+
"responsePathPlaceholder": "e.g., data.users",
|
|
279
|
+
"staticOptions": "Static options",
|
|
280
|
+
"staticOptionsHint": "Options are defined manually in the editor.",
|
|
281
|
+
"title": "Options source",
|
|
282
|
+
"urlRequired": "URL is required.",
|
|
283
|
+
"valueField": "Value",
|
|
284
|
+
"valueFieldPlaceholder": "Path to value (e.g., id)"
|
|
285
|
+
},
|
|
212
286
|
"selectInputType": {
|
|
213
287
|
"type": "Tipo"
|
|
214
288
|
},
|
|
@@ -290,6 +364,9 @@ declare const _default: {
|
|
|
290
364
|
"search": "Pesquisar...",
|
|
291
365
|
"selectOption": "Selecione uma opção"
|
|
292
366
|
},
|
|
367
|
+
"defaultCheckboxInput": {
|
|
368
|
+
"loadingOptions": "Carregando opções..."
|
|
369
|
+
},
|
|
293
370
|
"defaultHttpInput": {
|
|
294
371
|
"fetchFailed": "Falha ao buscar dados. Por favor, verifique sua conexão de rede.",
|
|
295
372
|
"httpError": "Erro HTTP {status}: {statusText}",
|
|
@@ -318,6 +395,9 @@ declare const _default: {
|
|
|
318
395
|
"startDate": "Data de início",
|
|
319
396
|
"startTime": "Hora de início"
|
|
320
397
|
},
|
|
398
|
+
"defaultRadioInput": {
|
|
399
|
+
"loadingOptions": "Carregando opções..."
|
|
400
|
+
},
|
|
321
401
|
"defaultSelectInput": {
|
|
322
402
|
"selectOption": "Selecione uma opção"
|
|
323
403
|
},
|
|
@@ -113,6 +113,39 @@ export type HttpConfig = {
|
|
|
113
113
|
*/
|
|
114
114
|
showLoading?: boolean;
|
|
115
115
|
};
|
|
116
|
+
/**
|
|
117
|
+
* Maps response item fields to InputOption properties.
|
|
118
|
+
* Each value is a path expression (e.g., "id", "user.name", "items[0].title").
|
|
119
|
+
*/
|
|
120
|
+
export type OptionsSourceMapping = {
|
|
121
|
+
/** Path to the field used as InputOption.value */
|
|
122
|
+
valueField: string;
|
|
123
|
+
/** Path to the field used as InputOption.label */
|
|
124
|
+
labelField: string;
|
|
125
|
+
/** Path to the field used as InputOption.description (optional) */
|
|
126
|
+
descriptionField?: string;
|
|
127
|
+
/** Path to the field used as InputOption.image (optional) */
|
|
128
|
+
imageField?: string;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Dynamic options source — fetches the option list from an HTTP endpoint
|
|
132
|
+
* at runtime. Applies to inputs that use options (radio, checkbox, select,
|
|
133
|
+
* autocomplete). When set, overrides the static `options` array.
|
|
134
|
+
*/
|
|
135
|
+
export type OptionsSource = {
|
|
136
|
+
/** API URL (supports template variables like {{fieldId}}) */
|
|
137
|
+
url?: string;
|
|
138
|
+
/** HTTP method */
|
|
139
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
140
|
+
/** Custom headers (merged with global headers; field-level wins) */
|
|
141
|
+
headers?: HttpHeader[];
|
|
142
|
+
/** Request body (for POST/PUT/PATCH; supports template variables) */
|
|
143
|
+
body?: string;
|
|
144
|
+
/** JSONPath to extract the array from the response (e.g., "data.users") */
|
|
145
|
+
responsePath?: string;
|
|
146
|
+
/** Field-to-property mapping for each response item */
|
|
147
|
+
mapping?: OptionsSourceMapping;
|
|
148
|
+
};
|
|
116
149
|
export type SubmitConfig = {
|
|
117
150
|
/**
|
|
118
151
|
* The HTTP method to use for form submission
|
|
@@ -214,10 +247,21 @@ export type InputNodeData = BaseNodeData & {
|
|
|
214
247
|
* HTTP configuration for the input field (used with type="http")
|
|
215
248
|
*/
|
|
216
249
|
httpConfig?: HttpConfig;
|
|
250
|
+
/**
|
|
251
|
+
* Dynamic options source — fetches the option list from an HTTP endpoint
|
|
252
|
+
* at runtime. Used by option-based inputs (radio, checkbox, select, autocomplete).
|
|
253
|
+
* When set, overrides the static `options` array.
|
|
254
|
+
*/
|
|
255
|
+
optionsSource?: OptionsSource;
|
|
217
256
|
/**
|
|
218
257
|
* Submit configuration for the input field (used with type="submit")
|
|
219
258
|
*/
|
|
220
259
|
submitConfig?: SubmitConfig;
|
|
260
|
+
/**
|
|
261
|
+
* Optional illustrative image displayed above the input label.
|
|
262
|
+
* Stored as a base64 data URL (uploads are resized/compressed) or a remote URL.
|
|
263
|
+
*/
|
|
264
|
+
image?: string;
|
|
221
265
|
};
|
|
222
266
|
export type UINodeData = BaseNodeData & {
|
|
223
267
|
/**
|
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.45",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./dist/main.d.ts",
|
|
8
8
|
"module": "./dist/main.js",
|
|
@@ -63,6 +63,8 @@
|
|
|
63
63
|
"@radix-ui/react-separator": "^1.1.7",
|
|
64
64
|
"@radix-ui/react-slot": "^1.2.4",
|
|
65
65
|
"@radix-ui/react-switch": "^1.2.6",
|
|
66
|
+
"@radix-ui/react-toggle": "^1.1.10",
|
|
67
|
+
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
66
68
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
67
69
|
"@tanstack/react-form": "^1.23.5",
|
|
68
70
|
"@uiw/react-textarea-code-editor": "^3.1.1",
|
|
@@ -104,7 +106,6 @@
|
|
|
104
106
|
"typescript": "^5.9.2",
|
|
105
107
|
"unplugin-dts": "^1.0.0-beta.6",
|
|
106
108
|
"vite": "^8.0.10",
|
|
107
|
-
"vite-plugin-css-injected-by-js": "^5.0.1",
|
|
108
109
|
"vitest": "^4.1.5"
|
|
109
110
|
},
|
|
110
111
|
"peerDependencies": {
|