@form-engine-ts/react 2.9.3 → 2.9.5
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 +17 -5
- package/dist/index.cjs +521 -363
- package/dist/index.d.cts +45 -8
- package/dist/index.d.ts +45 -8
- package/dist/index.js +522 -364
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -75,8 +75,16 @@ set, locale addition becomes a selector containing only unregistered allowed loc
|
|
|
75
75
|
Visual Builder has two independent design-system extension layers. `components` replaces normalized primitives such as
|
|
76
76
|
`Button`, `TextInput`, `TextArea`, `Select`, `Checkbox`, `Section`, and `Fieldset`. `slots` replaces complete authoring
|
|
77
77
|
surfaces: `toolbar`, `fieldEditor`, `optionEditor`, `pages`, `localization`, or `translationActions`. Slot props expose
|
|
78
|
-
policy-aware `actions
|
|
79
|
-
|
|
78
|
+
policy-aware `actions` and the builder's resolved `translate(key, params)` function. Feature-aware slots also receive the
|
|
79
|
+
relevant feature state, while localization slots receive policy and translation-adapter availability. A custom
|
|
80
|
+
`translationActions` slot can therefore call an application-specific AI mutation while the standard manual localization
|
|
81
|
+
editors remain unchanged. A slot collection can set `sectionOrder` to arrange `basicSettings`, `completionMessage`,
|
|
82
|
+
`questions`, `addQuestion`, and `localization` as independent authoring sections.
|
|
83
|
+
|
|
84
|
+
Slot actions include `setManualTranslation(locale, target, property, text)`. It resolves the target's source text and
|
|
85
|
+
existing translation metadata, invokes `createManualTranslationMetadata`, and then stores the translated text and
|
|
86
|
+
generated metadata together. Custom field, page, option, and localization slots should use this action for user-edited
|
|
87
|
+
translations; `setLocaleTranslation` remains available for callers that already provide explicit metadata.
|
|
80
88
|
|
|
81
89
|
Input primitives receive design-system-friendly `name`, `label`, `required`, `error`, and `helperText` props in addition
|
|
82
90
|
to their normalized string-value callbacks. The `translationActions` slot also receives `translationError`, the latest
|
|
@@ -111,8 +119,8 @@ own labels. Builder action icons can be supplied with `renderIcon`, which resolv
|
|
|
111
119
|
renderHeader: ({ title }) => <MyHeader>{title}</MyHeader>,
|
|
112
120
|
renderPageHeader: ({ page }) => <MyPageHeader page={page} />,
|
|
113
121
|
renderField: (props) => <MyField {...props} />,
|
|
114
|
-
renderSubmitButton: ({ isSubmitting, onSubmit }) => (
|
|
115
|
-
<MyButton
|
|
122
|
+
renderSubmitButton: ({ isSubmitting, disabled, onSubmit }) => (
|
|
123
|
+
<MyButton loading={isSubmitting} disabled={disabled} onClick={onSubmit}>Save</MyButton>
|
|
116
124
|
),
|
|
117
125
|
renderSubmitError: ({ error, onRetry }) => <MyError error={error} onRetry={onRetry} />
|
|
118
126
|
}}
|
|
@@ -121,7 +129,11 @@ own labels. Builder action icons can be supplied with `renderIcon`, which resolv
|
|
|
121
129
|
|
|
122
130
|
Validation runs before `beforeSubmit`. A `"cancel"` result does not call `onSubmit` and preserves values and drafts.
|
|
123
131
|
Header, page-header, field, navigation, submit, validation-summary, completion, and submit-error slots can replace the
|
|
124
|
-
default UI. The localized `completionMessage` is displayed after a successful submission.
|
|
132
|
+
default UI. The localized `completionMessage` is displayed after a successful submission. Set
|
|
133
|
+
`successRenderMode="replace"` to remove the questions, navigation, and submit button after success and focus the
|
|
134
|
+
completion status region; the default `"append"` mode preserves the existing form UI. `hideFormOnSuccess` is retained
|
|
135
|
+
as a deprecated alias for `successRenderMode="replace"`. The submit-button slot receives `submitStatus` and `disabled`
|
|
136
|
+
in addition to `isSubmitting` and `onSubmit`.
|
|
125
137
|
|
|
126
138
|
Pass ordered `submissionGuards` to allow, block, or require confirmation before `onSubmit`. Confirmation receives all
|
|
127
139
|
guard findings through `renderSubmissionConfirmation`. A `receiptStore` prevents accidental repeat submissions and can
|