@praxisui/table 8.0.0-beta.90 → 8.0.0-beta.92

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.
@@ -39945,7 +39945,7 @@ class PraxisTable {
39945
39945
  if (this.aiAdapter || this.aiAdapterLoadStarted)
39946
39946
  return;
39947
39947
  this.aiAdapterLoadStarted = true;
39948
- import('./praxisui-table-table-ai.adapter-DBaPq8mg.mjs')
39948
+ import('./praxisui-table-table-ai.adapter-D6gyv_KU.mjs')
39949
39949
  .then(({ TableAiAdapter }) => {
39950
39950
  this.aiAdapter = new TableAiAdapter(this);
39951
39951
  this.initializeAiAssistantController();
@@ -40277,7 +40277,10 @@ class PraxisTable {
40277
40277
  });
40278
40278
  }
40279
40279
  if (intents.length < 4) {
40280
- const availableRecommendations = intents
40280
+ const availableRecommendations = [
40281
+ ...intents,
40282
+ ...this.getAiAssistantCapabilityDiscoveryRecommendations(t, tableContext),
40283
+ ]
40281
40284
  .slice(0, 5)
40282
40285
  .map((intent) => ({
40283
40286
  id: intent.id,
@@ -40322,6 +40325,152 @@ class PraxisTable {
40322
40325
  }
40323
40326
  return intents.slice(0, 6);
40324
40327
  }
40328
+ getAiAssistantCapabilityDiscoveryRecommendations(t, tableContext) {
40329
+ const columns = (this.config?.columns ?? [])
40330
+ .filter((column) => !!column?.field)
40331
+ .slice(0, 12);
40332
+ if (!columns.length)
40333
+ return [];
40334
+ const columnLabel = (column) => column.header || column.field;
40335
+ const normalizedColumnText = (column) => this.normalizeFieldAlias([column.field, column.header].filter(Boolean).join(' '));
40336
+ const recommendations = [];
40337
+ const componentState = {
40338
+ ...tableContext,
40339
+ columns: columns.map((column) => ({
40340
+ field: column.field,
40341
+ header: columnLabel(column),
40342
+ type: column.type ?? null,
40343
+ visible: column.visible !== false,
40344
+ rendererType: column.renderer?.type ?? null,
40345
+ })),
40346
+ };
40347
+ const visibleColumns = columns.filter((column) => column.visible !== false);
40348
+ const columnLabels = (items) => items
40349
+ .slice(0, 4)
40350
+ .map((column) => columnLabel(column))
40351
+ .filter((label) => !!label)
40352
+ .join(', ');
40353
+ if (visibleColumns.length > 5) {
40354
+ recommendations.push({
40355
+ id: 'table-curate-compact-view',
40356
+ label: t('table.assistant.recommendation.compactView.label', 'Compactar visual da tabela'),
40357
+ description: t('table.assistant.recommendation.compactView.description', 'Prioriza as colunas essenciais e reduz ruído visual para leitura rápida.'),
40358
+ group: {
40359
+ id: 'table-appearance',
40360
+ label: t('table.assistant.recommendation.group.appearance', 'Apresentação'),
40361
+ },
40362
+ icon: 'view_week',
40363
+ tone: 'neutral',
40364
+ action: {
40365
+ kind: 'submit-prompt',
40366
+ prompt: t('table.assistant.recommendation.compactView.prompt', 'Deixe esta tabela mais compacta e priorize as colunas mais importantes para uma visão operacional.'),
40367
+ contextHints: {
40368
+ source: 'table-capability-discovery-curation',
40369
+ opportunityId: 'table.appearance.compact-view',
40370
+ target: { kind: 'component', id: tableContext.tableId },
40371
+ componentState,
40372
+ },
40373
+ },
40374
+ requiresConfirmation: false,
40375
+ sourceCandidateIds: ['table.appearance.compact-view'],
40376
+ });
40377
+ }
40378
+ const publicViewCandidates = visibleColumns.filter((column) => column.type === 'currency'
40379
+ || column.type === 'number'
40380
+ || normalizedColumnText(column).includes('email')
40381
+ || normalizedColumnText(column).includes('cpf')
40382
+ || normalizedColumnText(column).includes('salario'));
40383
+ if (publicViewCandidates.length) {
40384
+ recommendations.push({
40385
+ id: 'table-curate-public-view',
40386
+ label: t('table.assistant.recommendation.publicView.label', 'Preparar visualização pública'),
40387
+ description: t('table.assistant.recommendation.publicView.description', 'Sugere ocultar dados sensíveis ou internos antes de compartilhar a tabela.'),
40388
+ group: {
40389
+ id: 'table-governance',
40390
+ label: t('table.assistant.recommendation.group.governance', 'Governança'),
40391
+ },
40392
+ icon: 'visibility_off',
40393
+ tone: 'warning',
40394
+ action: {
40395
+ kind: 'submit-prompt',
40396
+ prompt: t('table.assistant.recommendation.publicView.prompt', 'Prepare uma visualização pública desta tabela ocultando colunas sensíveis ou internas quando fizer sentido.'),
40397
+ contextHints: {
40398
+ source: 'table-capability-discovery-curation',
40399
+ opportunityId: 'table.governance.public-view',
40400
+ target: { kind: 'columns', id: `${tableContext.tableId}:public-view` },
40401
+ componentState,
40402
+ candidateColumns: publicViewCandidates.map((column) => ({
40403
+ field: column.field,
40404
+ label: columnLabel(column),
40405
+ type: column.type ?? null,
40406
+ })),
40407
+ },
40408
+ },
40409
+ requiresConfirmation: true,
40410
+ sourceCandidateIds: ['table.governance.public-view', 'column.visibility.set'],
40411
+ });
40412
+ }
40413
+ const booleanOrStatusColumn = columns.find((column) => column.type === 'boolean'
40414
+ || normalizedColumnText(column).includes('status')
40415
+ || normalizedColumnText(column).includes('ativo'));
40416
+ if (booleanOrStatusColumn) {
40417
+ recommendations.push({
40418
+ id: 'table-curate-status-badges',
40419
+ label: t('table.assistant.recommendation.statusBadge.label', 'Transformar status em badge'),
40420
+ description: t('table.assistant.recommendation.statusBadge.description', 'Melhora a leitura de estados booleanos ou operacionais com cores governadas.'),
40421
+ group: {
40422
+ id: 'table-appearance',
40423
+ label: t('table.assistant.recommendation.group.appearance', 'Apresentação'),
40424
+ },
40425
+ icon: 'verified',
40426
+ tone: 'success',
40427
+ action: {
40428
+ kind: 'submit-prompt',
40429
+ prompt: t('table.assistant.recommendation.statusBadge.prompt', 'Transforme a coluna de status ou ativo em badges visuais com texto curto e cores adequadas.'),
40430
+ contextHints: {
40431
+ source: 'table-capability-discovery-curation',
40432
+ opportunityId: 'table.appearance.status-badge',
40433
+ target: { kind: 'column', field: booleanOrStatusColumn.field },
40434
+ componentState,
40435
+ },
40436
+ },
40437
+ requiresConfirmation: true,
40438
+ sourceCandidateIds: ['table.appearance.status-badge', 'column.renderer.set'],
40439
+ });
40440
+ }
40441
+ const categoricalColumns = visibleColumns.filter((column) => column.type === 'string'
40442
+ && /departamento|department|cargo|role|categoria|category/u.test(normalizedColumnText(column)));
40443
+ if (categoricalColumns.length) {
40444
+ recommendations.push({
40445
+ id: 'table-curate-categorical-chips',
40446
+ label: t('table.assistant.recommendation.categoryChips.label', 'Realçar categorias com chips'),
40447
+ description: t('table.assistant.recommendation.categoryChips.description', 'Usa renderização visual para campos categóricos como {columns}.', { columns: columnLabels(categoricalColumns) || t('table.assistant.recommendation.categoryChips.columnsFallback', 'categorias') }),
40448
+ group: {
40449
+ id: 'table-appearance',
40450
+ label: t('table.assistant.recommendation.group.appearance', 'Apresentação'),
40451
+ },
40452
+ icon: 'sell',
40453
+ tone: 'resource',
40454
+ action: {
40455
+ kind: 'submit-prompt',
40456
+ prompt: t('table.assistant.recommendation.categoryChips.prompt', 'Melhore a leitura das colunas categóricas desta tabela usando chips, badges ou outra apresentação visual adequada.'),
40457
+ contextHints: {
40458
+ source: 'table-capability-discovery-curation',
40459
+ opportunityId: 'table.appearance.categorical-chips',
40460
+ target: { kind: 'columns', id: `${tableContext.tableId}:categorical-columns` },
40461
+ componentState,
40462
+ candidateColumns: categoricalColumns.map((column) => ({
40463
+ field: column.field,
40464
+ label: columnLabel(column),
40465
+ })),
40466
+ },
40467
+ },
40468
+ requiresConfirmation: true,
40469
+ sourceCandidateIds: ['table.appearance.categorical-chips', 'column.renderer.set'],
40470
+ });
40471
+ }
40472
+ return recommendations;
40473
+ }
40325
40474
  onAiAssistantRecommendedIntent(intent) {
40326
40475
  const controller = this.aiAssistantController;
40327
40476
  if (!controller)
@@ -40391,7 +40540,7 @@ class PraxisTable {
40391
40540
  initializeAiAssistantController() {
40392
40541
  if (!this.aiAdapter || this.aiAssistantController)
40393
40542
  return;
40394
- import('./praxisui-table-table-agentic-authoring-turn-flow-BZc3KmLG.mjs')
40543
+ import('./praxisui-table-table-agentic-authoring-turn-flow-CGr29WF0.mjs')
40395
40544
  .then(({ TableAgenticAuthoringTurnFlow }) => {
40396
40545
  if (this.aiAssistantController || !this.aiAdapter)
40397
40546
  return;
@@ -2228,7 +2228,7 @@ class TableAgenticAuthoringTurnFlow {
2228
2228
  }
2229
2229
  if (response.patch && Object.keys(response.patch).length > 0) {
2230
2230
  const warnings = response.warnings?.filter(Boolean) ?? [];
2231
- const quickReplies = this.shouldSuppressReviewQuickReplies(response.patch)
2231
+ const quickReplies = this.shouldSuppressReviewQuickReplies(response.patch, response)
2232
2232
  ? []
2233
2233
  : this.toQuickReplies(response, request);
2234
2234
  const diagnostics = this.buildReviewDiagnostics(response, warnings);
@@ -2259,8 +2259,11 @@ class TableAgenticAuthoringTurnFlow {
2259
2259
  canApply: false,
2260
2260
  };
2261
2261
  }
2262
- shouldSuppressReviewQuickReplies(patch) {
2263
- return this.tableFilterApplyOperations(patch).length > 0;
2262
+ shouldSuppressReviewQuickReplies(patch, response) {
2263
+ if (Array.isArray(response.optionPayloads) && response.optionPayloads.length > 0)
2264
+ return false;
2265
+ const record = this.toRecord(patch);
2266
+ return !!record && Object.keys(record).length > 0;
2264
2267
  }
2265
2268
  isTurnInProgressResponse(response) {
2266
2269
  return this.normalizeLabel(response.code ?? '') === 'turn in progress';
@@ -2289,6 +2292,9 @@ class TableAgenticAuthoringTurnFlow {
2289
2292
  const executableResponse = {
2290
2293
  ...response,
2291
2294
  patch: normalizedExecutable.patch,
2295
+ ...(this.safeReviewText(normalizedExecutable.explanation)
2296
+ ? { explanation: this.safeReviewText(normalizedExecutable.explanation) }
2297
+ : {}),
2292
2298
  ...(normalizedExecutable.componentEditPlan
2293
2299
  ? { componentEditPlan: normalizedExecutable.componentEditPlan }
2294
2300
  : {}),
@@ -6311,7 +6317,33 @@ class TableAgenticAuthoringTurnFlow {
6311
6317
  ...planSummaries.map((summary) => `- ${summary}`),
6312
6318
  ].join('\n');
6313
6319
  }
6314
- return response.explanation || 'Proposta de alteração pronta para revisar.';
6320
+ const explanation = this.safeReviewText(response.explanation);
6321
+ if (explanation)
6322
+ return explanation;
6323
+ const message = this.safeReviewText(response.message);
6324
+ if (message)
6325
+ return message;
6326
+ return 'Proposta de alteração pronta para revisar.';
6327
+ }
6328
+ safeReviewText(value) {
6329
+ const text = this.stringValue(value).trim();
6330
+ if (!text)
6331
+ return '';
6332
+ const normalized = this.normalizeLabel(text);
6333
+ const looksLikeStructuredEnvelope = ((normalized.includes('componenteditplan') || normalized.includes('tableruntimeoperations'))
6334
+ && normalized.includes('operationid')) || normalized.includes('responsemode componenteditplan');
6335
+ if (looksLikeStructuredEnvelope)
6336
+ return '';
6337
+ if ((text.startsWith('{') && text.endsWith('}')) || (text.startsWith('[') && text.endsWith(']'))) {
6338
+ try {
6339
+ JSON.parse(text);
6340
+ return '';
6341
+ }
6342
+ catch {
6343
+ // Keep non-JSON prose even when it starts with a brace-like character.
6344
+ }
6345
+ }
6346
+ return text;
6315
6347
  }
6316
6348
  describeTableRuntimeOperations(patch) {
6317
6349
  const envelope = this.toRecord(this.toRecord(patch)?.['tableRuntimeOperations']);
@@ -1,7 +1,7 @@
1
1
  import { firstValueFrom } from 'rxjs';
2
2
  import { BaseAiAdapter, createComponentAuthoringContext } from '@praxisui/ai';
3
3
  import { PRAXIS_GLOBAL_ACTION_CATALOG, deepMerge } from '@praxisui/core';
4
- import { G as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, W as coerceTableComponentEditPlans, Y as compileTableComponentEditPlans, I as TASK_PRESETS, a1 as getTableComponentEditPlanCapabilities, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, E as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-Db_nPX-d.mjs';
4
+ import { G as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, W as coerceTableComponentEditPlans, Y as compileTableComponentEditPlans, I as TASK_PRESETS, a1 as getTableComponentEditPlanCapabilities, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, E as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-bE4K3OK_.mjs';
5
5
 
6
6
  const TABLE_COMPONENT_CONTEXT_PACK = {
7
7
  version: 'v1',
@@ -1 +1 @@
1
- export { A as AnalyticsTableConfigAdapterService, a as AnalyticsTableContractService, b as AnalyticsTableStatsApiService, B as BOOLEAN_PRESETS, c as BehaviorConfigEditorComponent, C as CURRENCY_PRESETS, d as ColumnsConfigEditorComponent, D as DATE_PRESETS, e as DataFormatterComponent, f as DataFormattingService, F as FORMULA_TEMPLATES, g as FilterConfigService, h as FilterSettingsComponent, i as FormulaGeneratorService, J as JsonConfigEditorComponent, M as MessagesLocalizationEditorComponent, N as NUMBER_PRESETS, P as PERCENTAGE_PRESETS, j as PRAXIS_FILTER_COMPONENT_METADATA, k as PRAXIS_TABLE_AUTHORING_MANIFEST, l as PRAXIS_TABLE_COMPONENT_METADATA, m as PRAXIS_TABLE_TOOLBAR_DEFAULT_APPEARANCE, n as PRAXIS_TABLE_TOOLBAR_TOKEN_PRESETS, o as PraxisFilter, p as PraxisFilterWidgetConfigEditor, q as PraxisTable, r as PraxisTableConfigEditor, s as PraxisTableInlineAuthoringEditorComponent, t as PraxisTableToolbar, u as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, v as TABLE_COMPONENT_AI_CAPABILITIES, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_KIND, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, I as TASK_PRESETS, K as TableDefaultsProvider, L as TableRulesEditorComponent, O as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, Q as VisualFormulaBuilderComponent, R as buildTableApplyPlan, U as coerceTableComponentEditPlan, W as coerceTableComponentEditPlans, X as compileTableComponentEditPlan, Y as compileTableComponentEditPlans, Z as createTableAuthoringDocument, _ as getActionId, $ as getEnum, a0 as getTableCapabilities, a1 as getTableComponentEditPlanCapabilities, a2 as isTableRendererSupportedByRichContentP0, a3 as mapTableRendererToRichContentP0, a4 as normalizeTableAuthoringDocument, a5 as parseLegacyOrTableDocument, a6 as providePraxisFilterMetadata, a7 as providePraxisTableMetadata, a8 as providePraxisTableToolbarAppearance, a9 as serializeTableAuthoringDocument, aa as toCanonicalTableConfig, ab as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-Db_nPX-d.mjs';
1
+ export { A as AnalyticsTableConfigAdapterService, a as AnalyticsTableContractService, b as AnalyticsTableStatsApiService, B as BOOLEAN_PRESETS, c as BehaviorConfigEditorComponent, C as CURRENCY_PRESETS, d as ColumnsConfigEditorComponent, D as DATE_PRESETS, e as DataFormatterComponent, f as DataFormattingService, F as FORMULA_TEMPLATES, g as FilterConfigService, h as FilterSettingsComponent, i as FormulaGeneratorService, J as JsonConfigEditorComponent, M as MessagesLocalizationEditorComponent, N as NUMBER_PRESETS, P as PERCENTAGE_PRESETS, j as PRAXIS_FILTER_COMPONENT_METADATA, k as PRAXIS_TABLE_AUTHORING_MANIFEST, l as PRAXIS_TABLE_COMPONENT_METADATA, m as PRAXIS_TABLE_TOOLBAR_DEFAULT_APPEARANCE, n as PRAXIS_TABLE_TOOLBAR_TOKEN_PRESETS, o as PraxisFilter, p as PraxisFilterWidgetConfigEditor, q as PraxisTable, r as PraxisTableConfigEditor, s as PraxisTableInlineAuthoringEditorComponent, t as PraxisTableToolbar, u as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, v as TABLE_COMPONENT_AI_CAPABILITIES, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_KIND, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, I as TASK_PRESETS, K as TableDefaultsProvider, L as TableRulesEditorComponent, O as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, Q as VisualFormulaBuilderComponent, R as buildTableApplyPlan, U as coerceTableComponentEditPlan, W as coerceTableComponentEditPlans, X as compileTableComponentEditPlan, Y as compileTableComponentEditPlans, Z as createTableAuthoringDocument, _ as getActionId, $ as getEnum, a0 as getTableCapabilities, a1 as getTableComponentEditPlanCapabilities, a2 as isTableRendererSupportedByRichContentP0, a3 as mapTableRendererToRichContentP0, a4 as normalizeTableAuthoringDocument, a5 as parseLegacyOrTableDocument, a6 as providePraxisFilterMetadata, a7 as providePraxisTableMetadata, a8 as providePraxisTableToolbarAppearance, a9 as serializeTableAuthoringDocument, aa as toCanonicalTableConfig, ab as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-bE4K3OK_.mjs';
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@praxisui/table",
3
- "version": "8.0.0-beta.90",
3
+ "version": "8.0.0-beta.92",
4
4
  "description": "Advanced data table for Angular (Praxis UI) with editing, filtering, sorting, virtualization, and settings panel integration.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
7
7
  "@angular/core": "^21.0.0",
8
- "@praxisui/ai": "^8.0.0-beta.90",
9
- "@praxisui/core": "^8.0.0-beta.90",
10
- "@praxisui/dynamic-fields": "^8.0.0-beta.90",
11
- "@praxisui/dynamic-form": "^8.0.0-beta.90",
12
- "@praxisui/metadata-editor": "^8.0.0-beta.90",
13
- "@praxisui/rich-content": "^8.0.0-beta.90",
14
- "@praxisui/settings-panel": "^8.0.0-beta.90",
15
- "@praxisui/table-rule-builder": "^8.0.0-beta.90",
8
+ "@praxisui/ai": "^8.0.0-beta.92",
9
+ "@praxisui/core": "^8.0.0-beta.92",
10
+ "@praxisui/dynamic-fields": "^8.0.0-beta.92",
11
+ "@praxisui/dynamic-form": "^8.0.0-beta.92",
12
+ "@praxisui/metadata-editor": "^8.0.0-beta.92",
13
+ "@praxisui/rich-content": "^8.0.0-beta.92",
14
+ "@praxisui/settings-panel": "^8.0.0-beta.92",
15
+ "@praxisui/table-rule-builder": "^8.0.0-beta.92",
16
16
  "@angular/cdk": "^21.0.0",
17
17
  "@angular/forms": "^21.0.0",
18
18
  "@angular/material": "^21.0.0",
19
19
  "@angular/router": "^21.0.0",
20
- "@praxisui/dialog": "^8.0.0-beta.90",
20
+ "@praxisui/dialog": "^8.0.0-beta.92",
21
21
  "rxjs": "~7.8.0"
22
22
  },
23
23
  "dependencies": {
@@ -1335,6 +1335,7 @@ declare class PraxisTable implements OnInit, OnChanges, AfterViewInit, AfterCont
1335
1335
  onAiAssistantCancel(): void;
1336
1336
  onAiAssistantQuickReply(reply: PraxisAssistantShellQuickReply): void;
1337
1337
  getAiAssistantRecommendedIntents(): readonly PraxisAssistantRecommendedIntent[];
1338
+ private getAiAssistantCapabilityDiscoveryRecommendations;
1338
1339
  onAiAssistantRecommendedIntent(intent: PraxisAssistantRecommendedIntent): void;
1339
1340
  private getAiAssistantRecommendationResponseContract;
1340
1341
  onAiAssistantEditMessage(message: PraxisAssistantShellMessage): void;