@praxisui/dynamic-form 8.0.0-beta.1 → 8.0.0-beta.12

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
  ],
@@ -316,6 +325,19 @@ export class FormEditorLauncherComponent {
316
325
 
317
326
  Alternatively, when `enableCustomization` is true, `praxis-dynamic-form` renders a gear button that opens the editor internally.
318
327
 
328
+ ## Agentic Authoring & Manifest
329
+
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.
331
+
332
+ - **Manifest:** `PRAXIS_DYNAMIC_FORM_AUTHORING_MANIFEST`
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.
337
+ - **Round-trip:** Preserves editor state and ensures that AI-generated patches are compatible with the visual editor.
338
+
339
+ For more details on authoring manifests, see `docs/ai/agentic-authoring/component-authoring-contracts/README.md`.
340
+
319
341
  ## API Surface
320
342
 
321
343
  - Components: `PraxisDynamicForm`, `PraxisDynamicFormConfigEditor`, `JsonConfigEditorComponent`, `LayoutEditorComponent`
@@ -419,8 +441,16 @@ const formConfig: FormConfig = {
419
441
  rows: [
420
442
  {
421
443
  columns: [
422
- { fields: ['fullName'] },
423
- { 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
+ },
424
454
  ],
425
455
  },
426
456
  ],
@@ -452,10 +482,62 @@ Notas:
452
482
 
453
483
  See public exports: `projects/praxis-dynamic-form/src/public-api.ts`.
454
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
+
455
536
  ## Documentacao Tecnica da Lib
456
537
 
457
538
  - `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.json-api.md`
458
539
  - `projects/praxis-dynamic-form/docs/hot-metadata-updates.md`
540
+ - `projects/praxis-dynamic-form/docs/layout-items-visual-blocks.md`
459
541
 
460
542
  ## Header de seção com avatar dinâmico
461
543
 
@@ -665,14 +747,14 @@ Cobertura ja estabilizada:
665
747
  - `JSON` com edicao real e bloqueio de payload invalido
666
748
  - `Hooks`
667
749
  - `Acoes` (`Botoes Padrao` e `Layout`)
668
- - `Acoes` customizadas profundas (`showAlert` simples e estruturado)
750
+ - `Acoes` customizadas profundas (`dialog.alert` com `globalAction` simples e estruturado)
669
751
  - `Comportamento`
670
752
  - `Mensagens`
671
753
  - `Dicas e Tooltips`
672
754
 
673
755
  Ajuste tecnico aplicado durante essa fase:
674
756
  - [praxis-dynamic-form-config-editor.ts](/mnt/d/Developer/praxis-plataform/praxis-ui-angular/projects/praxis-dynamic-form/src/lib/config-editor/praxis-dynamic-form-config-editor.ts) agora chama `this.jsonEditor?.updateJsonFromConfig(this.editedConfig)` em `onConfigChange(...)` para manter o editor JSON sincronizado com mudancas vindas de abas como `Hooks`.
675
- - [actions-editor.component.ts](/mnt/d/Developer/praxis-plataform/praxis-ui-angular/projects/praxis-dynamic-form/src/lib/actions-editor/actions-editor.component.ts) agora mescla catalogo legado + catalogo global do app para o editor de acoes customizadas.
757
+ - [actions-editor.component.ts](/mnt/d/Developer/praxis-plataform/praxis-ui-angular/projects/praxis-dynamic-form/src/lib/actions-editor/actions-editor.component.ts) agora usa o catalogo global canonico do app para o editor de acoes customizadas.
676
758
  - [actions-editor.component.ts](/mnt/d/Developer/praxis-plataform/praxis-ui-angular/projects/praxis-dynamic-form/src/lib/actions-editor/actions-editor.component.ts) agora preserva draft local dos campos globais e usa `track` estavel em `actions.custom`.
677
759
 
678
760
  Comando base usado para rerodar suites isoladas:
@@ -720,6 +802,7 @@ Apache-2.0 – see the `LICENSE` packaged with this library or the repository ro
720
802
  - Fluxo de Schema (ETag/304, schemaId, reconciliação): `projects/praxis-core/docs/schema-flow.md` (canônico) e `docs/schemas/fluxo-schema.md` (resumo operacional)
721
803
  - Guia de implementação e metadados da cascata: `docs/CASCADE-NATIVA.md`
722
804
  - Padrões de endpoints (Options vs Filter) para selects: `projects/praxis-dynamic-fields/docs/generic-crud-service.md` (canônico) e `docs/DEVS-GENERIC-CRUD-SERVICE.md` (resumo operacional)
805
+ - Recipe oficial de Entity Lookup corporativo com `RESOURCE_ENTITY`, `dependsOn`, `dependencyFilterMap`, reidratação por `by-ids` e política de seleção: `examples/ai-recipes/praxis-dynamic-form.entity-lookup-procurement.json`
723
806
 
724
807
  ## Verificação de Schema (ETag/If-None-Match)
725
808