treege 3.0.0-beta.59 → 3.0.0-beta.60
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 +11 -13
- package/dist/{DefaultInputs-CoDN_KvC.js → DefaultInputs-nRQc9BHG.js} +1 -1
- package/dist/ThemeContext-Ddk_Y-Dz.js +1402 -0
- package/dist/editor/context/{TreegeEditorContext.d.ts → TreegeEditorRuntimeProvider.d.ts} +6 -6
- package/dist/editor/hooks/useTranslate.d.ts +1 -1
- package/dist/editor/types/editor.d.ts +1 -1
- package/dist/{editor-Cd_ifJTX.js → editor-D2pBjE7E.js} +2 -2
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -4
- package/dist/renderer/context/{TreegeRendererContext.d.ts → TreegeRenderRuntimeProvider.d.ts} +7 -7
- package/dist/renderer/context/TreegeRendererProvider.d.ts +15 -0
- package/dist/renderer/hooks/useTranslate.d.ts +1 -1
- package/dist/renderer/index.d.ts +1 -1
- package/dist/renderer/index.native.d.ts +1 -1
- package/dist/renderer/types/renderer.d.ts +1 -1
- package/dist/renderer-native.js +2 -2
- package/dist/renderer.js +3 -3
- package/dist/shared/locales/ar.json.d.ts +2 -2
- package/dist/shared/locales/de.json.d.ts +2 -2
- package/dist/shared/locales/en.json.d.ts +2 -2
- package/dist/shared/locales/es.json.d.ts +2 -2
- package/dist/shared/locales/fr.json.d.ts +2 -2
- package/dist/shared/locales/it.json.d.ts +2 -2
- package/dist/shared/locales/pt.json.d.ts +2 -2
- package/package.json +1 -1
- package/dist/ThemeContext-ClYtPOGK.js +0 -1402
- package/dist/renderer/context/TreegeConfigContext.d.ts +0 -15
package/README.md
CHANGED
|
@@ -542,24 +542,22 @@ Use the HTTP input type to fetch and map data from APIs:
|
|
|
542
542
|
|
|
543
543
|
### Global Configuration
|
|
544
544
|
|
|
545
|
-
Configure the renderer globally using the
|
|
545
|
+
Configure the renderer globally using the TreegeRendererProvider:
|
|
546
546
|
|
|
547
547
|
```tsx
|
|
548
|
-
import {
|
|
548
|
+
import { TreegeRendererProvider } from "treege/renderer";
|
|
549
549
|
|
|
550
550
|
function App() {
|
|
551
551
|
return (
|
|
552
|
-
<
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
components
|
|
557
|
-
// Your custom components
|
|
558
|
-
}
|
|
552
|
+
<TreegeRendererProvider
|
|
553
|
+
language="fr"
|
|
554
|
+
googleApiKey="your-google-api-key"
|
|
555
|
+
components={{
|
|
556
|
+
// Your custom components
|
|
559
557
|
}}
|
|
560
558
|
>
|
|
561
559
|
<TreegeRenderer flow={flow} />
|
|
562
|
-
</
|
|
560
|
+
</TreegeRendererProvider>
|
|
563
561
|
);
|
|
564
562
|
}
|
|
565
563
|
```
|
|
@@ -678,8 +676,8 @@ Once the development server is running, you can access these examples:
|
|
|
678
676
|
- **Custom Input Example**: [http://localhost:5173/example-custom-input](http://localhost:5173/example-custom-input)
|
|
679
677
|
- Demonstrates how to create and integrate custom input components
|
|
680
678
|
|
|
681
|
-
- **
|
|
682
|
-
- Shows global configuration with
|
|
679
|
+
- **TreegeRendererProvider Example**: [http://localhost:5173/example-treege-renderer-provider](http://localhost:5173/example-treege-renderer-provider)
|
|
680
|
+
- Shows global configuration with TreegeRendererProvider
|
|
683
681
|
|
|
684
682
|
## API Reference
|
|
685
683
|
|
|
@@ -698,7 +696,7 @@ Once the development server is running, you can access these examples:
|
|
|
698
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) |
|
|
699
697
|
| `openApiBaseUrl` | `string` | - | Base URL used for OpenAPI route resolution. When set, takes precedence over the document's `servers[0].url` — useful when the spec points at a different environment than the one to call |
|
|
700
698
|
| `headers` | `HttpHeader[]` | - | 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 |
|
|
701
|
-
| `onAuthorize` | `(headers: HttpHeader[]) => void` | - | Called when the user submits the Authorize dialog. Forward the resulting headers to `TreegeRenderer` (or `
|
|
699
|
+
| `onAuthorize` | `(headers: HttpHeader[]) => void` | - | Called when the user submits the Authorize dialog. Forward the resulting headers to `TreegeRenderer` (or `TreegeRendererProvider`) so every form request is authenticated |
|
|
702
700
|
| `onHeadersChange` | `(headers: HttpHeader[]) => 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 list back via the `headers` prop |
|
|
703
701
|
|
|
704
702
|
### TreegeRenderer Props
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, N as r, O as i, P as a, S as o, T as s, b as c, d as l, h as u, i as d, j as f, k as p, r as m, s as h, t as g, w as _, y as v } from "./ThemeContext-
|
|
1
|
+
import { C as e, D as t, E as n, N as r, O as i, P as a, S as o, T as s, b as c, d as l, h as u, i as d, j as f, k as p, r as m, s as h, t as g, w as _, y as v } from "./ThemeContext-Ddk_Y-Dz.js";
|
|
2
2
|
import * as y from "react";
|
|
3
3
|
import { forwardRef as b, useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
4
4
|
import { Fragment as ee, jsx as E, jsxs as D } from "react/jsx-runtime";
|