@praxisui/dynamic-form 1.0.0-beta.60 → 1.0.0-beta.62

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,19 +37,24 @@ 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
44
44
 
45
45
  > Standalone dynamic form component with schema-driven UI, native field cascades, settings integration, and a built-in configuration editor.
46
46
 
47
- ## 🔰 Exemplos / Quickstart
47
+ ## Documentation
48
48
 
49
- Para ver esta biblioteca em funcionamento em uma aplicação completa, utilize o projeto de exemplo (Quickstart):
49
+ - Official documentation: https://praxisui.dev
50
+ - Quickstart reference app: https://github.com/codexrodrigues/praxis-ui-quickstart
51
+ - Recommended for: schema-driven screens that need runtime forms, settings integration and contract-first metadata
50
52
 
51
- - Repositório: https://github.com/codexrodrigues/praxis-ui-quickstart
52
- - O Quickstart demonstra a integração das bibliotecas `@praxisui/*` em um app Angular, incluindo instalação, configuração e uso em telas reais.
53
+ ## When to use
54
+
55
+ - Build forms from metadata instead of hand-coding each screen
56
+ - Keep runtime editing and layout governance inside the host application
57
+ - Integrate with other `@praxisui/*` packages through shared contracts and settings flows
53
58
 
54
59
  ## Install
55
60
 
@@ -159,6 +164,7 @@ O `@praxisui/dynamic-form` agora aceita uma surface fundacional para hospedar bl
159
164
 
160
165
  Inputs relevantes:
161
166
  - `config.formBlocksBefore?: WidgetDefinition[]`
167
+ - `config.formBlocksBeforeActions?: WidgetDefinition[]`
162
168
  - `config.formBlocksAfter?: WidgetDefinition[]`
163
169
  - `config.editorialContext?: Record<string, unknown>`
164
170
  - `[editorialContext]?: Record<string, unknown>`
