treege 3.0.0-beta.60 → 3.0.0-beta.61
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 +46 -46
- package/dist/DefaultInputs-DamDWb5R.js +1988 -0
- package/dist/{ThemeContext-Ddk_Y-Dz.js → ThemeContext-cGSTk24y.js} +121 -126
- package/dist/editor/context/TreegeEditorRuntimeProvider.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +3 -3
- package/dist/editor/features/TreegeEditor/dialogs/HeadersDialog.d.ts +3 -3
- package/dist/editor/features/TreegeEditor/forms/OptionsMappingFields.d.ts +3 -3
- package/dist/editor/features/TreegeEditor/forms/SensitiveHeaderWarning.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +4 -4
- package/dist/editor/hooks/useKeyValueRows.d.ts +15 -0
- package/dist/editor/types/editor.d.ts +4 -10
- package/dist/editor/utils/sensitiveHeaders.d.ts +8 -3
- package/dist/{editor-D2pBjE7E.js → editor-DtAQNPJm.js} +1350 -1324
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -4
- package/dist/renderer/context/TreegeRenderRuntimeProvider.d.ts +3 -3
- package/dist/renderer/features/TreegeRenderer/native/components/OptionItemContent.d.ts +17 -0
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/OptionItemContent.d.ts +17 -0
- package/dist/renderer/hooks/useSubmitHandler.d.ts +2 -2
- package/dist/renderer/types/renderer.d.ts +5 -2
- package/dist/renderer/utils/http.d.ts +14 -5
- package/dist/renderer/utils/submit.d.ts +2 -2
- package/dist/renderer-native.js +1114 -1080
- package/dist/renderer.js +3 -3
- package/dist/shared/components/ui/item.d.ts +23 -0
- package/dist/shared/components/ui/popover.d.ts +7 -1
- package/dist/shared/context/PortalContainerContext.d.ts +5 -0
- package/dist/shared/types/node.d.ts +26 -26
- package/dist/shared/utils/httpRecord.d.ts +20 -0
- package/package.json +1 -1
- package/dist/DefaultInputs-nRQc9BHG.js +0 -1881
package/README.md
CHANGED
|
@@ -335,22 +335,22 @@ You can implement these inputs using popular React Native libraries:
|
|
|
335
335
|
|
|
336
336
|
The React Native renderer shares the same API as the web renderer, with some platform-specific props:
|
|
337
337
|
|
|
338
|
-
| Prop | Type | Default | Description
|
|
339
|
-
|
|
340
|
-
| `flow` | `Flow \| null` | - | Decision tree to render
|
|
341
|
-
| `onSubmit` | `(values: FormValues, meta?: Meta) => void` | - | Form submission handler (meta includes HTTP response data)
|
|
342
|
-
| `onChange` | `(values: FormValues) => void` | - | Form change handler
|
|
343
|
-
| `validate` | `(values, nodes) => Record<string, string>` | - | Custom validation function
|
|
344
|
-
| `initialValues` | `FormValues` | `{}` | Initial form values
|
|
345
|
-
| `components` | `TreegeRendererComponents` | - | Custom component overrides
|
|
346
|
-
| `language` | `string` | `"en"` | UI language
|
|
347
|
-
| `validationMode` | `"onSubmit" \| "onChange"` | `"onSubmit"` | When to validate
|
|
348
|
-
| `theme` | `"light" \| "dark"` | `"dark"` | Renderer theme
|
|
349
|
-
| `googleApiKey` | `string` | - | API key for address input
|
|
350
|
-
| `headers` | `
|
|
351
|
-
| `isLoading` | `boolean` | `false` | Render a loading skeleton instead of the form
|
|
352
|
-
| `style` | `ViewStyle` | - | ScrollView style (RN only)
|
|
353
|
-
| `contentContainerStyle` | `ViewStyle` | - | Content container style (RN)
|
|
338
|
+
| Prop | Type | Default | Description |
|
|
339
|
+
|-------------------------|---------------------------------------------|--------------|--------------------------------------------------------------------------------|
|
|
340
|
+
| `flow` | `Flow \| null` | - | Decision tree to render |
|
|
341
|
+
| `onSubmit` | `(values: FormValues, meta?: Meta) => void` | - | Form submission handler (meta includes HTTP response data) |
|
|
342
|
+
| `onChange` | `(values: FormValues) => void` | - | Form change handler |
|
|
343
|
+
| `validate` | `(values, nodes) => Record<string, string>` | - | Custom validation function |
|
|
344
|
+
| `initialValues` | `FormValues` | `{}` | Initial form values |
|
|
345
|
+
| `components` | `TreegeRendererComponents` | - | Custom component overrides |
|
|
346
|
+
| `language` | `string` | `"en"` | UI language |
|
|
347
|
+
| `validationMode` | `"onSubmit" \| "onChange"` | `"onSubmit"` | When to validate |
|
|
348
|
+
| `theme` | `"light" \| "dark"` | `"dark"` | Renderer theme |
|
|
349
|
+
| `googleApiKey` | `string` | - | API key for address input |
|
|
350
|
+
| `headers` | `HttpHeaders` | - | HTTP headers as `{ name: value }`, applied to every request (field-level wins) |
|
|
351
|
+
| `isLoading` | `boolean` | `false` | Render a loading skeleton instead of the form |
|
|
352
|
+
| `style` | `ViewStyle` | - | ScrollView style (RN only) |
|
|
353
|
+
| `contentContainerStyle` | `ViewStyle` | - | Content container style (RN) |
|
|
354
354
|
|
|
355
355
|
## Node Types
|
|
356
356
|
|
|
@@ -683,39 +683,39 @@ Once the development server is running, you can access these examples:
|
|
|
683
683
|
|
|
684
684
|
### TreegeEditor Props
|
|
685
685
|
|
|
686
|
-
| Prop | Type | Default | Description
|
|
687
|
-
|
|
688
|
-
| `flow` | `Flow \| null` | `null` | Initial decision tree
|
|
689
|
-
| `onSave` | `(flow: Flow) => void` | - | Callback when tree is saved
|
|
690
|
-
| `onExportJson` | `() => { nodes: Node[]; edges: Edge[] }` | - | Callback for exporting JSON data
|
|
691
|
-
| `language` | `string` | `"en"` | UI language
|
|
692
|
-
| `theme` | `"light" \| "dark"` | `"dark"` | Editor theme
|
|
693
|
-
| `aiConfig` | `AIConfig` | - | AI configuration for tree generation (see [AI Generation](./AI_GENERATION.md))
|
|
694
|
-
| `className` | `string` | - | Additional CSS class names for custom styling
|
|
695
|
-
| `extraMenuItems` | `ExtraMenuItem[]` | - | Extra entries appended to the actions panel "more" dropdown
|
|
696
|
-
| `openApi` | `OpenApiDocument \| string` | - | OpenAPI 3.x source used to power URL/route suggestions and the Authorize flow. Accepts a pre-parsed document or a URL string (the editor fetches it on mount and toasts on failure)
|
|
697
|
-
| `
|
|
698
|
-
| `headers` | `
|
|
699
|
-
| `onAuthorize` | `(headers:
|
|
700
|
-
| `onHeadersChange` | `(headers:
|
|
686
|
+
| Prop | Type | Default | Description |
|
|
687
|
+
|-------------------|------------------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
688
|
+
| `flow` | `Flow \| null` | `null` | Initial decision tree |
|
|
689
|
+
| `onSave` | `(flow: Flow) => void` | - | Callback when tree is saved |
|
|
690
|
+
| `onExportJson` | `() => { nodes: Node[]; edges: Edge[] }` | - | Callback for exporting JSON data |
|
|
691
|
+
| `language` | `string` | `"en"` | UI language |
|
|
692
|
+
| `theme` | `"light" \| "dark"` | `"dark"` | Editor theme |
|
|
693
|
+
| `aiConfig` | `AIConfig` | - | AI configuration for tree generation (see [AI Generation](./AI_GENERATION.md)) |
|
|
694
|
+
| `className` | `string` | - | Additional CSS class names for custom styling |
|
|
695
|
+
| `extraMenuItems` | `ExtraMenuItem[]` | - | Extra entries appended to the actions panel "more" dropdown |
|
|
696
|
+
| `openApi` | `OpenApiDocument \| string` | - | OpenAPI 3.x source used to power URL/route suggestions and the Authorize flow. Accepts a pre-parsed document or a URL string (the editor fetches it on mount and toasts on failure) |
|
|
697
|
+
| `baseUrl` | `string` | - | Base URL the tree runs against. HTTP/options-source urls are stored relative to it, shown as a read-only prefix, and used to resolve the "Detect fields" probe. Pass the same value as `TreegeRenderer`'s `baseUrl` |
|
|
698
|
+
| `headers` | `HttpHeaders` | - | Global HTTP headers applied to in-editor requests (e.g. the "Detect fields" button). Pass the same value you give to `TreegeRenderer` so editor previews use the same auth/headers as runtime |
|
|
699
|
+
| `onAuthorize` | `(headers: HttpHeaders) => void` | - | Called when the user submits the Authorize dialog. Forward the resulting headers to `TreegeRenderer` (or `TreegeRendererProvider`) so every form request is authenticated |
|
|
700
|
+
| `onHeadersChange` | `(headers: HttpHeaders) => void` | - | Called when the user edits headers in the built-in "Global headers" dialog. The component is controlled — update your `headers` state in response and pass the new object back via the `headers` prop |
|
|
701
701
|
|
|
702
702
|
### TreegeRenderer Props
|
|
703
703
|
|
|
704
|
-
| Prop | Type | Default | Description
|
|
705
|
-
|
|
706
|
-
| `flow`
|
|
707
|
-
| `onSubmit` | `(values: FormValues, meta?: Meta) => void` | - | Form submission handler (meta includes HTTP response data)
|
|
708
|
-
| `onChange` | `(values: FormValues) => void` | - | Form change handler
|
|
709
|
-
| `validate` | `(values, nodes) => Record<string, string>` | - | Custom validation function
|
|
710
|
-
| `initialValues` | `FormValues` | `{}` | Initial form values
|
|
711
|
-
| `components` | `TreegeRendererComponents` | - | Custom component overrides
|
|
712
|
-
| `language` | `string` | `"en"` | UI language
|
|
713
|
-
| `validationMode` | `"onSubmit" \| "onChange"` | `"onSubmit"` | When to validate
|
|
714
|
-
| `theme` | `"light" \| "dark"` | `"dark"` | Renderer theme
|
|
715
|
-
| `googleApiKey` | `string` | - | API key for address input
|
|
716
|
-
| `headers` | `
|
|
717
|
-
| `isLoading` | `boolean` | `false` | Render a loading skeleton instead of the form (see below)
|
|
718
|
-
| `className` | `string` | - | Additional CSS class names for custom styling
|
|
704
|
+
| Prop | Type | Default | Description |
|
|
705
|
+
|------------------|---------------------------------------------|--------------|--------------------------------------------------------------------------------|
|
|
706
|
+
| `flow` | `Flow \| null` | - | Decision tree to render |
|
|
707
|
+
| `onSubmit` | `(values: FormValues, meta?: Meta) => void` | - | Form submission handler (meta includes HTTP response data) |
|
|
708
|
+
| `onChange` | `(values: FormValues) => void` | - | Form change handler |
|
|
709
|
+
| `validate` | `(values, nodes) => Record<string, string>` | - | Custom validation function |
|
|
710
|
+
| `initialValues` | `FormValues` | `{}` | Initial form values |
|
|
711
|
+
| `components` | `TreegeRendererComponents` | - | Custom component overrides |
|
|
712
|
+
| `language` | `string` | `"en"` | UI language |
|
|
713
|
+
| `validationMode` | `"onSubmit" \| "onChange"` | `"onSubmit"` | When to validate |
|
|
714
|
+
| `theme` | `"light" \| "dark"` | `"dark"` | Renderer theme |
|
|
715
|
+
| `googleApiKey` | `string` | - | API key for address input |
|
|
716
|
+
| `headers` | `HttpHeaders` | - | HTTP headers as `{ name: value }`, applied to every request (field-level wins) |
|
|
717
|
+
| `isLoading` | `boolean` | `false` | Render a loading skeleton instead of the form (see below) |
|
|
718
|
+
| `className` | `string` | - | Additional CSS class names for custom styling |
|
|
719
719
|
|
|
720
720
|
## Development
|
|
721
721
|
|