@praxisui/table 8.0.0-beta.37 → 8.0.0-beta.39
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/fesm2022/{praxisui-table-praxisui-table-DwRKqWNs.mjs → praxisui-table-praxisui-table-CtVsjv6n.mjs} +2 -2
- package/fesm2022/{praxisui-table-table-agentic-authoring-turn-flow-C1M85Vv8.mjs → praxisui-table-table-agentic-authoring-turn-flow-iAjp_HAv.mjs} +117 -0
- package/fesm2022/{praxisui-table-table-ai.adapter-C9990_QA.mjs → praxisui-table-table-ai.adapter-Bl2QpOfc.mjs} +1 -1
- package/fesm2022/praxisui-table.mjs +1 -1
- package/package.json +10 -10
|
@@ -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-
|
|
39408
|
+
import('./praxisui-table-table-ai.adapter-Bl2QpOfc.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-
|
|
39558
|
+
import('./praxisui-table-table-agentic-authoring-turn-flow-iAjp_HAv.mjs')
|
|
39559
39559
|
.then(({ TableAgenticAuthoringTurnFlow }) => {
|
|
39560
39560
|
if (this.aiAssistantController || !this.aiAdapter)
|
|
39561
39561
|
return;
|
|
@@ -48,6 +48,8 @@ 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.selectedRecordExportOnlyRequest(request, contextHints)
|
|
52
|
+
?? this.selectedRecordSingleCandidateQuestionAnswer(request, contextHints)
|
|
51
53
|
?? this.selectedRecordFieldQuestionAnswer(request, contextHints)
|
|
52
54
|
?? this.selectedRecordMultiFieldQuestionAnswer(request, contextHints)
|
|
53
55
|
?? this.completeSelectedRecordFilterApplyRequest(request, contextHints)
|
|
@@ -740,6 +742,40 @@ class TableAgenticAuthoringTurnFlow {
|
|
|
740
742
|
],
|
|
741
743
|
};
|
|
742
744
|
}
|
|
745
|
+
selectedRecordSingleCandidateQuestionAnswer(request, contextHints) {
|
|
746
|
+
if (this.selectedRecordsCountForTurn !== 1)
|
|
747
|
+
return null;
|
|
748
|
+
const prompt = request.prompt ?? '';
|
|
749
|
+
const normalizedPrompt = this.normalizeLabel(prompt);
|
|
750
|
+
if (!this.selectedRecordInformationalQuestionRequested(normalizedPrompt))
|
|
751
|
+
return null;
|
|
752
|
+
if (this.selectedRecordFilterApplyRequested(prompt))
|
|
753
|
+
return null;
|
|
754
|
+
const candidates = this.selectedRecordFilterCandidates(contextHints)
|
|
755
|
+
.map((candidate) => ({
|
|
756
|
+
candidate,
|
|
757
|
+
score: this.selectedRecordCandidateQuestionScore(normalizedPrompt, candidate),
|
|
758
|
+
}))
|
|
759
|
+
.filter((entry) => entry.score > 0)
|
|
760
|
+
.sort((left, right) => right.score - left.score);
|
|
761
|
+
if (!candidates.length)
|
|
762
|
+
return null;
|
|
763
|
+
if (candidates.length > 1 && candidates[0].score === candidates[1].score)
|
|
764
|
+
return null;
|
|
765
|
+
const candidate = candidates[0].candidate;
|
|
766
|
+
const values = this.selectedRecordCandidateDisplayValues(candidate);
|
|
767
|
+
if (values.length !== 1)
|
|
768
|
+
return null;
|
|
769
|
+
const label = this.selectedRecordCandidateDisplayLabel(candidate);
|
|
770
|
+
return {
|
|
771
|
+
type: 'info',
|
|
772
|
+
message: `${label} do registro selecionado: ${values[0]}.`,
|
|
773
|
+
warnings: [
|
|
774
|
+
'selected-record-candidate-question-answered-locally',
|
|
775
|
+
'Single selected record supplied canonical filterCandidates; local answer used declared filter catalog metadata instead of materializing a table operation.',
|
|
776
|
+
],
|
|
777
|
+
};
|
|
778
|
+
}
|
|
743
779
|
selectedRecordMissingSelectionAnswer(request, contextHints) {
|
|
744
780
|
if (this.selectedRecordsCountForTurn > 0)
|
|
745
781
|
return null;
|
|
@@ -944,17 +980,32 @@ class TableAgenticAuthoringTurnFlow {
|
|
|
944
980
|
let score = 0;
|
|
945
981
|
const candidateLabel = this.stringValue(candidate['label']);
|
|
946
982
|
const field = this.stringValue(candidate['field']);
|
|
983
|
+
const entry = this.filterFieldCatalogEntries.find((candidateEntry) => candidateEntry.name === field);
|
|
947
984
|
score += candidateLabel && this.promptContainsAnyVariant(normalizedPrompt, candidateLabel) ? 70 : 0;
|
|
948
985
|
score += field && this.promptContainsAnyVariant(normalizedPrompt, this.humanizeFilterField(field)) ? 50 : 0;
|
|
949
986
|
for (const value of [
|
|
987
|
+
...this.stringArrayValue(candidate['aliases']),
|
|
988
|
+
...(entry?.aliases ?? []),
|
|
950
989
|
...this.selectedRecordCandidateDisplayValues(candidate),
|
|
951
990
|
...this.stringArrayValue(candidate['relatedColumnLabels']),
|
|
991
|
+
...(entry?.relatedColumnLabels ?? []),
|
|
952
992
|
...this.stringArrayValue(candidate['relatedColumnFields']),
|
|
993
|
+
...(entry?.relatedColumnFields ?? []),
|
|
953
994
|
]) {
|
|
954
995
|
score += this.promptContainsAnyVariant(normalizedPrompt, value) ? 80 : 0;
|
|
955
996
|
}
|
|
956
997
|
return score;
|
|
957
998
|
}
|
|
999
|
+
selectedRecordCandidateDisplayLabel(candidate) {
|
|
1000
|
+
const field = this.stringValue(candidate['field']);
|
|
1001
|
+
const entry = this.filterFieldCatalogEntries.find((candidateEntry) => candidateEntry.name === field);
|
|
1002
|
+
return this.stringArrayValue(candidate['relatedColumnLabels'])[0]
|
|
1003
|
+
|| entry?.relatedColumnLabels[0]
|
|
1004
|
+
|| this.stringValue(candidate['label'])
|
|
1005
|
+
|| entry?.label
|
|
1006
|
+
|| this.humanizeFilterField(field)
|
|
1007
|
+
|| 'Campo';
|
|
1008
|
+
}
|
|
958
1009
|
selectedRecordCandidateDisplayValues(candidate) {
|
|
959
1010
|
const displayValues = Array.isArray(candidate['displayValues'])
|
|
960
1011
|
? candidate['displayValues']
|
|
@@ -1194,6 +1245,29 @@ class TableAgenticAuthoringTurnFlow {
|
|
|
1194
1245
|
warnings,
|
|
1195
1246
|
};
|
|
1196
1247
|
}
|
|
1248
|
+
selectedRecordExportOnlyRequest(request, contextHints) {
|
|
1249
|
+
if (this.selectedRecordsCountForTurn <= 0)
|
|
1250
|
+
return null;
|
|
1251
|
+
const prompt = this.selectedRecordFilterGroundingPrompt(request, contextHints);
|
|
1252
|
+
if (!this.selectedRecordPureExportRequested(prompt, contextHints))
|
|
1253
|
+
return null;
|
|
1254
|
+
const exportOperation = this.selectedRecordRequestedExportOperation(request, contextHints, 'selected');
|
|
1255
|
+
if (!exportOperation)
|
|
1256
|
+
return null;
|
|
1257
|
+
const format = this.stringValue(this.toRecord(exportOperation['input'])?.['format']).toUpperCase();
|
|
1258
|
+
return {
|
|
1259
|
+
type: 'patch',
|
|
1260
|
+
tableRuntimeOperations: {
|
|
1261
|
+
kind: 'praxis.table.runtime-operation.batch',
|
|
1262
|
+
operations: [exportOperation],
|
|
1263
|
+
},
|
|
1264
|
+
explanation: `Vou exportar as linhas selecionadas${format ? ` em ${format}` : ''}.`,
|
|
1265
|
+
warnings: [
|
|
1266
|
+
'selected-record-export-request-materialized',
|
|
1267
|
+
'Selected records supplied runtime context; prompt requested export with an explicit format and no selected-record filter target.',
|
|
1268
|
+
],
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1197
1271
|
selectedRecordRequestedExportOperation(request, contextHints, scope) {
|
|
1198
1272
|
if (!request || !this.tableRuntimeOperationAllowed(contextHints, 'table.export.run'))
|
|
1199
1273
|
return null;
|
|
@@ -1238,6 +1312,49 @@ class TableAgenticAuthoringTurnFlow {
|
|
|
1238
1312
|
return 'print';
|
|
1239
1313
|
return null;
|
|
1240
1314
|
}
|
|
1315
|
+
selectedRecordPureExportRequested(prompt, contextHints) {
|
|
1316
|
+
const normalized = this.normalizeLabel(prompt);
|
|
1317
|
+
if (!normalized || !this.resolveRuntimeExportFormat(prompt))
|
|
1318
|
+
return false;
|
|
1319
|
+
if (!this.tableRuntimeOperationAllowed(contextHints, 'table.export.run'))
|
|
1320
|
+
return false;
|
|
1321
|
+
const hasExportIntent = [
|
|
1322
|
+
'exportar',
|
|
1323
|
+
'exporte',
|
|
1324
|
+
'exporta',
|
|
1325
|
+
'baixar',
|
|
1326
|
+
'baixe',
|
|
1327
|
+
'baixa',
|
|
1328
|
+
'download',
|
|
1329
|
+
'gerar',
|
|
1330
|
+
'gere',
|
|
1331
|
+
'gera',
|
|
1332
|
+
].some((token) => this.normalizedTextContainsApproxToken(normalized, token));
|
|
1333
|
+
if (!hasExportIntent)
|
|
1334
|
+
return false;
|
|
1335
|
+
const hasFilterIntent = [
|
|
1336
|
+
'filtrar',
|
|
1337
|
+
'filtre',
|
|
1338
|
+
'filtra',
|
|
1339
|
+
'buscar',
|
|
1340
|
+
'busque',
|
|
1341
|
+
'busca',
|
|
1342
|
+
'procurar',
|
|
1343
|
+
'procure',
|
|
1344
|
+
'procura',
|
|
1345
|
+
'mostrar',
|
|
1346
|
+
'mostre',
|
|
1347
|
+
'mostra',
|
|
1348
|
+
'parecido',
|
|
1349
|
+
'parecidos',
|
|
1350
|
+
'semelhante',
|
|
1351
|
+
'semelhantes',
|
|
1352
|
+
].some((token) => this.normalizedTextContainsApproxToken(normalized, token));
|
|
1353
|
+
if (hasFilterIntent)
|
|
1354
|
+
return false;
|
|
1355
|
+
return !this.selectedRecordFilterCandidates(contextHints)
|
|
1356
|
+
.some((candidate) => this.promptMentionsFilterField(prompt, this.stringValue(candidate['field'])));
|
|
1357
|
+
}
|
|
1241
1358
|
selectedRecordFilterGroundingPrompt(request, contextHints) {
|
|
1242
1359
|
const pendingClarification = this.toRecord(contextHints?.['pendingClarification'])
|
|
1243
1360
|
?? this.toRecord(request.pendingClarification);
|
|
@@ -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-
|
|
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-CtVsjv6n.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-
|
|
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-CtVsjv6n.mjs';
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/table",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.39",
|
|
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.
|
|
9
|
-
"@praxisui/core": "^8.0.0-beta.
|
|
10
|
-
"@praxisui/dynamic-fields": "^8.0.0-beta.
|
|
11
|
-
"@praxisui/dynamic-form": "^8.0.0-beta.
|
|
12
|
-
"@praxisui/metadata-editor": "^8.0.0-beta.
|
|
13
|
-
"@praxisui/rich-content": "^8.0.0-beta.
|
|
14
|
-
"@praxisui/settings-panel": "^8.0.0-beta.
|
|
15
|
-
"@praxisui/table-rule-builder": "^8.0.0-beta.
|
|
8
|
+
"@praxisui/ai": "^8.0.0-beta.39",
|
|
9
|
+
"@praxisui/core": "^8.0.0-beta.39",
|
|
10
|
+
"@praxisui/dynamic-fields": "^8.0.0-beta.39",
|
|
11
|
+
"@praxisui/dynamic-form": "^8.0.0-beta.39",
|
|
12
|
+
"@praxisui/metadata-editor": "^8.0.0-beta.39",
|
|
13
|
+
"@praxisui/rich-content": "^8.0.0-beta.39",
|
|
14
|
+
"@praxisui/settings-panel": "^8.0.0-beta.39",
|
|
15
|
+
"@praxisui/table-rule-builder": "^8.0.0-beta.39",
|
|
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.
|
|
20
|
+
"@praxisui/dialog": "^8.0.0-beta.39",
|
|
21
21
|
"rxjs": "~7.8.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|