@praxisui/table 8.0.0-beta.1 → 8.0.0-beta.11

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
@@ -469,6 +469,18 @@ O chrome conversacional, `sessionId`, `clientTurnId`, respostas rapidas e ciclo
469
469
  por `PraxisAssistantTurnOrchestratorService`; a semantica especifica da tabela continua em `TableAiAdapter` e no
470
470
  `TableAgenticAuthoringTurnFlow`.
471
471
 
472
+ ## Agentic Authoring & Manifest
473
+
474
+ O `@praxisui/table` suporta authoring agentic através de um `ComponentAuthoringManifest` canônico completo. Este manifesto define o contrato executável para que agentes de IA descubram alvos e realizem operações na configuração da tabela.
475
+
476
+ - **Component ID:** `praxis-table`
477
+ - **Config Schema:** `TableConfig`
478
+ - **Alvos Editáveis (30):** `column`, `computedColumn`, `renderer`, `conditionalRenderer`, `rowAction`, `toolbarAction`, `toolbar`, `filter`, `grouping`, `selection`, `export`, `appearance`, `expansion`, `rule`, `meta`, `bulkAction`, `contextAction`, `pagination`, `sorting`, `interaction`, `loading`, `emptyState`, `resizing`, `dragging`, `editing`, `messages`, `localization`, `performance`, `data`, `accessibility`.
479
+ - **Famílias de Operações (58):** Implementação semântica rigorosa, com target resolvers próprios por operação, alinhada com o `TableConfigV2` canônico. Inclui as 22 famílias obrigatórias do gate e cobre 100% dos paths publicados em `TABLE_AI_CAPABILITIES`: metadados, colunas, renderizadores, regras condicionais, paginação, ordenação, filtros, seleção, interação, loading, empty state, resizing, dragging, edição, toolbar, ações, exportação, aparência, expansão, mensagens, localização, performance, dados e acessibilidade.
480
+ - **Validação:** Inclui 16 validadores determinísticos cobrindo unicidade, integridade de caminhos, suporte a renderizadores, presets de formatação, segurança de estilos, segurança de resource binding e round-trip do editor. A spec focal compara o manifesto contra `TABLE_AI_CAPABILITIES` e falha se qualquer path publicado ficar sem operação de authoring.
481
+
482
+ O manifesto (v2.0.0) é exportado como `PRAXIS_TABLE_AUTHORING_MANIFEST` e está integrado no `ai_registry` para backend tools.
483
+
472
484
  ## 🚀 Instalação
473
485
 
474
486
  ```bash
@@ -938,7 +950,7 @@ onSchemaStatus(ev: { outdated: boolean; serverHash?: string; lastVerifiedAt?: st
938
950
 
939
951
  - O backend anota o schema com `x-ui.resource.idField` (e `idFieldValid`) via `/schemas/filtered`.
940
952
  - A tabela adota o campo identificador automaticamente com a seguinte precedência:
941
- - `@Input() idField` → `crudContext.idField` → `config.meta.idField` (persistido) → `GenericCrudService.getResourceIdField()` (derivado do schema) → `'id'`.
953
+ - `config.meta.idField` (persistido) → contexto runtime/serviço derivado do schema → `'id'`.
942
954
  - Se `config.meta.idField` divergir do servidor, o componente alerta o usuário e mantém o valor do TableConfig até reconciliação.
943
955
  - A resolução ocorre no `loadSchema()` e também é considerada em tempo de execução para evitar corridas.
944
956
  - Para recursos cuja PK não é `id`, defina `getIdFieldName()` no controller backend correspondente.
@@ -961,7 +973,7 @@ sequenceDiagram
961
973
  Docs-->>GS: 200/304 schema + x-ui.resource.idField
962
974
  GS->>GS: cache + lastResourceMeta.idField
963
975
  GS-->>PT: FieldDefinition[] (normalizado)
964
- Note over PT: idField = input || context || GS.getResourceIdField() || 'id'
976
+ Note over PT: idField = config.meta.idField || runtime/schema || 'id'
965
977
  PT->>PT: construir colunas e renderizar
966
978
  ```
