@praxisui/dynamic-form 6.0.0-beta.0 → 8.0.0-beta.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 CHANGED
@@ -260,9 +260,9 @@ Alternatively, when `enableCustomization` is true, `praxis-dynamic-form` renders
260
260
  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`.
261
261
 
262
262
  Inputs relevantes:
263
- - `config.formBlocksBefore?: WidgetDefinition[]`
264
- - `config.formBlocksBeforeActions?: WidgetDefinition[]`
265
- - `config.formBlocksAfter?: WidgetDefinition[]`
263
+ - `config.formBlocksBefore?: RichContentDocument | null`
264
+ - `config.formBlocksBeforeActions?: RichContentDocument | null`
265
+ - `config.formBlocksAfter?: RichContentDocument | null`
266
266
  - `config.editorialContext?: Record<string, unknown>`
267
267
  - `[editorialContext]?: Record<string, unknown>`
268
268
 
@@ -293,68 +293,57 @@ const formConfig: FormConfig = {
293
293
  },
294
294
  },
295
295
  },
296
- formBlocksBefore: [
297
- {
298
- id: 'widget:hero-banner',
299
- inputs: {
300
- instanceId: 'editorial:before:hero:1',
296
+ formBlocksBefore: {
297
+ kind: 'praxis.rich-content',
298
+ version: '1.0.0',
299
+ nodes: [
300
+ {
301
+ type: 'mediaBlock',
301
302
  title: 'Praxis Summit 2026',
302
303
  subtitle: 'Inscricao institucional',
303
- description: 'Experiencia institucional com composicao editorial hospedada antes do formulario.',
304
- variant: 'event',
304
+ description:
305
+ 'Experiencia institucional com composicao editorial hospedada antes do formulario.',
306
+ icon: 'event',
305
307
  },
306
- },
307
- {
308
- id: 'widget:rich-text-block',
309
- inputs: {
310
- instanceId: 'editorial:before:rich-text:1',
311
- title: 'Antes de comecar',
312
- subtitle: 'Contexto editorial',
313
- icon: 'info',
314
- contentFormat: 'markdown',
315
- content: 'Confirme os dados abaixo antes do envio e consulte a [documentacao](https://example.com/docs) se precisar de suporte.',
316
- },
317
- },
318
- {
319
- id: 'widget:legal-notice',
320
- inputs: {
321
- instanceId: 'editorial:before:legal:1',
322
- title: 'Uso de dados',
323
- contentFormat: 'plain',
324
- content: 'Ao participar, voce reconhece a politica institucional aplicavel.',
325
- severity: 'info',
308
+ {
309
+ type: 'card',
310
+ content: [
311
+ { type: 'text', text: 'Antes de comecar', variant: 'title' },
312
+ {
313
+ type: 'text',
314
+ text: 'Confirme os dados abaixo antes do envio e consulte a documentacao se precisar de suporte.',
315
+ },
316
+ ],
326
317
  },
327
- },
328
- ],
329
- formBlocksBeforeActions: [
330
- {
331
- id: 'form:user-context-summary',
332
- inputs: {
333
- instanceId: 'editorial:before-actions:user-context:1',
334
- title: 'Conta atual',
335
- source: 'context',
336
- context: '${accountContext}',
337
- fields: [
338
- { label: 'Nome', valuePath: 'user.name', fallback: '-' },
339
- { label: 'E-mail', valuePath: 'user.email', fallback: '-' },
318
+ ],
319
+ },
320
+ formBlocksBeforeActions: {
321
+ kind: 'praxis.rich-content',
322
+ version: '1.0.0',
323
+ nodes: [
324
+ {
325
+ type: 'card',
326
+ content: [
327
+ { type: 'text', text: 'Conta atual', variant: 'title' },
328
+ { type: 'text', textExpr: '${accountContext.user.name}' },
329
+ { type: 'text', textExpr: '${accountContext.user.email}' },
340
330
  ],
341
331
  },
342
- },
343
- ],
344
- formBlocksAfter: [
345
- {
346
- id: 'widget:footer-links',
347
- inputs: {
348
- instanceId: 'editorial:after:footer-links:1',
349
- brandText: 'Praxis',
350
- secondaryText: 'Todos os direitos reservados.',
351
- links: [
352
- { label: 'Docs', href: '/components/dynamic-form/docs/overview' },
353
- { label: 'API', href: '/components/dynamic-form/api' },
332
+ ],
333
+ },
334
+ formBlocksAfter: {
335
+ kind: 'praxis.rich-content',
336
+ version: '1.0.0',
337
+ nodes: [
338
+ {
339
+ type: 'card',
340
+ content: [
341
+ { type: 'text', text: 'Praxis', variant: 'title' },
342
+ { type: 'text', text: 'Todos os direitos reservados.' },
354
343
  ],
355
344
  },
356
- },
357
- ],
345
+ ],
346
+ },
358
347
  sections: [
359
348
  {
360
349
  id: 'registration',
@@ -382,15 +371,13 @@ Uso no host:
382
371
  <praxis-dynamic-form
383
372
  [config]="formConfig"
384
373
  [editorialContext]="{ accountName: 'Helena Costa', accountRole: 'Host override' }"
385
- (widgetEvent)="onWidgetEvent($event)"
386
374
  ></praxis-dynamic-form>
387
375
  ```
388
376
 
389
377
  Notas:
390
378
  - `formBlocksBefore`, `formBlocksBeforeActions` e `formBlocksAfter` nao entram em `formData`.
391
- - `widgetEvent` reemite eventos dos widgets hospedados com `placement` (`before`, `beforeActions` ou `after`).
392
379
  - `editorialContext` deve ser tratado como imutavel; mutacoes in-place nao invalidam o cache do host.
393
- - A surface editorial ja suporta widgets reais compartilhados para hero, rich text, legal notice, user context summary e footer links.
380
+ - A surface editorial agora usa `RichContentDocument`, delegando os nodes para `@praxisui/rich-content`.
394
381
  - `formBlocksBeforeActions` renderiza depois das secoes e antes da area principal de acoes, sendo o slot recomendado para blocos contextuais como `form:user-context-summary`.
395
382
  - `formBlocksAfter` permanece como slot de fechamento e continua renderizando depois do formulario inteiro, incluindo os CTAs.
396
383
  - secoes agora suportam `appearance` (`card|plain|step`) e `stepLabel` para cabecalhos mais estruturados.