@@ -179,25 +185,76 @@ const formConfig: FormConfig = {
179
185
  editorialContext: {
180
186
  accountName: 'Helena Costa',
181
187
  accountRole: 'Gestora financeira',
188
+ accountContext: {
189
+ user: {
190
+ name: 'Helena Costa',
191
+ email: 'helena.costa@praxis.demo',
192
+ role: 'Gestora financeira',
193
+ },
194
+ tenant: {
195
+ name: 'Praxis Holding',
196
+ },
197
+ },
182
198
  },
183
199
  formBlocksBefore: [
184
200
  {
185
- id: 'praxis-wizard-content',
201
+ id: 'widget:hero-banner',
186
202
  inputs: {
187
- blockId: 'editorial:before:hero:1',
203
+ instanceId: 'editorial:before:hero:1',
188
204
  title: 'Praxis Summit 2026',
189
205
  subtitle: 'Inscricao institucional',
190
- text: 'Placeholder fundacional para hero/rich text enquanto os widgets editoriais definitivos ainda nao existem.',
206
+ description: 'Experiencia institucional com composicao editorial hospedada antes do formulario.',
207
+ variant: 'event',
208
+ },
209
+ },
210
+ {
211
+ id: 'widget:rich-text-block',
212
+ inputs: {
213
+ instanceId: 'editorial:before:rich-text:1',
214
+ title: 'Antes de comecar',
215
+ subtitle: 'Contexto editorial',
216
+ icon: 'info',
217
+ contentFormat: 'markdown',
218
+ content: 'Confirme os dados abaixo antes do envio e consulte a [documentacao](https://example.com/docs) se precisar de suporte.',
219
+ },
220
+ },
221
+ {
222
+ id: 'widget:legal-notice',
223
+ inputs: {
224
+ instanceId: 'editorial:before:legal:1',
225
+ title: 'Uso de dados',
226
+ contentFormat: 'plain',
227
+ content: 'Ao participar, voce reconhece a politica institucional aplicavel.',
228
+ severity: 'info',
229
+ },
230
+ },
231
+ ],
232
+ formBlocksBeforeActions: [
233
+ {
234
+ id: 'form:user-context-summary',
235
+ inputs: {
236
+ instanceId: 'editorial:before-actions:user-context:1',
237
+ title: 'Conta atual',
238
+ source: 'context',
239
+ context: '${accountContext}',
240
+ fields: [
241
+ { label: 'Nome', valuePath: 'user.name', fallback: '-' },
242
+ { label: 'E-mail', valuePath: 'user.email', fallback: '-' },
243
+ ],
191
244
  },
192
245
  },
193
246
  ],
194
247
  formBlocksAfter: [
195
248
  {
196
- id: 'praxis-wizard-inline-notice',
249
+ id: 'widget:footer-links',
197
250
  inputs: {
198
- blockId: 'editorial:after:legal:1',
199
- tone: 'info',
200
- text: 'Placeholder fundacional para legal-notice.',
251
+ instanceId: 'editorial:after:footer-links:1',
252
+ brandText: 'Praxis',
253
+ secondaryText: 'Todos os direitos reservados.',
254
+ links: [
255
+ { label: 'Docs', href: '/components/dynamic-form/docs/overview' },
256
+ { label: 'API', href: '/components/dynamic-form/api' },
257
+ ],
201
258
  },
202
259
  },
203
260
  ],
@@ -233,10 +290,13 @@ Uso no host:
233
290
  ```
234
291
 
235
292
  Notas:
236
- - `formBlocksBefore` e `formBlocksAfter` nao entram em `formData`.
237
- - `widgetEvent` reemite eventos dos widgets hospedados com `placement` (`before` ou `after`).
293
+ - `formBlocksBefore`, `formBlocksBeforeActions` e `formBlocksAfter` nao entram em `formData`.
294
+ - `widgetEvent` reemite eventos dos widgets hospedados com `placement` (`before`, `beforeActions` ou `after`).
238
295
  - `editorialContext` deve ser tratado como imutavel; mutacoes in-place nao invalidam o cache do host.
239
- - No ciclo fundacional, exemplos podem usar widgets existentes como placeholders visuais para hero, rich text, legal notice, user context summary e footer links.
296
+ - A surface editorial ja suporta widgets reais compartilhados para hero, rich text, legal notice, user context summary e footer links.
297
+ - `formBlocksBeforeActions` renderiza depois das secoes e antes da area principal de acoes, sendo o slot recomendado para blocos contextuais como `form:user-context-summary`.
298
+ - `formBlocksAfter` permanece como slot de fechamento e continua renderizando depois do formulario inteiro, incluindo os CTAs.
299
+ - secoes agora suportam `appearance` (`card|plain|step`) e `stepLabel` para cabecalhos mais estruturados.
240
300
 
241
301
  See public exports: `projects/praxis-dynamic-form/src/public-api.ts`.
242
302
 
@@ -262,7 +322,7 @@ Os paths micro são normalizados para `fieldMetadata[].<prop>` para garantir que
262
322
  - Semântica de limpeza: valores `null` em `properties/propertiesWhenFalse` removem o override e retornam ao valor base do layout; ausência mantém o valor base.
263
323
  - Whitelist por tipo (somente propriedades a seguir são aplicadas; demais são descartadas e logadas em dev):
264
324
  - `field`: `visible`, `required`, `readonly`, `disabled`, `className`, `style`, `label`, `description`, `placeholder`, `hint`, `tooltip`, `prefixIcon`, `suffixIcon`, `prefixText`, `suffixText`, `defaultValue`, `options` (array `{label,value,disabled?}`), `appearance` (`fill|outline`), `color` (`primary|accent|warn`), `floatLabel` (`auto|always|never`), `hintPosition` (`start|end`), `validators` (primitivos por chave).
265
- - `section`: `visible`, `title`, `description`, `icon`, `className`, `style`, `collapsible`, `collapsed`, `headerTooltip`, `headerAlign` (`start|center`), gaps (`gapBottom`, `titleGapBottom`, `descriptionGapBottom`), cores/tipografia (`titleColor`, `descriptionColor`, `titleStyle`, `descriptionStyle`).
325
+ - `section`: `visible`, `title`, `description`, `icon`, `className`, `style`, `collapsible`, `collapsed`, `headerTooltip`, `headerAlign` (`start|center`), `appearance` (`card|plain|step`), `stepLabel`, gaps (`gapBottom`, `titleGapBottom`, `descriptionGapBottom`), cores/tipografia (`titleColor`, `descriptionColor`, `titleStyle`, `descriptionStyle`).
266
326
  - `action`: `visible`, `disabled`, `loading`, `label`, `icon`, `tooltip`, `color` (`primary|accent|warn|basic`), `variant` (`raised|stroked|flat|fab`), `size` (`small|medium|large`), `className`, `style`.
267
327
  - `row`: `visible`, `gap`, `rowGap`, `className`, `style`.
268
328
  - `column`: `visible`, `span`, `offset`, `order`, `hidden`, `align` (`start|center|end|stretch`), `padding`, `className`, `style`.
@@ -387,6 +447,49 @@ Ou por seção, via metadado `titleGapBottom` (em pixels), que aplica inline som
387
447
  - `@praxisui/dynamic-form` `0.0.x` → Angular `20.x`
388
448
  - Module format: `ESM2022`
389
449
 
450
+ ## Crash Recovery Checkpoint
451
+
452
+ Estado registrado em `2026-03-15` para retomada rapida do trabalho de E2E do editor `/form-config-editor`.
453
+
454
+ Suites Playwright ja adicionadas e validadas:
455
+ - `projects/praxis-dynamic-form/test-dev/e2e/form-config-editor-smoke.playwright.spec.ts`
456
+ - `projects/praxis-dynamic-form/test-dev/e2e/form-config-editor-layout.playwright.spec.ts`
457
+ - `projects/praxis-dynamic-form/test-dev/e2e/form-config-editor-rules.playwright.spec.ts`
458
+ - `projects/praxis-dynamic-form/test-dev/e2e/form-config-editor-cascades.playwright.spec.ts`
459
+ - `projects/praxis-dynamic-form/test-dev/e2e/form-config-editor-json.playwright.spec.ts`
460
+ - `projects/praxis-dynamic-form/test-dev/e2e/form-config-editor-hooks.playwright.spec.ts`
461
+ - `projects/praxis-dynamic-form/test-dev/e2e/form-config-editor-actions.playwright.spec.ts`
462
+ - `projects/praxis-dynamic-form/test-dev/e2e/form-config-editor-actions-custom.playwright.spec.ts`
463
+
464
+ Cobertura ja estabilizada:
465
+ - smoke das tabs principais do editor integrado
466
+ - `Layout`
467
+ - `Regras`
468
+ - `Cascatas`
469
+ - `JSON` com edicao real e bloqueio de payload invalido
470
+ - `Hooks`
471
+ - `Acoes` (`Botoes Padrao` e `Layout`)
472
+ - `Acoes` customizadas profundas (`showAlert` simples e estruturado)
473
+ - `Comportamento`
474
+ - `Mensagens`
475
+ - `Dicas e Tooltips`
476
+
477
+ Ajuste tecnico aplicado durante essa fase:
478
+ - [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`.
479
+ - [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.
480
+ - [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`.
481
+
482
+ Comando base usado para rerodar suites isoladas:
483
+
484
+ ```bash
485
+ node ./node_modules/playwright/cli.js test --config tools/e2e/playwright/praxis-dynamic-form-config-editor.playwright.config.ts <spec>
486
+ ```
487
+
488
+ Se houver crash, retomar daqui:
489
+ 1. garantir que o app esteja no ar
490
+ 2. rerodar a ultima suite alterada
491
+ 3. proximo alvo pendente: consolidar a bateria completa ou seguir para outra area residual do editor
492
+
390
493
  ## License
391
494
 
392
495
  Apache-2.0 – see the `LICENSE` packaged with this library or the repository root.