967
979
 
@@ -986,7 +998,7 @@ sequenceDiagram
986
998
  ### Troubleshooting rápido (idField)
987
999
 
988
1000
  - A ação delete falhou por ID ausente: verifique se o schema contém `x-ui.resource.idField` e se a coluna correspondente existe no dataset.
989
- - O ID está em outra propriedade: defina `@Input() idField` ou `crudContext.idField` temporariamente; ajuste o backend com `getIdFieldName()` para persistir o comportamento.
1001
+ - O ID está em outra propriedade: defina `config.meta.idField` no TableConfig; ajuste o backend com `getIdFieldName()` para persistir o comportamento derivado do schema.
990
1002
  - Cache 304 sem idField aplicado: confirme que o serviço recebeu o body pelo menos uma vez (200) e que `GenericCrudService.getResourceIdField()` retorna o valor esperado.
991
1003
 
992
1004
  ### Uso com Dados Locais (Client-Side)
@@ -198,11 +198,12 @@ class TableAiAdapter extends BaseAiAdapter {
198
198
  const actions = config.actions || {};
199
199
  const availableFeatures = [];
200
200
  const missingCapabilities = [];
201
+ const effectiveIdField = this.normalizeString(this.table.getIdField?.());
201
202
  if (!this.table.resourcePath) {
202
203
  availableFeatures.push('data-connection');
203
204
  }
204
- if (!this.table.idField) {
205
- availableFeatures.push('bindings.idField');
205
+ if (!effectiveIdField) {
206
+ availableFeatures.push('meta.idField');
206
207
  }
207
208
  if (!behavior.filtering?.enabled) {
208
209
  availableFeatures.push('behavior.filtering');
@@ -264,14 +265,15 @@ class TableAiAdapter extends BaseAiAdapter {
264
265
  authoringContract: {
265
266
  kind: 'praxis.table.editor',
266
267
  usesBindings: true,
267
- bindingsPaths: ['bindings.resourcePath', 'bindings.idField', 'bindings.horizontalScroll'],
268
+ bindingsPaths: ['bindings.resourcePath', 'bindings.horizontalScroll'],
269
+ configPaths: ['meta.idField'],
268
270
  runtimeConfigProjection: 'TableConfig',
269
271
  },
270
272
  availableFeatures,
271
273
  missingCapabilities: Array.from(new Set(missingCapabilities)),
272
274
  inputs: {
273
275
  resourcePath: this.table.resourcePath || null,
274
- idField: this.table.getIdField?.() || null,
276
+ idField: effectiveIdField || null,
275
277
  horizontalScroll: this.table.horizontalScroll || null,
276
278
  },
277
279
  };
@@ -303,6 +305,13 @@ class TableAiAdapter extends BaseAiAdapter {
303
305
  this.applyConfig(nextConfig);
304
306
  return { success: true };
305
307
  }
308
+ normalizeString(value) {
309
+ if (typeof value !== 'string') {
310
+ return null;
311
+ }
312
+ const normalized = value.trim();
313
+ return normalized ? normalized : null;
314
+ }
306
315
  // -------- Context & suggestions --------
307
316
  /**
308
317
  * Human-friendly summary for prompt/context (columns + feature flags + data stats).
@@ -564,7 +573,7 @@ Columns Analysis:
564
573
  const id = this.table.tableId || 'default';
565
574
  const rp = this.table.resourcePath || 'default';
566
575
  // bump version to invalidate old cached suggestions
567
- return `ai-suggestions:v3:${id}:${rp}`;
576
+ return `ai-suggestions:v4:${id}:${rp}`;
568
577
  }
569
578
  getColumnNames() {
570
579
  return (this.table.config?.columns || [])