@praxisui/table 8.0.0-beta.30 → 8.0.0-beta.31

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
@@ -168,10 +168,21 @@ Filtro runtime:
168
168
  - The table assistant is part of the global Praxis semantic copilot experience, not a standalone table patch bot.
169
169
  - In customization mode, opening the assistant registers a `PraxisAssistantContextSnapshot` through `PraxisAssistantSessionRegistryService`.
170
170
  - The table session identity follows `table:{routeKey}:{componentInstanceId || tableId}` so multiple tables on the same page can preserve separate assistant sessions.
171
- - Minimizing the table shell keeps a global minimized session that the App Shell can reopen; the App Shell does not interpret or execute table semantics.
171
+ - Minimizing the table shell keeps the governed session in `PraxisAssistantSessionRegistryService` with `presence: 'origin-anchor'`; the visual affordance returns to the table assistant trigger, which changes to the minimized state and reopens the preserved session. The App Shell does not interpret or execute table semantics.
172
172
  - The table snapshot stores only safe context: table identity, target, context chips, manifest reference, resource path, schema field names, data/runtime digests, capability refs and governance hints.
173
173
  - Prompts that indicate shared business decisions, such as rules, policies, compliance, LGPD, approval, eligibility or access control, must be routed to governed `domain-rules` handoff instead of local table config patches.
174
174
 
175
+ ### Consultative answers vs governed edits
176
+
177
+ `@praxisui/table` declares two component-level response modes through its authoring context:
178
+
179
+ - `consult/answer`: use when the user asks a factual or how-to question about the current table. Examples: "qual endpoint esta servindo esta tabela?", "quais campos existem nesta tabela?", "quais recursos de estilização a tabela suporta?" and "como criar uma coluna que soma duas colunas?".
180
+ - `edit/componentEditPlan`: use when the user asks to apply or materialize a change. Examples: "mostre ativo como badge verde", "crie uma coluna bonus com 10% do salario", "deixe o avatar vermelho quando salario for maior que 30000" and "anime as linhas com salario acima de 30000".
181
+
182
+ Consultative answers are selected by the backend/LLM from the component `responseModes` contract and return `type: "info"`. The table runtime must not classify user intent through local keywords; it only sends grounded context such as `resourcePath`, schema fields and the table authoring manifest, then renders the orchestrator response without an apply action. For how-to or documentation-style turns, the orchestrator should explain the governed operation shape and give a safe example instead of collecting missing edit parameters.
183
+
184
+ Governed edits must be selected by the same backend/LLM response-mode decision and produce a validated `componentEditPlan`; the table compiles that plan into a patch and only then exposes the review/apply step.
185
+
175
186
  ## Migration Note
176
187
 
177
188
  - This release treats `enableCustomization=false` as the canonical default.
@@ -295,6 +306,29 @@ animacao. `rowConditionalRenderers` fica tipado no contrato publico para tooltip
295
306
  e animacao de linha, preservando os campos planos `tooltip`/`animation` como
296
307
  fallback.
297
308
 
309
+ Animações condicionais devem ser authoradas como decisão semântica, não como CSS
310
+ manual em `style.animation`. Para animar a linha inteira, use
311
+ `rowConditionalRenderers[].animation`; para animar somente uma célula/coluna, use
312
+ `columns[].conditionalRenderers[].animation`. Prefira presets semânticos
313
+ (`info-soft`, `success-confirm`, `warning-attention`, `critical-alert`,
314
+ `audit-review`, `sync-pending` ou aliases como `pulse-soft`, `sla-breach`,
315
+ `risk-critical`) antes de `type` bruto. Exemplo:
316
+
317
+ ```ts
318
+ rowConditionalRenderers: [
319
+ {
320
+ id: 'salario-alto-pulse',
321
+ condition: { '>': [{ var: 'salario' }, 30000] },
322
+ animation: { preset: 'pulse-soft', trigger: 'onAppear', intensity: 'subtle', repeat: 'once' },
323
+ enabled: true,
324
+ },
325
+ ]
326
+ ```
327
+
328
+ `appearance.animations.enabled = false` desativa animações; os flags
329
+ `appearance.animations.specific.row` e `appearance.animations.specific.cell`
330
+ desativam seletivamente animações condicionais de linha e célula.
331
+
298
332
  Colunas calculadas usam `columns[].computed.expression` como AST JSON Logic
299
333
  canonico. Regras, estilos e renderers condicionais podem referenciar esses
300
334
  valores via `computed.<field>`. Quando uma coluna calculada depende de outra
@@ -1757,9 +1791,9 @@ Deteccao:
1757
1791
  - somente quando `FieldDefinition.controlType === 'avatar'`
1758
1792
 
1759
1793
  Renderer aplicado:
1760
- - `renderer: { type: 'avatar', avatar: { srcField, initialsExpr, shape: 'circle', size: 28 } }`
1794
+ - `renderer: { type: 'avatar', avatar: { srcField, initialsField: 'nomeCompleto', shape: 'circle', size: 32 } }`
1761
1795
  - alinhamento central e largura compacta (~56px)
1762
- - `initialsExpr` com fallback para `nomeCompleto|nome|fullName|name|title`
1796
+ - `initialsField` deriva as iniciais a partir de um campo textual bruto
1763
1797
 
1764
1798
  Avatar explicito:
1765
1799
  - `renderer: { type: 'avatar', avatar: { srcField, initialsExpr, initialsField, shape: 'circle', size: 28 } }`
@@ -1767,7 +1801,7 @@ Avatar explicito:
1767
1801
  - `initialsExpr` deve retornar as iniciais prontas; ele nao transforma automaticamente um campo bruto em iniciais
1768
1802
  - quando quiser derivar iniciais a partir de um campo textual, prefira `initialsField`
1769
1803
  - exemplo recomendado: `avatar: { srcField: 'photoUrl', initialsField: 'name' }`
1770
- - exemplo de `initialsExpr` explicito: `avatar: { initialsExpr: \"= (row.name || '').trim().split(/\\s+/).slice(0,2).map(p => p[0] || '').join('').toUpperCase()\" }`
1804
+ - exemplo de `initialsExpr` explicito: `avatar: { initialsExpr: 'initials' }`
1771
1805
 
1772
1806
  Comportamento importante:
1773
1807
  - a autodeteccao ocorre apenas no bootstrap (nao sobrescreve configuracoes de colunas persistidas)
@@ -1777,8 +1811,11 @@ Comportamento importante:
1777
1811
  Ajustes comuns:
1778
1812
  - `renderer.avatar.shape`: `'square' | 'rounded' | 'circle'`
1779
1813
  - `renderer.avatar.size`: numero em px
1814
+ - `renderer.avatar.backgroundColor`: cor de fundo do circulo
1815
+ - `renderer.avatar.textColor`: cor das iniciais
1780
1816
  - `renderer.avatar.alt` / `altField`
1781
1817
  - use `conditionalRenderers` para variar renderer por linha
1818
+ - exemplo condicional: `condition: { ">": [{ "var": "salario" }, 30000] }` com `avatar: { initialsField: 'name', backgroundColor: '#D32F2F', textColor: '#FFFFFF' }`
1782
1819
 
1783
1820
  A11y, seguranca e performance:
1784
1821
  - `alt`/`altField` sao respeitados