@praxisui/dynamic-form 9.0.65 → 9.0.67
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 +28 -0
- package/ai/component-registry.json +24 -8
- package/docs/dynamic-form-authoring-document-semantics.md +18 -0
- package/fesm2022/praxisui-dynamic-form.mjs +209 -85
- package/package.json +8 -8
- package/src/lib/config-editor/praxis-dynamic-form-config-editor.json-api.md +17 -0
- package/src/lib/praxis-dynamic-form.json-api.md +20 -3
- package/types/praxisui-dynamic-form.d.ts +24 -4
package/README.md
CHANGED
|
@@ -438,6 +438,12 @@ Presentation formatting of field values is resolved by `@praxisui/dynamic-fields
|
|
|
438
438
|
|
|
439
439
|
### Compact Presentation Preset
|
|
440
440
|
|
|
441
|
+
For a detail form inside a widget card, use `sections[].appearance: "plain"`
|
|
442
|
+
to keep a single outer frame. Plain sections retain transparent backgrounds,
|
|
443
|
+
no shadow and no internal padding in field, presentation, compact and editorial
|
|
444
|
+
contexts. Card and step sections keep their own surfaces. Configure section
|
|
445
|
+
spacing and presentation density separately; explicit authored styles still apply.
|
|
446
|
+
|
|
441
447
|
For dense enterprise read-only screens, `DynamicFormLayoutService.generateFormConfigFromMetadata`
|
|
442
448
|
can materialize a compact presentation layout directly from governed field metadata:
|
|
443
449
|
|
|
@@ -562,3 +568,25 @@ Main exports:
|
|
|
562
568
|
- Keep backend schema fields server-backed; use local/transient metadata only for UI-owned state.
|
|
563
569
|
- Prefer explicit `schemaUrl + submitUrl + submitMethod` for backend-published surfaces and actions.
|
|
564
570
|
- Use the official documentation for full recipes on cascades, schema reconciliation, domain rules, action layout, and visual editor workflows.
|
|
571
|
+
|
|
572
|
+
### Modo de consulta no Page Builder
|
|
573
|
+
|
|
574
|
+
Ao conectar um formulário a um recurso e alterar somente `mode` para `view`, o editor preserva a ausência de configuração autorada. Assim, os campos continuam derivados do schema após salvar e reabrir a página. Uma configuração de formulário efetivamente editada continua sendo persistida.
|
|
575
|
+
|
|
576
|
+
`configPatchChange` publica um `inputPatch` parcial com `config`, `resourcePath`, `mode` e/ou `presentationModeGlobal`. Consumidores devem aplicar somente as propriedades presentes: a conexão rápida publica a rota sem fixar uma configuração de campos ainda vazia.
|
|
577
|
+
|
|
578
|
+
### Configurar a exibição inicial no Page Builder
|
|
579
|
+
|
|
580
|
+
Abra **Configurar conteúdo → Geral → Dados do formulário**. Para um detalhe de leitura, selecione **Modo de dados: view** e **Modo de exibição: Apresentação**. Salve o conteúdo e a página. **Campos de formulário** preserva controles de leitura; **Automático (seguir schema)** remove o override e respeita `layoutPolicy`. A preferência usa `bindings.presentationModeGlobal` no documento e o input homônimo no widget. Não é necessário criar uma ação rápida para iniciar em apresentação.
|
|
581
|
+
|
|
582
|
+
O botão criado em **Configurar widget → Ações rápidas (inputs)** continua sendo uma troca durante a interação. Para tipografia, densidade e alinhamento da apresentação em execução, use **Configurar formulário → Modo Apresentação**; esse editor persiste `contextSnapshot.presentation` separadamente da ativação.
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
### Presentation style projection and editor UX
|
|
586
|
+
|
|
587
|
+
- `contextSnapshot.presentation` is the canonical style snapshot. The optional runtime input `presentation: DynamicFormPresentationSnapshot | null` projects it into page widgets independently of schema-generated `config`. Explicit styles take precedence over stored style preferences; `null` restores defaults and blocks stale stored overrides; omission retains normal style resolution.
|
|
588
|
+
- Runtime editor Apply/Save emits `presentation` with `mode` and `presentationModeGlobal` in `configPatchChange.inputPatch`. Widget save/reopen preserves the same snapshot; omitting the document block clears the widget projection with `null`.
|
|
589
|
+
- Numeric font sizes and label widths are pixels. Capturing a runtime `rem` size converts it using the host root font size; opening and saving must not reinterpret `0.78rem` as `0.78px`.
|
|
590
|
+
- **Geral → Dados do formulário** separates **Criar / Editar / Visualizar** from **Automático / Campos / Apresentação**. Selecting presentation in Create/Edit keeps the operation unchanged and explains the inactive state with an explicit action to switch to View.
|
|
591
|
+
- **Estilo da apresentação** remains discoverable regardless of the current mode. It previews sample data and does not activate presentation by itself. Filter Form does not expose this tab because it has no presentation runtime.
|
|
592
|
+
- Applying or finishing widget editing updates the page draft. **Salvar página** persists the composition. Shortening sample text affects the preview only.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-09-
|
|
3
|
+
"generatedAt": "2026-09-07T00:54:55.301Z",
|
|
4
4
|
"packageName": "@praxisui/dynamic-form",
|
|
5
|
-
"packageVersion": "9.0.
|
|
5
|
+
"packageVersion": "9.0.67",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 2,
|
|
@@ -266,11 +266,17 @@
|
|
|
266
266
|
"required": false,
|
|
267
267
|
"description": "Trava global para desabilitar campos"
|
|
268
268
|
},
|
|
269
|
+
{
|
|
270
|
+
"name": "presentation",
|
|
271
|
+
"type": "DynamicFormPresentationSnapshot | null",
|
|
272
|
+
"required": false,
|
|
273
|
+
"description": "Projeção de contextSnapshot.presentation para hosts e Page Builder. Tamanhos em pixels; null remove ajustes explícitos. Não altera mode nem presentationModeGlobal."
|
|
274
|
+
},
|
|
269
275
|
{
|
|
270
276
|
"name": "presentationModeGlobal",
|
|
271
277
|
"type": "boolean | null",
|
|
272
278
|
"required": false,
|
|
273
|
-
"description": "
|
|
279
|
+
"description": "Preferência de exibição, também editável em Geral: true apresenta em view, false força campos, null segue layoutPolicy. Persiste em bindings.presentationModeGlobal."
|
|
274
280
|
},
|
|
275
281
|
{
|
|
276
282
|
"name": "fieldIconPolicy",
|
|
@@ -323,7 +329,7 @@
|
|
|
323
329
|
"name": "configPatchChange",
|
|
324
330
|
"type": "DynamicFormConfigPatchChangeEvent",
|
|
325
331
|
"required": false,
|
|
326
|
-
"description": "Emite inputPatch
|
|
332
|
+
"description": "Emite inputPatch parcial com config, resourcePath, mode, presentationModeGlobal e/ou presentation para hosts persistirem apenas as entradas autoradas presentes, incluindo conexao rapida, sem alterar o payload legado de configChange.",
|
|
327
333
|
"label": "Patch persistivel de configuracao"
|
|
328
334
|
},
|
|
329
335
|
{
|
|
@@ -6648,6 +6654,16 @@
|
|
|
6648
6654
|
],
|
|
6649
6655
|
"description": "Modo de operação"
|
|
6650
6656
|
},
|
|
6657
|
+
{
|
|
6658
|
+
"name": "presentation",
|
|
6659
|
+
"type": "DynamicFormPresentationSnapshot | null",
|
|
6660
|
+
"description": "Projeção de contextSnapshot.presentation para hosts e Page Builder. Tamanhos em pixels; null remove ajustes explícitos. Não altera mode nem presentationModeGlobal."
|
|
6661
|
+
},
|
|
6662
|
+
{
|
|
6663
|
+
"name": "presentationModeGlobal",
|
|
6664
|
+
"type": "boolean | null",
|
|
6665
|
+
"description": "Preferência de exibição, também authorada em bindings.presentationModeGlobal: true apresenta rótulos e valores somente em mode=view; false força campos; null/ausência segue layoutPolicy. Não altera o modo dos dados."
|
|
6666
|
+
},
|
|
6651
6667
|
{
|
|
6652
6668
|
"name": "configPersistenceStrategy",
|
|
6653
6669
|
"type": "string",
|
|
@@ -9184,9 +9200,9 @@
|
|
|
9184
9200
|
{
|
|
9185
9201
|
"chunkIndex": 0,
|
|
9186
9202
|
"chunkKind": "summary",
|
|
9187
|
-
"content": "Component ID: praxis-dynamic-form\nSelector: praxis-dynamic-form\nFriendly Name: Praxis Dynamic Form\nDescription: Formulario dinamico com layout por secoes/linhas/colunas e campos renderizados por metadados.\nCategory: form\nLib/Package: @praxisui/dynamic-form\nTags: widget, form, configurable, hasWizard, stable\nInputs:\n - resourcePath (string)\n - resourceId (string | number | null)\n - initialValue (Record<string, unknown> | null)\n - emptyState (PraxisDynamicFormEmptyState | null)\n - editorialContext (Record<string, unknown> | null)\n - mode ('create' | 'edit' | 'view')\n - config (FormConfig)\n - actions (FormConfig['actions'] | null)\n - schemaSource ('resource' | 'filter')\n - schemaUrl (string | null)\n - readUrl (string | null)\n - apiEndpointKey (ApiEndpoint | string | null)\n - apiUrlEntry (ApiUrlEntry | null)\n - submitUrl (string | null)\n - submitMethod ('post' | 'put' | 'patch' | null)\n - submitIdempotencyKey (string | null)\n - submitCorrelationId (string | null)\n - submitResourceVersion (string | number | null)\n - submitResourceVersionTargetResourceKey (string | null)\n - submitResourceVersionTargetIdField (string | null)\n - responseSchemaUrl (string | null)\n - enableCustomization (boolean)\n - showAiAssistant (boolean)\n - formId (string)\n - componentInstanceId (string)\n - configPersistenceStrategy ('local-first' | 'input-first')\n - layout (FormLayout)\n - generatedLayoutPreset ('default' | 'compactPresentation')\n - layoutPolicy (DynamicFormLayoutPolicy | null)\n - backConfig (BackConfig)\n - hooks (FormHooksLayout)\n - removeEmptyContainersOnSave (boolean)\n - reactiveValidation (boolean | null)\n - reactiveValidationDebounceMs (number | null)\n - notifyIfOutdated ('inline' | 'snackbar' | 'both' | 'none')\n - snoozeMs (number)\n - autoOpenSettingsOnOutdated (boolean)\n - readonlyModeGlobal (boolean | null)\n - disabledModeGlobal (boolean | null)\n - presentationModeGlobal (boolean | null)\n - fieldIconPolicy ('all' | 'presentation-only' | 'none')\n - visibleGlobal (boolean | null)\n - customEndpoints (EndpointConfig)\nOutputs:\n - formSubmit (FormSubmitEvent)\n - formCancel (void)\n - formReset (void)\n - configChange (FormConfig)\n - configPatchChange (DynamicFormConfigPatchChangeEvent)\n - formReady (FormReadyEvent)\n - valueChange (FormValueChangeEvent)\n - payloadPreviewChange (FormPayloadPreviewEvent)\n - syncCompleted (SyncResult)\n - initializationError (FormInitializationError)\n - enableCustomizationChange (boolean)\n - customAction (FormCustomActionEvent)\n - actionConfirmation (FormActionConfirmationEvent)\n - schemaStatusChange ({ outdated: boolean; serverHash?: string; lastVerifiedAt?: string; formId?: string })\n - reactiveDeterminationExecuted (ReactiveDeterminationExecutionEvent)\n - reactiveDeterminationPendingChange (boolean)\n",
|
|
9203
|
+
"content": "Component ID: praxis-dynamic-form\nSelector: praxis-dynamic-form\nFriendly Name: Praxis Dynamic Form\nDescription: Formulario dinamico com layout por secoes/linhas/colunas e campos renderizados por metadados.\nCategory: form\nLib/Package: @praxisui/dynamic-form\nTags: widget, form, configurable, hasWizard, stable\nInputs:\n - resourcePath (string)\n - resourceId (string | number | null)\n - initialValue (Record<string, unknown> | null)\n - emptyState (PraxisDynamicFormEmptyState | null)\n - editorialContext (Record<string, unknown> | null)\n - mode ('create' | 'edit' | 'view')\n - config (FormConfig)\n - actions (FormConfig['actions'] | null)\n - schemaSource ('resource' | 'filter')\n - schemaUrl (string | null)\n - readUrl (string | null)\n - apiEndpointKey (ApiEndpoint | string | null)\n - apiUrlEntry (ApiUrlEntry | null)\n - submitUrl (string | null)\n - submitMethod ('post' | 'put' | 'patch' | null)\n - submitIdempotencyKey (string | null)\n - submitCorrelationId (string | null)\n - submitResourceVersion (string | number | null)\n - submitResourceVersionTargetResourceKey (string | null)\n - submitResourceVersionTargetIdField (string | null)\n - responseSchemaUrl (string | null)\n - enableCustomization (boolean)\n - showAiAssistant (boolean)\n - formId (string)\n - componentInstanceId (string)\n - configPersistenceStrategy ('local-first' | 'input-first')\n - layout (FormLayout)\n - generatedLayoutPreset ('default' | 'compactPresentation')\n - layoutPolicy (DynamicFormLayoutPolicy | null)\n - backConfig (BackConfig)\n - hooks (FormHooksLayout)\n - removeEmptyContainersOnSave (boolean)\n - reactiveValidation (boolean | null)\n - reactiveValidationDebounceMs (number | null)\n - notifyIfOutdated ('inline' | 'snackbar' | 'both' | 'none')\n - snoozeMs (number)\n - autoOpenSettingsOnOutdated (boolean)\n - readonlyModeGlobal (boolean | null)\n - disabledModeGlobal (boolean | null)\n - presentation (DynamicFormPresentationSnapshot | null)\n - presentationModeGlobal (boolean | null)\n - fieldIconPolicy ('all' | 'presentation-only' | 'none')\n - visibleGlobal (boolean | null)\n - customEndpoints (EndpointConfig)\nOutputs:\n - formSubmit (FormSubmitEvent)\n - formCancel (void)\n - formReset (void)\n - configChange (FormConfig)\n - configPatchChange (DynamicFormConfigPatchChangeEvent)\n - formReady (FormReadyEvent)\n - valueChange (FormValueChangeEvent)\n - payloadPreviewChange (FormPayloadPreviewEvent)\n - syncCompleted (SyncResult)\n - initializationError (FormInitializationError)\n - enableCustomizationChange (boolean)\n - customAction (FormCustomActionEvent)\n - actionConfirmation (FormActionConfirmationEvent)\n - schemaStatusChange ({ outdated: boolean; serverHash?: string; lastVerifiedAt?: string; formId?: string })\n - reactiveDeterminationExecuted (ReactiveDeterminationExecutionEvent)\n - reactiveDeterminationPendingChange (boolean)\n",
|
|
9188
9204
|
"sourcePointer": "projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.metadata.ts",
|
|
9189
|
-
"contentHash": "
|
|
9205
|
+
"contentHash": "57063c838a09c8c0eedf363c56552f772223f3ed3159b0cf265f4f88f5a5214d",
|
|
9190
9206
|
"sourceKind": "component_definition",
|
|
9191
9207
|
"sourceId": "praxis-dynamic-form",
|
|
9192
9208
|
"corpusVersion": "1.0.0"
|
|
@@ -9604,9 +9620,9 @@
|
|
|
9604
9620
|
{
|
|
9605
9621
|
"chunkIndex": 42,
|
|
9606
9622
|
"chunkKind": "authoring_manifest",
|
|
9607
|
-
"content": "{\"schemaVersion\":\"1.0.0\",\"manifestVersion\":\"1.5.4\",\"componentId\":\"praxis-dynamic-form\",\"ownerPackage\":\"@praxisui/dynamic-form\",\"configSchemaId\":\"FormConfig\",\"chunkSection\":\"runtimeInputs\",\"runtimeInputs\":[{\"name\":\"showAiAssistant\",\"type\":\"boolean\",\"description\":\"Mostra os gatilhos do copiloto semantico Praxis\"},{\"name\":\"config\",\"type\":\"FormConfig\",\"description\":\"Configuração do formulário; sections é opcional em forms schema-driven e não deve ser criado como array vazio apenas para satisfazer TypeScript.\"},{\"name\":\"actions\",\"type\":\"FormConfig['actions'] | null\",\"description\":\"Overrides de apresentação da barra de ações fornecidos pelo host sem substituir o contrato HTTP da surface.\"},{\"name\":\"formId\",\"type\":\"string\",\"description\":\"Identidade estável usada pelo runtime para persistência local da configuração.\"},{\"name\":\"resourcePath\",\"type\":\"string\",\"description\":\"Caminho do recurso (API)\"},{\"name\":\"resourceId\",\"type\":\"string | number | null\",\"description\":\"Identidade canônica do registro carregado em modos edit e view.\"},{\"name\":\"emptyState\",\"type\":\"PraxisDynamicFormEmptyState\",\"description\":\"Placeholder opt-in para mode=view sem resourceId nem snapshot local; reutiliza o empty state compartilhado e mantém a mensagem de negócio no plano/host.\"},{\"name\":\"readUrl\",\"type\":\"string\",\"description\":\"Endpoint canonico de leitura para surfaces VIEW/READ_PROJECTION\"},{\"name\":\"mode\",\"type\":\"string\",\"allowedValues\":[\"create\",\"edit\",\"view\"],\"description\":\"Modo de operação\"},{\"name\":\"configPersistenceStrategy\",\"type\":\"string\",\"allowedValues\":[\"local-first\",\"input-first\"],\"description\":\"Precedência entre configuração persistida e contrato explícito do host. Use input-first em dialogs e surfaces transitórias governadas por schema para preservar mode e estados operacionais publicados pelo servidor.\"},{\"name\":\"generatedLayoutPreset\",\"type\":\"string\",\"allowedValues\":[\"default\",\"compactPresentation\"],\"description\":\"Preset usado apenas ao gerar a configuracao inicial a partir de metadata/schema; nao reprocessa layouts persistidos ou autorados.\"},{\"name\":\"layoutPolicy\",\"type\":\"DynamicFormLayoutPolicy\",\"description\":\"Politica opt-in para layout schema-driven transient. Use source=schema apenas quando o backend schema for a fonte canonica do agrupamento; use detailSummary para seleção de campos e densidade responsiva do resumo read-only compacto sem FormConfig.sections locais. Quando o resumo precisar vencer x-ui.width publicado para outras surfaces, use detailSummary.widthPrecedence=summary. Em groupedCommand, orphanFieldExpansion governa linhas lógicas com um unico campo; partialRowStrategy=fill-compatible projeta spans compatíveis depois de resolver visibilidade responsiva, CSS order e wrap, sem alterar x-ui.width ou persistir sections; contextFields identifica campos do request hidratados pela surface que permanecem no payload sem criar controles redundantes.\"},{\"name\":\"fieldIconPolicy\",\"type\":\"string\",\"allowedValues\":[\"all\",\"presentation-only\",\"none\"],\"description\":\"Politica visual do host para icones prefix/suffix de campos vindos da metadata. Use presentation-only para manter icones decorativos em apresentacao e ocultar em controles tradicionais.\"},{\"name\":\"enableCustomization\",\"type\":\"boolean\",\"description\":\"Habilita edição visual\"}]}",
|
|
9623
|
+
"content": "{\"schemaVersion\":\"1.0.0\",\"manifestVersion\":\"1.5.4\",\"componentId\":\"praxis-dynamic-form\",\"ownerPackage\":\"@praxisui/dynamic-form\",\"configSchemaId\":\"FormConfig\",\"chunkSection\":\"runtimeInputs\",\"runtimeInputs\":[{\"name\":\"showAiAssistant\",\"type\":\"boolean\",\"description\":\"Mostra os gatilhos do copiloto semantico Praxis\"},{\"name\":\"config\",\"type\":\"FormConfig\",\"description\":\"Configuração do formulário; sections é opcional em forms schema-driven e não deve ser criado como array vazio apenas para satisfazer TypeScript.\"},{\"name\":\"actions\",\"type\":\"FormConfig['actions'] | null\",\"description\":\"Overrides de apresentação da barra de ações fornecidos pelo host sem substituir o contrato HTTP da surface.\"},{\"name\":\"formId\",\"type\":\"string\",\"description\":\"Identidade estável usada pelo runtime para persistência local da configuração.\"},{\"name\":\"resourcePath\",\"type\":\"string\",\"description\":\"Caminho do recurso (API)\"},{\"name\":\"resourceId\",\"type\":\"string | number | null\",\"description\":\"Identidade canônica do registro carregado em modos edit e view.\"},{\"name\":\"emptyState\",\"type\":\"PraxisDynamicFormEmptyState\",\"description\":\"Placeholder opt-in para mode=view sem resourceId nem snapshot local; reutiliza o empty state compartilhado e mantém a mensagem de negócio no plano/host.\"},{\"name\":\"readUrl\",\"type\":\"string\",\"description\":\"Endpoint canonico de leitura para surfaces VIEW/READ_PROJECTION\"},{\"name\":\"mode\",\"type\":\"string\",\"allowedValues\":[\"create\",\"edit\",\"view\"],\"description\":\"Modo de operação\"},{\"name\":\"presentation\",\"type\":\"DynamicFormPresentationSnapshot | null\",\"description\":\"Projeção de contextSnapshot.presentation para hosts e Page Builder. Tamanhos em pixels; null remove ajustes explícitos. Não altera mode nem presentationModeGlobal.\"},{\"name\":\"presentationModeGlobal\",\"type\":\"boolean | null\",\"description\":\"Preferência de exibição, também authorada em bindings.presentationModeGlobal: true apresenta rótulos e valores somente em mode=view; false força campos; null/ausência segue layoutPolicy. Não altera o modo dos dados.\"},{\"name\":\"configPersistenceStrategy\",\"type\":\"string\",\"allowedValues\":[\"local-first\",\"input-first\"],\"description\":\"Precedência entre configuração persistida e contrato explícito do host. Use input-first em dialogs e surfaces transitórias governadas por schema para preservar mode e estados operacionais publicados pelo servidor.\"},{\"name\":\"generatedLayoutPreset\",\"type\":\"string\",\"allowedValues\":[\"default\",\"compactPresentation\"],\"description\":\"Preset usado apenas ao gerar a configuracao inicial a partir de metadata/schema; nao reprocessa layouts persistidos ou autorados.\"},{\"name\":\"layoutPolicy\",\"type\":\"DynamicFormLayoutPolicy\",\"description\":\"Politica opt-in para layout schema-driven transient. Use source=schema apenas quando o backend schema for a fonte canonica do agrupamento; use detailSummary para seleção de campos e densidade responsiva do resumo read-only compacto sem FormConfig.sections locais. Quando o resumo precisar vencer x-ui.width publicado para outras surfaces, use detailSummary.widthPrecedence=summary. Em groupedCommand, orphanFieldExpansion governa linhas lógicas com um unico campo; partialRowStrategy=fill-compatible projeta spans compatíveis depois de resolver visibilidade responsiva, CSS order e wrap, sem alterar x-ui.width ou persistir sections; contextFields identifica campos do request hidratados pela surface que permanecem no payload sem criar controles redundantes.\"},{\"name\":\"fieldIconPolicy\",\"type\":\"string\",\"allowedValues\":[\"all\",\"presentation-only\",\"none\"],\"description\":\"Politica visual do host para icones prefix/suffix de campos vindos da metadata. Use presentation-only para manter icones decorativos em apresentacao e ocultar em controles tradicionais.\"},{\"name\":\"enableCustomization\",\"type\":\"boolean\",\"description\":\"Habilita edição visual\"}]}",
|
|
9608
9624
|
"sourcePointer": "projects/praxis-dynamic-form/src/lib/ai/praxis-dynamic-form-authoring-manifest.ts",
|
|
9609
|
-
"contentHash": "
|
|
9625
|
+
"contentHash": "e7860094c6eee151ca66581a5fbb44d907d03a604cbc85e50789f38505ca6064",
|
|
9610
9626
|
"sourceKind": "component_definition",
|
|
9611
9627
|
"sourceId": "praxis-dynamic-form",
|
|
9612
9628
|
"corpusVersion": "1.0.0"
|
|
@@ -102,3 +102,21 @@ Guardrail permanente:
|
|
|
102
102
|
|
|
103
103
|
Em fase beta, não vamos deixar legado para trás sem migração, mas também não
|
|
104
104
|
vamos manter legado como contrato paralelo permanente.
|
|
105
|
+
|
|
106
|
+
## Preferência inicial de apresentação
|
|
107
|
+
|
|
108
|
+
`bindings.presentationModeGlobal?: boolean | null` materializa no documento o input já existente do Dynamic Form. `true` solicita apresentação em `view`, `false` força campos e `null`/ausência herda `layoutPolicy`. A apresentação não altera `mode`; `create` e `edit` continuam permitindo preenchimento.
|
|
109
|
+
|
|
110
|
+
O editor Geral oferece ambas as escolhas. O wrapper do Page Builder publica a preferência nos inputs do widget sem persistir uma projeção de schema vazia. O editor aberto pelo runtime salva o snapshot completo de bindings em `form-inputs` e emite os bindings no patch parcial ao host. Em `input-first`, preferências locais não sobrescrevem os inputs. Omitir a preferência em replace-all limpa o override anterior.
|
|
111
|
+
|
|
112
|
+
Estilos permanecem em `contextSnapshot.presentation`, acessível pela aba **Estilo da apresentação** nos editores direto e do Page Builder. O input `presentation?: DynamicFormPresentationSnapshot | null` projeta esse bloco no widget, sem criar `config.sections` vazias; `null` limpa ajustes explícitos, enquanto ausência mantém a resolução padrão. O wrapper de Filter Form compartilha o documento, mas não oferece a ativação, pois seu runtime não implementa apresentação.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### Presentation style projection and editor UX
|
|
116
|
+
|
|
117
|
+
- `contextSnapshot.presentation` is the canonical style snapshot. The optional runtime input `presentation: DynamicFormPresentationSnapshot | null` projects it into page widgets independently of schema-generated `config`. Explicit styles take precedence over stored style preferences; `null` restores defaults and blocks stale stored overrides; omission retains normal style resolution.
|
|
118
|
+
- Runtime editor Apply/Save emits `presentation` with `mode` and `presentationModeGlobal` in `configPatchChange.inputPatch`. Widget save/reopen preserves the same snapshot; omitting the document block clears the widget projection with `null`.
|
|
119
|
+
- Numeric font sizes and label widths are pixels. Capturing a runtime `rem` size converts it using the host root font size; opening and saving must not reinterpret `0.78rem` as `0.78px`.
|
|
120
|
+
- **Geral → Dados do formulário** separates **Criar / Editar / Visualizar** from **Automático / Campos / Apresentação**. Selecting presentation in Create/Edit keeps the operation unchanged and explains the inactive state with an explicit action to switch to View.
|
|
121
|
+
- **Estilo da apresentação** remains discoverable regardless of the current mode. It previews sample data and does not activate presentation by itself. Filter Form does not expose this tab because it has no presentation runtime.
|
|
122
|
+
- Applying or finishing widget editing updates the page draft. **Salvar página** persists the composition. Shortening sample text affects the preview only.
|