@praxisui/dynamic-form 8.0.0-beta.11 → 8.0.0-beta.13

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
@@ -70,10 +70,11 @@ Peer dependencies (Angular v20):
70
70
  - `@angular/core` `^20.0.0`
71
71
  - `@angular/common` `^20.0.0`
72
72
  - `@angular/cdk` `^20.0.0`
73
- - `@praxisui/core` `^0.0.1`
74
- - `@praxisui/visual-builder` `^0.0.1`
75
- - `@praxisui/settings-panel` `^0.0.1`
76
- - `@praxisui/cron-builder` `^0.0.1`
73
+ - `@praxisui/core` `^8.0.0-beta.12`
74
+ - `@praxisui/rich-content` `^8.0.0-beta.10`
75
+ - `@praxisui/visual-builder` `^8.0.0-beta.10`
76
+ - `@praxisui/settings-panel` `^8.0.0-beta.10`
77
+ - `@praxisui/cron-builder` `^8.0.0-beta.10`
77
78
 
78
79
  ## Quick Start
79
80
 
@@ -112,8 +113,16 @@ export class FormDemoComponent {
112
113
  rows: [
113
114
  {
114
115
  columns: [
115
- { id: 'col-fullName', fields: ['fullName'] },
116
- { id: 'col-email', fields: ['email'] },
116
+ {
117
+ id: 'col-fullName',
118
+ items: [{ kind: 'field', id: 'field-fullName', fieldName: 'fullName' }],
119
+ fields: ['fullName'],
120
+ },
121
+ {
122
+ id: 'col-email',
123
+ items: [{ kind: 'field', id: 'field-email', fieldName: 'email' }],
124
+ fields: ['email'],
125
+ },
117
126
  ],
118
127
  },
119
128
  ],
@@ -321,10 +330,10 @@ Alternatively, when `enableCustomization` is true, `praxis-dynamic-form` renders
321
330
  `praxis-dynamic-form` supports executable authoring contracts through the `ComponentAuthoringManifest`. This allows AI agents to perform structured, safe, and deterministic edits to the form configuration.
322
331
 
323
332
  - **Manifest:** `PRAXIS_DYNAMIC_FORM_AUTHORING_MANIFEST`
324
- - **Editable targets:** 10 target kinds: `field`, `section`, `row`, `column`, `formAction`, `formRule`, `message`, `layoutPlacement`, `localField`, `schemaBackedField`.
325
- - **Operations:** Supports 22 operations covering field property updates, local field lifecycle, layout manipulation, rule management, and action configuration.
326
- - **Validation:** 19 deterministic validators ensure uniqueness of IDs, layout integrity, local/schema-backed separation, destructive confirmation, and editor round-trip preservation.
327
- - **Examples/evals:** 8 fixtures cover local transient fields, schema-backed relabeling, layout moves, visibility rules, unknown target rejection, destructive confirmation, and save/reopen without drift.
333
+ - **Editable targets:** `field`, `section`, `row`, `column`, `visualBlock`, `formAction`, `formRule`, `message`, `layoutPlacement`, `localField`, `schemaBackedField`.
334
+ - **Operations:** Covers field property updates, local field lifecycle, layout item manipulation, visual block authoring, rule management, and action configuration declared in `PRAXIS_DYNAMIC_FORM_AUTHORING_MANIFEST`.
335
+ - **Validation:** Deterministic validators cover ID uniqueness, layout integrity, rich content document validity, local/schema-backed separation, destructive confirmation, and editor round-trip preservation.
336
+ - **Examples/evals:** Fixtures cover local transient fields, schema-backed relabeling, layout moves, visual block add/move, visibility rules, unknown target rejection, destructive confirmation, and save/reopen without drift.
328
337
  - **Round-trip:** Preserves editor state and ensures that AI-generated patches are compatible with the visual editor.
329
338
 
330
339
  For more details on authoring manifests, see `docs/ai/agentic-authoring/component-authoring-contracts/README.md`.
@@ -432,8 +441,16 @@ const formConfig: FormConfig = {
432
441
  rows: [
433
442
  {
434
443
  columns: [
435
- { fields: ['fullName'] },
436
- { fields: ['workEmail'] },
444
+ {
445
+ id: 'registration-full-name',
446
+ items: [{ kind: 'field', id: 'field-fullName', fieldName: 'fullName' }],
447
+ fields: ['fullName'],
448
+ },
449
+ {
450
+ id: 'registration-work-email',
451
+ items: [{ kind: 'field', id: 'field-workEmail', fieldName: 'workEmail' }],
452
+ fields: ['workEmail'],
453
+ },
437
454
  ],
438
455
  },
439
456
  ],
@@ -465,10 +482,62 @@ Notas:
465
482
 
466
483
  See public exports: `projects/praxis-dynamic-form/src/public-api.ts`.
467
484
 
485
+ ## Blocos visuais em colunas
486
+
487
+ O layout de coluna usa `sections[].rows[].columns[].items[]` como contrato
488
+ canônico ordenado. Itens `kind: 'field'` referenciam
489
+ `fieldMetadata[].name`; itens `kind: 'richContent'` hospedam um
490
+ `RichContentDocument` dentro da coluna e não entram em `fieldMetadata`,
491
+ `formData` ou payload HTTP.
492
+
493
+ `sections[].rows[].columns[].fields[]` permanece aceito como entrada de
494
+ migração e como projeção derivada dos itens `kind: 'field'`, mas não deve ser
495
+ usado para criar blocos visuais.
496
+
497
+ No editor visual, **Campos da API** lista apenas campos existentes em
498
+ `fieldMetadata[]` que ainda não aparecem em `columns[].items[]` como
499
+ `kind: 'field'`. Ao adicionar um campo, o editor reinsere o item em `items[]`
500
+ e mantém `fields[]` sincronizado como projeção; `fieldMetadata[]` não é
501
+ alterado.
502
+
503
+ **Adicionar bloco visual** oferece presets internos como texto, aviso,
504
+ separador e card informativo. Esses presets são apenas atalhos de authoring que
505
+ geram documentos `praxis.rich-content` válidos para itens `kind: 'richContent'`;
506
+ eles não criam novo `kind`, não criam `FieldMetadata` e não participam do
507
+ payload de submit.
508
+
509
+ Exemplo mínimo de uma coluna com campo, bloco visual e projeção `fields[]`:
510
+
511
+ ```json
512
+ {
513
+ "items": [
514
+ {
515
+ "kind": "richContent",
516
+ "id": "identity-guidance-block",
517
+ "document": {
518
+ "schemaVersion": 1,
519
+ "nodes": [
520
+ {
521
+ "type": "paragraph",
522
+ "text": "Revise os dados principais antes de salvar."
523
+ }
524
+ ]
525
+ }
526
+ },
527
+ { "kind": "field", "id": "field-nome", "fieldName": "nome" },
528
+ { "kind": "field", "id": "field-email", "fieldName": "email" }
529
+ ],
530
+ "fields": ["nome", "email"]
531
+ }
532
+ ```
533
+
534
+ Guia completo: `projects/praxis-dynamic-form/docs/layout-items-visual-blocks.md`.
535
+
468
536
  ## Documentacao Tecnica da Lib
469
537
 
470
538
  - `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.json-api.md`
471
539
  - `projects/praxis-dynamic-form/docs/hot-metadata-updates.md`
540
+ - `projects/praxis-dynamic-form/docs/layout-items-visual-blocks.md`
472
541
 
473
542
  ## Header de seção com avatar dinâmico
474
543