@praxisui/table 8.0.0-beta.36 → 8.0.0-beta.38

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.
@@ -39405,7 +39405,7 @@ class PraxisTable {
39405
39405
  if (this.aiAdapter || this.aiAdapterLoadStarted)
39406
39406
  return;
39407
39407
  this.aiAdapterLoadStarted = true;
39408
- import('./praxisui-table-table-ai.adapter-C3v9KfLA.mjs')
39408
+ import('./praxisui-table-table-ai.adapter-DY2BRXtp.mjs')
39409
39409
  .then(({ TableAiAdapter }) => {
39410
39410
  this.aiAdapter = new TableAiAdapter(this);
39411
39411
  this.initializeAiAssistantController();
@@ -39555,7 +39555,7 @@ class PraxisTable {
39555
39555
  initializeAiAssistantController() {
39556
39556
  if (!this.aiAdapter || this.aiAssistantController)
39557
39557
  return;
39558
- import('./praxisui-table-table-agentic-authoring-turn-flow-DwXFfED2.mjs')
39558
+ import('./praxisui-table-table-agentic-authoring-turn-flow-BkQittJK.mjs')
39559
39559
  .then(({ TableAgenticAuthoringTurnFlow }) => {
39560
39560
  if (this.aiAssistantController || !this.aiAdapter)
39561
39561
  return;
@@ -48,6 +48,7 @@ class TableAgenticAuthoringTurnFlow {
48
48
  this.selectedRecordsCountForTurn = this.extractSelectedRecordsCount(contextHints);
49
49
  this.filterExpressionSupportedForTurn = this.resolveFilterExpressionSupported(contextHints);
50
50
  const localResponse = this.selectedRecordMissingSelectionAnswer(request, contextHints)
51
+ ?? this.selectedRecordSingleCandidateQuestionAnswer(request, contextHints)
51
52
  ?? this.selectedRecordFieldQuestionAnswer(request, contextHints)
52
53
  ?? this.selectedRecordMultiFieldQuestionAnswer(request, contextHints)
53
54
  ?? this.completeSelectedRecordFilterApplyRequest(request, contextHints)
@@ -740,13 +741,50 @@ class TableAgenticAuthoringTurnFlow {
740
741
  ],
741
742
  };
742
743
  }
744
+ selectedRecordSingleCandidateQuestionAnswer(request, contextHints) {
745
+ if (this.selectedRecordsCountForTurn !== 1)
746
+ return null;
747
+ const prompt = request.prompt ?? '';
748
+ const normalizedPrompt = this.normalizeLabel(prompt);
749
+ if (!this.selectedRecordInformationalQuestionRequested(normalizedPrompt))
750
+ return null;
751
+ if (this.selectedRecordFilterApplyRequested(prompt))
752
+ return null;
753
+ const candidates = this.selectedRecordFilterCandidates(contextHints)
754
+ .map((candidate) => ({
755
+ candidate,
756
+ score: this.selectedRecordCandidateQuestionScore(normalizedPrompt, candidate),
757
+ }))
758
+ .filter((entry) => entry.score > 0)
759
+ .sort((left, right) => right.score - left.score);
760
+ if (!candidates.length)
761
+ return null;
762
+ if (candidates.length > 1 && candidates[0].score === candidates[1].score)
763
+ return null;
764
+ const candidate = candidates[0].candidate;
765
+ const values = this.selectedRecordCandidateDisplayValues(candidate);
766
+ if (values.length !== 1)
767
+ return null;
768
+ const label = this.selectedRecordCandidateDisplayLabel(candidate);
769
+ return {
770
+ type: 'info',
771
+ message: `${label} do registro selecionado: ${values[0]}.`,
772
+ warnings: [
773
+ 'selected-record-candidate-question-answered-locally',
774
+ 'Single selected record supplied canonical filterCandidates; local answer used declared filter catalog metadata instead of materializing a table operation.',
775
+ ],
776
+ };
777
+ }
743
778
  selectedRecordMissingSelectionAnswer(request, contextHints) {
744
779
  if (this.selectedRecordsCountForTurn > 0)
745
780
  return null;
746
781
  const normalizedPrompt = this.normalizeLabel(request.prompt ?? '');
747
- const hasSelectedRecordsContext = this.hasSelectedRecordsContext(contextHints);
748
782
  if (!this.selectedRecordReferentialRecordsPrompt(normalizedPrompt)
749
- && !(hasSelectedRecordsContext && this.selectedRecordExplicitSelectionPrompt(normalizedPrompt))) {
783
+ && !this.selectedRecordExplicitSelectionPrompt(normalizedPrompt)) {
784
+ return null;
785
+ }
786
+ if (!this.selectedRecordsContextExplicitlyEmpty(contextHints)
787
+ && !this.selectedRecordMissingSelectionQuestionRequested(normalizedPrompt)) {
750
788
  return null;
751
789
  }
752
790
  return {
@@ -780,11 +818,27 @@ class TableAgenticAuthoringTurnFlow {
780
818
  'selecionadas',
781
819
  ].some((token) => this.normalizedTextContainsApproxPhrase(normalizedPrompt, token));
782
820
  }
783
- hasSelectedRecordsContext(contextHints) {
821
+ selectedRecordMissingSelectionQuestionRequested(normalizedPrompt) {
822
+ return this.selectedRecordInformationalQuestionRequested(normalizedPrompt)
823
+ && this.selectedRecordPromptGroundsKnownFilterField(normalizedPrompt);
824
+ }
825
+ selectedRecordPromptGroundsKnownFilterField(normalizedPrompt) {
826
+ if (!normalizedPrompt)
827
+ return false;
828
+ return this.filterFieldCatalogEntries.some((entry) => [
829
+ entry.name,
830
+ entry.label,
831
+ ...entry.aliases,
832
+ ...entry.relatedColumnLabels,
833
+ ...entry.relatedColumnFields,
834
+ ].some((candidate) => this.promptContainsAnyVariant(normalizedPrompt, candidate)));
835
+ }
836
+ selectedRecordsContextExplicitlyEmpty(contextHints) {
784
837
  const authoringContract = this.toRecord(contextHints?.['authoringContract']);
785
838
  const consultativeContext = this.toRecord(authoringContract?.['consultativeContext']);
786
- return !!(this.toRecord(consultativeContext?.['selectedRecordsContext'])
787
- ?? this.toRecord(contextHints?.['selectedRecordsContext']));
839
+ const selectedRecordsContext = this.toRecord(consultativeContext?.['selectedRecordsContext'])
840
+ ?? this.toRecord(contextHints?.['selectedRecordsContext']);
841
+ return !!selectedRecordsContext && this.extractSelectedRecordsCount(contextHints) <= 0;
788
842
  }
789
843
  singleTopSelectedRecordQuestionField(candidates) {
790
844
  if (!candidates.length)
@@ -925,17 +979,32 @@ class TableAgenticAuthoringTurnFlow {
925
979
  let score = 0;
926
980
  const candidateLabel = this.stringValue(candidate['label']);
927
981
  const field = this.stringValue(candidate['field']);
982
+ const entry = this.filterFieldCatalogEntries.find((candidateEntry) => candidateEntry.name === field);
928
983
  score += candidateLabel && this.promptContainsAnyVariant(normalizedPrompt, candidateLabel) ? 70 : 0;
929
984
  score += field && this.promptContainsAnyVariant(normalizedPrompt, this.humanizeFilterField(field)) ? 50 : 0;
930
985
  for (const value of [
986
+ ...this.stringArrayValue(candidate['aliases']),
987
+ ...(entry?.aliases ?? []),
931
988
  ...this.selectedRecordCandidateDisplayValues(candidate),
932
989
  ...this.stringArrayValue(candidate['relatedColumnLabels']),
990
+ ...(entry?.relatedColumnLabels ?? []),
933
991
  ...this.stringArrayValue(candidate['relatedColumnFields']),
992
+ ...(entry?.relatedColumnFields ?? []),
934
993
  ]) {
935
994
  score += this.promptContainsAnyVariant(normalizedPrompt, value) ? 80 : 0;
936
995
  }
937
996
  return score;
938
997
  }
998
+ selectedRecordCandidateDisplayLabel(candidate) {
999
+ const field = this.stringValue(candidate['field']);
1000
+ const entry = this.filterFieldCatalogEntries.find((candidateEntry) => candidateEntry.name === field);
1001
+ return this.stringArrayValue(candidate['relatedColumnLabels'])[0]
1002
+ || entry?.relatedColumnLabels[0]
1003
+ || this.stringValue(candidate['label'])
1004
+ || entry?.label
1005
+ || this.humanizeFilterField(field)
1006
+ || 'Campo';
1007
+ }
939
1008
  selectedRecordCandidateDisplayValues(candidate) {
940
1009
  const displayValues = Array.isArray(candidate['displayValues'])
941
1010
  ? candidate['displayValues']
@@ -975,8 +1044,18 @@ class TableAgenticAuthoringTurnFlow {
975
1044
  return ['comum', 'igual', 'padrao', 'mesma', 'mesmo'].some((token) => (this.normalizedTextContainsApproxToken(normalizedPrompt, token)));
976
1045
  }
977
1046
  selectedRecordCommonQuestionAlsoRequestsFilter(normalizedPrompt) {
1047
+ if (this.selectedRecordOperationalAudienceRequested(normalizedPrompt))
1048
+ return true;
978
1049
  return ['filtro', 'filtrar', 'filtre', 'filtra', 'aplique', 'aplicar', 'buscar', 'busque', 'procure', 'exportar', 'mostra', 'mostre', 'traz', 'traga', 'trazer', 'outro', 'outros', 'pega', 'pegue', 'acha', 'ache', 'encontra', 'encontre'].some((token) => (this.normalizedTextContainsApproxToken(normalizedPrompt, token)));
979
1050
  }
1051
+ selectedRecordOperationalAudienceRequested(normalizedPrompt) {
1052
+ if (!normalizedPrompt)
1053
+ return false;
1054
+ // Post-grounding bridge only: this distinguishes "show people/records like these"
1055
+ // from an informational field question. Canonical filterCandidates still decide
1056
+ // which field can be materialized.
1057
+ return /(^|\s)(gente|pessoas|pessoal)\s+com\s+(os\s+|as\s+)?(mesmos|mesmas|mesmo|mesma)\b/u.test(normalizedPrompt);
1058
+ }
980
1059
  selectedRecordRequestedCommonField(normalizedPrompt, row) {
981
1060
  const candidates = Object.keys(row)
982
1061
  .map((field) => ({
@@ -1260,6 +1339,7 @@ class TableAgenticAuthoringTurnFlow {
1260
1339
  'outro',
1261
1340
  'outros',
1262
1341
  ].some((token) => this.normalizedTextContainsApproxToken(normalized, token))
1342
+ || this.selectedRecordOperationalAudienceRequested(normalized)
1263
1343
  || this.selectedRecordPrepositionalFilterRequested(normalized)
1264
1344
  || this.selectedRecordProximityFilterRequested(normalized);
1265
1345
  }
@@ -1,7 +1,7 @@
1
1
  import { firstValueFrom } from 'rxjs';
2
2
  import { BaseAiAdapter, createComponentAuthoringContext } from '@praxisui/ai';
3
3
  import { deepMerge } from '@praxisui/core';
4
- import { z as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, R as coerceTableComponentEditPlans, W as compileTableComponentEditPlans, G as TASK_PRESETS, $ as getTableComponentEditPlanCapabilities, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-BR_mqg11.mjs';
4
+ import { z as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, R as coerceTableComponentEditPlans, W as compileTableComponentEditPlans, G as TASK_PRESETS, $ as getTableComponentEditPlanCapabilities, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-BvV5U4AY.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 PraxisFilter, n as PraxisFilterWidgetConfigEditor, o as PraxisTable, p as PraxisTableConfigEditor, q as PraxisTableInlineAuthoringEditorComponent, r as PraxisTableToolbar, s as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, t as TABLE_COMPONENT_AI_CAPABILITIES, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, y as TABLE_COMPONENT_EDIT_PLAN_KIND, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, G as TASK_PRESETS, H as TableDefaultsProvider, I as TableRulesEditorComponent, K as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, L as VisualFormulaBuilderComponent, O as buildTableApplyPlan, Q as coerceTableComponentEditPlan, R as coerceTableComponentEditPlans, U as compileTableComponentEditPlan, W as compileTableComponentEditPlans, X as createTableAuthoringDocument, Y as getActionId, Z as getEnum, _ as getTableCapabilities, $ as getTableComponentEditPlanCapabilities, a0 as isTableRendererSupportedByRichContentP0, a1 as mapTableRendererToRichContentP0, a2 as normalizeTableAuthoringDocument, a3 as parseLegacyOrTableDocument, a4 as providePraxisFilterMetadata, a5 as providePraxisTableMetadata, a6 as serializeTableAuthoringDocument, a7 as toCanonicalTableConfig, a8 as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-BR_mqg11.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 PraxisFilter, n as PraxisFilterWidgetConfigEditor, o as PraxisTable, p as PraxisTableConfigEditor, q as PraxisTableInlineAuthoringEditorComponent, r as PraxisTableToolbar, s as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, t as TABLE_COMPONENT_AI_CAPABILITIES, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, y as TABLE_COMPONENT_EDIT_PLAN_KIND, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, G as TASK_PRESETS, H as TableDefaultsProvider, I as TableRulesEditorComponent, K as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, L as VisualFormulaBuilderComponent, O as buildTableApplyPlan, Q as coerceTableComponentEditPlan, R as coerceTableComponentEditPlans, U as compileTableComponentEditPlan, W as compileTableComponentEditPlans, X as createTableAuthoringDocument, Y as getActionId, Z as getEnum, _ as getTableCapabilities, $ as getTableComponentEditPlanCapabilities, a0 as isTableRendererSupportedByRichContentP0, a1 as mapTableRendererToRichContentP0, a2 as normalizeTableAuthoringDocument, a3 as parseLegacyOrTableDocument, a4 as providePraxisFilterMetadata, a5 as providePraxisTableMetadata, a6 as serializeTableAuthoringDocument, a7 as toCanonicalTableConfig, a8 as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-BvV5U4AY.mjs';
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@praxisui/table",
3
- "version": "8.0.0-beta.36",
3
+ "version": "8.0.0-beta.38",
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.36",
9
- "@praxisui/core": "^8.0.0-beta.36",
10
- "@praxisui/dynamic-fields": "^8.0.0-beta.36",
11
- "@praxisui/dynamic-form": "^8.0.0-beta.36",
12
- "@praxisui/metadata-editor": "^8.0.0-beta.36",
13
- "@praxisui/rich-content": "^8.0.0-beta.36",
14
- "@praxisui/settings-panel": "^8.0.0-beta.36",
15
- "@praxisui/table-rule-builder": "^8.0.0-beta.36",
8
+ "@praxisui/ai": "^8.0.0-beta.38",
9
+ "@praxisui/core": "^8.0.0-beta.38",
10
+ "@praxisui/dynamic-fields": "^8.0.0-beta.38",
11
+ "@praxisui/dynamic-form": "^8.0.0-beta.38",
12
+ "@praxisui/metadata-editor": "^8.0.0-beta.38",
13
+ "@praxisui/rich-content": "^8.0.0-beta.38",
14
+ "@praxisui/settings-panel": "^8.0.0-beta.38",
15
+ "@praxisui/table-rule-builder": "^8.0.0-beta.38",
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.36",
20
+ "@praxisui/dialog": "^8.0.0-beta.38",
21
21
  "rxjs": "~7.8.0"
22
22
  },
23
23
  "dependencies": {