@praxisui/dynamic-form 1.0.0-beta.59 → 1.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 CHANGED
@@ -37,7 +37,7 @@ keywords:
37
37
  - "schema-driven"
38
38
  - "layout editor"
39
39
  - "settings integration"
40
- last_updated: "2026-03-07"
40
+ last_updated: "2026-03-12"
41
41
  ---
42
42
 
43
43
  # @praxisui/dynamic-form
@@ -153,6 +153,145 @@ Alternatively, when `editModeEnabled` is true, `praxis-dynamic-form` renders a g
153
153
  - Utilities: form rule converters, normalize date arrays, **FormRulesService** (aplica regras de propriedades)
154
154
  - Metadata helpers: `providePraxisDynamicFormMetadata`
155
155
 
156
+ ## Editorial Hosting (Foundation)
157
+
158
+ O `@praxisui/dynamic-form` agora aceita uma surface fundacional para hospedar blocos editoriais ao redor do formulario, sem misturar esses blocos com `fieldMetadata` nem com `formData`.
159
+
160
+ Inputs relevantes:
161
+ - `config.formBlocksBefore?: WidgetDefinition[]`
162
+ - `config.formBlocksBeforeActions?: WidgetDefinition[]`
163
+ - `config.formBlocksAfter?: WidgetDefinition[]`
164
+ - `config.editorialContext?: Record<string, unknown>`
165
+ - `[editorialContext]?: Record<string, unknown>`
166
+
167
+ Precedencia de contexto editorial:
168
+ 1. runtime base do form
169
+ 2. `config.editorialContext`
170
+ 3. input host `[editorialContext]`
171
+
172
+ As camadas posteriores sobrescrevem as anteriores.
173
+
174
+ Exemplo minimo:
175
+
176
+ ```ts
177
+ import type { FormConfig } from '@praxisui/core';
178
+
179
+ const formConfig: FormConfig = {
180
+ editorialContext: {
181
+ accountName: 'Helena Costa',
182
+ accountRole: 'Gestora financeira',
183
+ accountContext: {
184
+ user: {
185
+ name: 'Helena Costa',
186
+ email: 'helena.costa@praxis.demo',
187
+ role: 'Gestora financeira',
188
+ },
189
+ tenant: {
190
+ name: 'Praxis Holding',
191
+ },
192
+ },
193
+ },
194
+ formBlocksBefore: [
195
+ {
196
+ id: 'widget:hero-banner',
197
+ inputs: {
198
+ instanceId: 'editorial:before:hero:1',
199
+ title: 'Praxis Summit 2026',
200
+ subtitle: 'Inscricao institucional',
201
+ description: 'Experiencia institucional com composicao editorial hospedada antes do formulario.',
202
+ variant: 'event',
203
+ },
204
+ },
205
+ {
206
+ id: 'widget:rich-text-block',
207
+ inputs: {
208
+ instanceId: 'editorial:before:rich-text:1',
209
+ title: 'Antes de comecar',
210
+ subtitle: 'Contexto editorial',
211
+ icon: 'info',
212
+ contentFormat: 'markdown',
213
+ content: 'Confirme os dados abaixo antes do envio e consulte a [documentacao](https://example.com/docs) se precisar de suporte.',
214
+ },
215
+ },
216
+ {
217
+ id: 'widget:legal-notice',
218
+ inputs: {
219
+ instanceId: 'editorial:before:legal:1',
220
+ title: 'Uso de dados',
221
+ contentFormat: 'plain',
222
+ content: 'Ao participar, voce reconhece a politica institucional aplicavel.',
223
+ severity: 'info',
224
+ },
225
+ },
226
+ ],
227
+ formBlocksBeforeActions: [
228
+ {
229
+ id: 'form:user-context-summary',
230
+ inputs: {
231
+ instanceId: 'editorial:before-actions:user-context:1',
232
+ title: 'Conta atual',
233
+ source: 'context',
234
+ context: '${accountContext}',
235
+ fields: [
236
+ { label: 'Nome', valuePath: 'user.name', fallback: '-' },
237
+ { label: 'E-mail', valuePath: 'user.email', fallback: '-' },
238
+ ],
239
+ },
240
+ },
241
+ ],
242
+ formBlocksAfter: [
243
+ {
244
+ id: 'widget:footer-links',
245
+ inputs: {
246
+ instanceId: 'editorial:after:footer-links:1',
247
+ brandText: 'Praxis',
248
+ secondaryText: 'Todos os direitos reservados.',
249
+ links: [
250
+ { label: 'Docs', href: '/components/dynamic-form/docs/overview' },
251
+ { label: 'API', href: '/components/dynamic-form/api' },
252
+ ],
253
+ },
254
+ },
255
+ ],
256
+ sections: [
257
+ {
258
+ id: 'registration',
259
+ title: 'Dados da inscricao',
260
+ rows: [
261
+ {
262
+ columns: [
263
+ { fields: ['fullName'] },
264
+ { fields: ['workEmail'] },
265
+ ],
266
+ },
267
+ ],
268
+ },
269
+ ],
270
+ fieldMetadata: [
271
+ { name: 'fullName', label: 'Nome completo', controlType: 'input', required: true },
272
+ { name: 'workEmail', label: 'E-mail corporativo', controlType: 'email', required: true },
273
+ ],
274
+ };
275
+ ```
276
+
277
+ Uso no host:
278
+
279
+ ```html
280
+ <praxis-dynamic-form
281
+ [config]="formConfig"
282
+ [editorialContext]="{ accountName: 'Helena Costa', accountRole: 'Host override' }"
283
+ (widgetEvent)="onWidgetEvent($event)"
284
+ ></praxis-dynamic-form>
285
+ ```
286
+
287
+ Notas:
288
+ - `formBlocksBefore`, `formBlocksBeforeActions` e `formBlocksAfter` nao entram em `formData`.
289
+ - `widgetEvent` reemite eventos dos widgets hospedados com `placement` (`before`, `beforeActions` ou `after`).
290
+ - `editorialContext` deve ser tratado como imutavel; mutacoes in-place nao invalidam o cache do host.
291
+ - A surface editorial ja suporta widgets reais compartilhados para hero, rich text, legal notice, user context summary e footer links.
292
+ - `formBlocksBeforeActions` renderiza depois das secoes e antes da area principal de acoes, sendo o slot recomendado para blocos contextuais como `form:user-context-summary`.
293
+ - `formBlocksAfter` permanece como slot de fechamento e continua renderizando depois do formulario inteiro, incluindo os CTAs.
294
+
156
295
  See public exports: `projects/praxis-dynamic-form/src/public-api.ts`.
157
296
 
158
297
  ## Documentacao Tecnica da Lib