@form-engine-ts/react 2.1.1 → 2.3.0
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 +21 -1
- package/dist/index.cjs +994 -423
- package/dist/index.d.cts +156 -5
- package/dist/index.d.ts +156 -5
- package/dist/index.js +999 -427
- package/dist/styles.css +7 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ batch-translation action.
|
|
|
55
55
|
|
|
56
56
|
`useFormBuilder({ schema, onChange, policy, idFactory, factories })` exposes controlled field, option, page, condition,
|
|
57
57
|
source-text, and localized-text actions. Core's `FormPolicy` enforces allowed field types, field/option limits, text and
|
|
58
|
-
schema-byte limits, and required
|
|
58
|
+
schema-byte limits, and required/allowed/maximum locale constraints identically in browser and server code. Every mutation returns a typed
|
|
59
59
|
`BuilderActionResult`; invalid, empty, or duplicate generated IDs leave the schema unchanged. `BuilderFactories` injects
|
|
60
60
|
initial field, option, and page shapes. `<FormBuilder>` delegates its UI mutations to this hook and accepts the same
|
|
61
61
|
options. Its completion-message editors cover both source and locale text. `translationOptions` and
|
|
@@ -67,6 +67,26 @@ Visual-builder field creation uses `defaultFieldType` when it is allowed, otherw
|
|
|
67
67
|
per-locale/property metadata to manual edits. Automatic translation defaults to `overwrite: "missing-only"`; explicitly
|
|
68
68
|
pass `{ overwrite: "all" }` to replace existing translations.
|
|
69
69
|
|
|
70
|
+
Pass `readOnly` to keep the complete builder visible while disabling every mutation. The `features` prop independently
|
|
71
|
+
controls `pages`, `localization`, and `conditions` authoring surfaces; each defaults to `true`. When `allowedLocales` is
|
|
72
|
+
set, locale addition becomes a selector containing only unregistered allowed locales, and the action is disabled at
|
|
73
|
+
`maxLocales`.
|
|
74
|
+
|
|
75
|
+
Visual Builder has two independent design-system extension layers. `components` replaces normalized primitives such as
|
|
76
|
+
`Button`, `TextInput`, `TextArea`, `Select`, `Checkbox`, `Section`, and `Fieldset`. `slots` replaces complete authoring
|
|
77
|
+
surfaces: `toolbar`, `fieldEditor`, `optionEditor`, `pages`, `localization`, or `translationActions`. Slot props expose
|
|
78
|
+
policy-aware `actions`; a custom `translationActions` slot can therefore call an application-specific AI mutation while
|
|
79
|
+
the standard manual localization editors remain unchanged.
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
<FormBuilder
|
|
83
|
+
schema={schema}
|
|
84
|
+
onChange={setSchema}
|
|
85
|
+
components={{ Button: MuiButtonAdapter, TextInput: MuiTextFieldAdapter }}
|
|
86
|
+
slots={{ translationActions: ArgsAiTranslationActions }}
|
|
87
|
+
/>
|
|
88
|
+
```
|
|
89
|
+
|
|
70
90
|
`FormRenderer` can also be used without an explicit provider:
|
|
71
91
|
|
|
72
92
|
```tsx
|