treege 3.0.0-beta.56 → 3.0.0-beta.58
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 +33 -10
- package/dist/DefaultInputs-Dr3R5r53.js +1881 -0
- package/dist/ThemeContext-DrI5HTYl.js +1402 -0
- package/dist/editor/context/TreegeEditorContext.d.ts +8 -1
- package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/forms/SensitiveHeaderWarning.d.ts +13 -0
- package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +0 -10
- package/dist/editor/types/editor.d.ts +35 -4
- package/dist/editor/utils/cleanNodeConfig.d.ts +5 -0
- package/dist/editor/utils/sensitiveHeaders.d.ts +15 -0
- package/dist/editor-BhL3w_KP.js +6251 -0
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -4
- package/dist/renderer/context/TreegeRendererContext.d.ts +12 -0
- package/dist/renderer/features/TreegeRenderer/InputRendererHost.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/DependencyHint.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +20 -19
- package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/DependencyHint.d.ts +22 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +2 -2
- package/dist/renderer/hooks/useRenderNode.d.ts +2 -1
- package/dist/renderer/hooks/useSubmitHandler.d.ts +2 -1
- package/dist/renderer/types/renderer.d.ts +77 -23
- package/dist/renderer/utils/http.d.ts +11 -0
- package/dist/renderer/utils/node.d.ts +11 -0
- package/dist/renderer/utils/submit.d.ts +2 -1
- package/dist/renderer/utils/templateDependencies.d.ts +17 -0
- package/dist/renderer-native.js +1333 -1280
- package/dist/renderer.js +3 -3
- package/dist/shared/constants/inputType.d.ts +5 -0
- package/dist/shared/locales/ar.json.d.ts +15 -2
- package/dist/shared/locales/de.json.d.ts +15 -2
- package/dist/shared/locales/en.json.d.ts +15 -2
- package/dist/shared/locales/es.json.d.ts +15 -2
- package/dist/shared/locales/fr.json.d.ts +15 -2
- package/dist/shared/locales/it.json.d.ts +15 -2
- package/dist/shared/locales/pt.json.d.ts +15 -2
- package/package.json +1 -1
- package/dist/DefaultInputs-DklwwMaZ.js +0 -1807
- package/dist/ThemeContext-DAMkr9gW.js +0 -1362
- package/dist/editor-uMYOjG2i.js +0 -6079
|
@@ -3,9 +3,16 @@ import { AIConfig } from '../types/ai';
|
|
|
3
3
|
import { HttpHeader } from '../../shared/types/node';
|
|
4
4
|
export interface TreegeEditorContextValue {
|
|
5
5
|
/**
|
|
6
|
-
* Current language
|
|
6
|
+
* Current language of the editor UI. Also used as the default language for
|
|
7
|
+
* the per-node translation editor in `InputNodeForm`.
|
|
7
8
|
*/
|
|
8
9
|
language: string;
|
|
10
|
+
/**
|
|
11
|
+
* Set the editor UI language at runtime (driven by the language switcher in
|
|
12
|
+
* the actions panel). Seeded from the `language` prop, then owned internally;
|
|
13
|
+
* the consumer can observe changes via `TreegeEditor`'s `onLanguageChange`.
|
|
14
|
+
*/
|
|
15
|
+
setLanguage: (language: string) => void;
|
|
9
16
|
/**
|
|
10
17
|
* Current flow ID
|
|
11
18
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TreegeEditorProps } from '../../types/editor';
|
|
2
|
-
declare const TreegeEditor: ({ flow, onExportJson, onSave, theme, language, aiConfig, extraMenuItems, openApi, openApiBaseUrl, onAuthorize, headers, onHeadersChange, }: TreegeEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const TreegeEditor: ({ flow, onExportJson, onSave, theme, language: controlledLanguage, defaultLanguage, onLanguageChange, aiConfig, extraMenuItems, openApi, baseUrl, openApiBaseUrl, onAuthorize, headers, onHeadersChange, }: TreegeEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TreegeEditor;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpHeader } from '../../../../shared/types/node';
|
|
2
|
+
interface SensitiveHeaderWarningProps {
|
|
3
|
+
headers?: HttpHeader[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Inline alert shown when a field-level header carries credentials (e.g. an
|
|
7
|
+
* `Authorization` bearer or API key). These headers are persisted in the
|
|
8
|
+
* exported/saved tree, so the user is nudged toward the non-persisted global
|
|
9
|
+
* headers (Authorize) for authentication. Renders nothing when no sensitive
|
|
10
|
+
* header is present.
|
|
11
|
+
*/
|
|
12
|
+
declare const SensitiveHeaderWarning: ({ headers }: SensitiveHeaderWarningProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export default SensitiveHeaderWarning;
|
|
@@ -16,15 +16,5 @@ interface ApiUrlComboboxProps extends Omit<ComponentProps<typeof Input>, "onChan
|
|
|
16
16
|
*/
|
|
17
17
|
children?: ReactNode;
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
20
|
-
* URL field that augments a regular `<Input>` with a Popover suggesting
|
|
21
|
-
* routes from the editor-loaded OpenAPI document. The user can either type
|
|
22
|
-
* a custom URL freely (current behavior preserved) or click the Globe icon
|
|
23
|
-
* to pick a route — selecting one resolves the URL with the document's
|
|
24
|
-
* server and emits the route's HTTP method back to the caller.
|
|
25
|
-
*
|
|
26
|
-
* When no OpenAPI document is loaded, the Globe trigger is hidden and the
|
|
27
|
-
* component is functionally identical to a plain `<Input>`.
|
|
28
|
-
*/
|
|
29
19
|
declare const ApiUrlCombobox: ({ value, onChange, placeholder, children, ...inputProps }: ApiUrlComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
20
|
export default ApiUrlCombobox;
|
|
@@ -44,9 +44,27 @@ export interface TreegeEditorProps {
|
|
|
44
44
|
*/
|
|
45
45
|
theme?: "dark" | "light";
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* Controlled editor UI language. When provided, the editor runs in controlled
|
|
48
|
+
* mode: this value always wins and the built-in switcher only fires
|
|
49
|
+
* `onLanguageChange` — you must update this prop to actually change the
|
|
50
|
+
* language. Leave undefined to let the editor manage it itself (see
|
|
51
|
+
* `defaultLanguage`).
|
|
48
52
|
*/
|
|
49
53
|
language?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Initial editor UI language in uncontrolled mode. The editor seeds its
|
|
56
|
+
* internal state with this value, then owns it so the user can switch at
|
|
57
|
+
* runtime via the actions panel. Ignored when `language` is provided.
|
|
58
|
+
* @default "en"
|
|
59
|
+
*/
|
|
60
|
+
defaultLanguage?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Called whenever the user switches the editor language via the built-in
|
|
63
|
+
* switcher, with the newly selected language. Required to react to the change
|
|
64
|
+
* in controlled mode; optional in uncontrolled mode (use it to persist or
|
|
65
|
+
* sync the choice).
|
|
66
|
+
*/
|
|
67
|
+
onLanguageChange?: (language: string) => void;
|
|
50
68
|
/**
|
|
51
69
|
* AI configuration for tree generation
|
|
52
70
|
*/
|
|
@@ -69,9 +87,22 @@ export interface TreegeEditorProps {
|
|
|
69
87
|
*/
|
|
70
88
|
openApi?: OpenApiDocument | string;
|
|
71
89
|
/**
|
|
72
|
-
* Base URL
|
|
73
|
-
*
|
|
74
|
-
*
|
|
90
|
+
* Base URL the produced tree is meant to run against. Pass the same value you
|
|
91
|
+
* give to `TreegeRenderer`'s `baseUrl`. It drives two things in the editor:
|
|
92
|
+
* - HTTP/Options-source urls are stored **relative** to it (route picker emits
|
|
93
|
+
* relative paths), so the exported JSON stays environment-agnostic.
|
|
94
|
+
* - it is shown as a read-only prefix on URL fields and used to resolve the
|
|
95
|
+
* "Detect fields" probe, so editor-time previews hit a real host.
|
|
96
|
+
*
|
|
97
|
+
* Works with or without OpenAPI. When an OpenAPI document is loaded, its
|
|
98
|
+
* `servers[0].url` (or the Authorize dialog override) takes precedence for
|
|
99
|
+
* route resolution; otherwise this value is the base.
|
|
100
|
+
*/
|
|
101
|
+
baseUrl?: string;
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated Use `baseUrl` instead — it now covers OpenAPI route resolution
|
|
104
|
+
* and the general runtime base. Kept as an alias for backward compatibility;
|
|
105
|
+
* `baseUrl` wins when both are set.
|
|
75
106
|
*/
|
|
76
107
|
openApiBaseUrl?: string;
|
|
77
108
|
/**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a copy of `data` with config blocks that don't belong to `subType`
|
|
3
|
+
* removed. Pure — returns the same reference when nothing is dropped.
|
|
4
|
+
*/
|
|
5
|
+
export declare const cleanConfigForSubType: <T extends Record<string, unknown>>(data: T, subType: string) => T;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Flow, HttpHeader } from '../../shared/types/node';
|
|
2
|
+
/** True when a header key is known to carry credentials/secrets. */
|
|
3
|
+
export declare const isSensitiveHeaderKey: (key: string) => boolean;
|
|
4
|
+
/** True when the list contains a sensitive header with a non-empty value. */
|
|
5
|
+
export declare const hasSensitiveHeader: (headers?: HttpHeader[]) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a copy of the flow with all credential-bearing field-level headers
|
|
8
|
+
* removed from every node's httpConfig/optionsSource/submitConfig, plus the
|
|
9
|
+
* number of headers stripped. The input flow is never mutated, so the live
|
|
10
|
+
* editor canvas keeps its values — only the exported/saved artifact is cleaned.
|
|
11
|
+
*/
|
|
12
|
+
export declare const stripSensitiveHeadersFromFlow: (flow: Flow) => {
|
|
13
|
+
flow: Flow;
|
|
14
|
+
strippedCount: number;
|
|
15
|
+
};
|