@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 +41 -4
- package/fesm2022/{praxisui-table-praxisui-table-DFBE5wpp.mjs → praxisui-table-praxisui-table-qO5EkftZ.mjs} +691 -34
- package/fesm2022/praxisui-table-table-agentic-authoring-turn-flow-CretQI6Z.mjs +847 -0
- package/fesm2022/{praxisui-table-table-ai.adapter-7THXe94D.mjs → praxisui-table-table-ai.adapter-DkMHa90r.mjs} +215 -94
- package/fesm2022/praxisui-table.mjs +1 -1
- package/index.d.ts +26 -8
- package/package.json +10 -10
- package/src/lib/praxis-table.json-api.md +2 -1
- package/fesm2022/praxisui-table-table-agentic-authoring-turn-flow-EigJf8mp.mjs +0 -335
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { firstValueFrom } from 'rxjs';
|
|
2
|
-
import { BaseAiAdapter } from '@praxisui/ai';
|
|
2
|
+
import { BaseAiAdapter, createComponentAuthoringContext } from '@praxisui/ai';
|
|
3
3
|
import { deepMerge } from '@praxisui/core';
|
|
4
|
-
import { T as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, P as PRAXIS_TABLE_AUTHORING_MANIFEST, a as TABLE_AI_CAPABILITIES, c as coerceTableComponentEditPlans, b as compileTableComponentEditPlans, d as TASK_PRESETS, g as getTableComponentEditPlanCapabilities, e as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, f as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, h as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, i as TABLE_COMPONENT_EDIT_PLAN_VERSION, j as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, k as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-
|
|
4
|
+
import { T as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, P as PRAXIS_TABLE_AUTHORING_MANIFEST, a as TABLE_AI_CAPABILITIES, c as coerceTableComponentEditPlans, b as compileTableComponentEditPlans, d as TASK_PRESETS, g as getTableComponentEditPlanCapabilities, e as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, f as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, h as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, i as TABLE_COMPONENT_EDIT_PLAN_VERSION, j as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, k as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-qO5EkftZ.mjs';
|
|
5
5
|
|
|
6
6
|
const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
7
7
|
version: 'v1',
|
|
@@ -575,7 +575,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
575
575
|
// --- Column Management ---
|
|
576
576
|
{
|
|
577
577
|
id: 'ADD_COLUMN',
|
|
578
|
-
|
|
578
|
+
intentExamples: ['add column', 'nova coluna', 'criar coluna', 'insert column'],
|
|
579
579
|
scope: 'GLOBAL',
|
|
580
580
|
valueType: 'OBJECT',
|
|
581
581
|
operation: 'create',
|
|
@@ -596,7 +596,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
596
596
|
},
|
|
597
597
|
{
|
|
598
598
|
id: 'ADD_COLUMN_COMPUTED',
|
|
599
|
-
|
|
599
|
+
intentExamples: ['calculated column', 'coluna calculada', 'compute', 'formula', 'expression'],
|
|
600
600
|
scope: 'GLOBAL',
|
|
601
601
|
valueType: 'OBJECT',
|
|
602
602
|
operation: 'create',
|
|
@@ -624,7 +624,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
624
624
|
},
|
|
625
625
|
{
|
|
626
626
|
id: 'HIDE_COLUMN',
|
|
627
|
-
|
|
627
|
+
intentExamples: ['hide column', 'ocultar coluna', 'esconder coluna', 'invisible'],
|
|
628
628
|
scope: 'COLUMN',
|
|
629
629
|
valueType: 'BOOLEAN',
|
|
630
630
|
operation: 'update',
|
|
@@ -636,7 +636,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
636
636
|
},
|
|
637
637
|
{
|
|
638
638
|
id: 'SHOW_COLUMN',
|
|
639
|
-
|
|
639
|
+
intentExamples: ['show column', 'mostrar coluna', 'exibir coluna', 'visible'],
|
|
640
640
|
scope: 'COLUMN',
|
|
641
641
|
valueType: 'BOOLEAN',
|
|
642
642
|
operation: 'update',
|
|
@@ -648,7 +648,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
648
648
|
},
|
|
649
649
|
{
|
|
650
650
|
id: 'RENAME_COLUMN',
|
|
651
|
-
|
|
651
|
+
intentExamples: ['rename column', 'renomear coluna', 'titulo', 'cabecalho'],
|
|
652
652
|
scope: 'COLUMN',
|
|
653
653
|
valueType: 'STRING',
|
|
654
654
|
operation: 'update',
|
|
@@ -659,7 +659,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
659
659
|
},
|
|
660
660
|
{
|
|
661
661
|
id: 'column.format.set',
|
|
662
|
-
|
|
662
|
+
intentExamples: ['format', 'formatar', 'date format', 'number format'],
|
|
663
663
|
scope: 'COLUMN',
|
|
664
664
|
valueType: 'ENUM',
|
|
665
665
|
operation: 'update',
|
|
@@ -670,7 +670,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
670
670
|
},
|
|
671
671
|
{
|
|
672
672
|
id: 'column.type.set',
|
|
673
|
-
|
|
673
|
+
intentExamples: ['type', 'tipo', 'data type'],
|
|
674
674
|
scope: 'COLUMN',
|
|
675
675
|
valueType: 'ENUM',
|
|
676
676
|
operation: 'update',
|
|
@@ -681,7 +681,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
681
681
|
},
|
|
682
682
|
{
|
|
683
683
|
id: 'DISABLE_SORT',
|
|
684
|
-
|
|
684
|
+
intentExamples: ['disable sort', 'desativar ordenacao', 'sem ordenacao'],
|
|
685
685
|
scope: 'COLUMN',
|
|
686
686
|
valueType: 'BOOLEAN',
|
|
687
687
|
operation: 'update',
|
|
@@ -693,7 +693,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
693
693
|
},
|
|
694
694
|
{
|
|
695
695
|
id: 'ENABLE_SORT',
|
|
696
|
-
|
|
696
|
+
intentExamples: ['enable sort', 'ativar ordenacao'],
|
|
697
697
|
scope: 'COLUMN',
|
|
698
698
|
valueType: 'BOOLEAN',
|
|
699
699
|
operation: 'update',
|
|
@@ -705,7 +705,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
705
705
|
},
|
|
706
706
|
{
|
|
707
707
|
id: 'column.width.set',
|
|
708
|
-
|
|
708
|
+
intentExamples: ['width', 'largura', 'col width'],
|
|
709
709
|
scope: 'COLUMN',
|
|
710
710
|
valueType: 'STRING',
|
|
711
711
|
operation: 'update',
|
|
@@ -716,7 +716,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
716
716
|
},
|
|
717
717
|
{
|
|
718
718
|
id: 'column.align.set',
|
|
719
|
-
|
|
719
|
+
intentExamples: ['align', 'alinhamento', 'left', 'center', 'right'],
|
|
720
720
|
scope: 'COLUMN',
|
|
721
721
|
valueType: 'ENUM',
|
|
722
722
|
operation: 'update',
|
|
@@ -727,7 +727,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
727
727
|
},
|
|
728
728
|
{
|
|
729
729
|
id: 'column.sticky.set',
|
|
730
|
-
|
|
730
|
+
intentExamples: ['sticky', 'fixar coluna', 'pin column'],
|
|
731
731
|
scope: 'COLUMN',
|
|
732
732
|
valueType: 'ENUM',
|
|
733
733
|
operation: 'update',
|
|
@@ -738,7 +738,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
738
738
|
},
|
|
739
739
|
{
|
|
740
740
|
id: 'column.renderer.type.set',
|
|
741
|
-
|
|
741
|
+
intentExamples: ['renderer', 'render', 'cell type'],
|
|
742
742
|
scope: 'COLUMN',
|
|
743
743
|
valueType: 'ENUM',
|
|
744
744
|
operation: 'update',
|
|
@@ -749,7 +749,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
749
749
|
},
|
|
750
750
|
{
|
|
751
751
|
id: 'column.renderer.image.shape.set',
|
|
752
|
-
|
|
752
|
+
intentExamples: ['image shape', 'avatar shape', 'imagem recorte'],
|
|
753
753
|
scope: 'COLUMN',
|
|
754
754
|
valueType: 'ENUM',
|
|
755
755
|
operation: 'update',
|
|
@@ -765,7 +765,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
765
765
|
},
|
|
766
766
|
{
|
|
767
767
|
id: 'column.renderer.link.target.set',
|
|
768
|
-
|
|
768
|
+
intentExamples: ['link target', 'abrir em nova aba', 'target blank'],
|
|
769
769
|
scope: 'COLUMN',
|
|
770
770
|
valueType: 'ENUM',
|
|
771
771
|
operation: 'update',
|
|
@@ -781,7 +781,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
781
781
|
},
|
|
782
782
|
{
|
|
783
783
|
id: 'column.renderer.button.style.set',
|
|
784
|
-
|
|
784
|
+
intentExamples: ['button style', 'botao estilo', 'variant', 'color'],
|
|
785
785
|
scope: 'COLUMN',
|
|
786
786
|
valueType: 'OBJECT', // Uses params
|
|
787
787
|
operation: 'update',
|
|
@@ -804,7 +804,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
804
804
|
// --- Rich Renderers (Badges/Icons/Chips) ---
|
|
805
805
|
{
|
|
806
806
|
id: 'SET_RENDERER_BADGE',
|
|
807
|
-
|
|
807
|
+
intentExamples: ['render badge', 'exibir como badge', 'status badge', 'etiqueta', 'tag'],
|
|
808
808
|
scope: 'COLUMN',
|
|
809
809
|
valueType: 'OBJECT',
|
|
810
810
|
operation: 'update',
|
|
@@ -842,7 +842,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
842
842
|
},
|
|
843
843
|
{
|
|
844
844
|
id: 'SET_RENDERER_CHIP',
|
|
845
|
-
|
|
845
|
+
intentExamples: ['render chip', 'exibir como chip', 'chip', 'pilula'],
|
|
846
846
|
scope: 'COLUMN',
|
|
847
847
|
valueType: 'OBJECT',
|
|
848
848
|
operation: 'update',
|
|
@@ -865,7 +865,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
865
865
|
},
|
|
866
866
|
{
|
|
867
867
|
id: 'SET_RENDERER_ICON',
|
|
868
|
-
|
|
868
|
+
intentExamples: ['render icon', 'exibir como icone', 'icone', 'icon'],
|
|
869
869
|
scope: 'COLUMN',
|
|
870
870
|
valueType: 'OBJECT',
|
|
871
871
|
operation: 'update',
|
|
@@ -889,7 +889,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
889
889
|
// --- Compose Renderer Shortcuts ---
|
|
890
890
|
{
|
|
891
891
|
id: 'SET_RENDERER_COMPOSE_TITLE_SUBTITLE',
|
|
892
|
-
|
|
892
|
+
intentExamples: ['compose title subtitle', 'titulo e subtitulo', 'two lines', 'duas linhas'],
|
|
893
893
|
scope: 'COLUMN',
|
|
894
894
|
valueType: 'OBJECT',
|
|
895
895
|
operation: 'update',
|
|
@@ -914,7 +914,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
914
914
|
},
|
|
915
915
|
{
|
|
916
916
|
id: 'SET_RENDERER_COMPOSE_AVATAR_TEXT',
|
|
917
|
-
|
|
917
|
+
intentExamples: ['compose avatar text', 'avatar e texto', 'user card'],
|
|
918
918
|
scope: 'COLUMN',
|
|
919
919
|
valueType: 'OBJECT',
|
|
920
920
|
operation: 'update',
|
|
@@ -928,7 +928,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
928
928
|
compose: {
|
|
929
929
|
layout: { direction: 'row', gap: 12, align: 'center' },
|
|
930
930
|
items: [
|
|
931
|
-
{ type: 'avatar', avatar: {
|
|
931
|
+
{ type: 'avatar', avatar: { srcField: '{{params.imageField}}', initialsField: '{{target}}', shape: 'circle' } },
|
|
932
932
|
{ type: 'compose', compose: {
|
|
933
933
|
layout: { direction: 'column', gap: 2 },
|
|
934
934
|
items: [
|
|
@@ -946,7 +946,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
946
946
|
},
|
|
947
947
|
{
|
|
948
948
|
id: 'ENABLE_PAGINATION',
|
|
949
|
-
|
|
949
|
+
intentExamples: ['enable pagination', 'paginar', 'paginação', 'pagination'],
|
|
950
950
|
scope: 'GLOBAL',
|
|
951
951
|
valueType: 'BOOLEAN',
|
|
952
952
|
operation: 'update',
|
|
@@ -958,7 +958,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
958
958
|
},
|
|
959
959
|
{
|
|
960
960
|
id: 'DISABLE_PAGINATION',
|
|
961
|
-
|
|
961
|
+
intentExamples: ['disable pagination', 'remover paginacao', 'lista infinita', 'no pagination'],
|
|
962
962
|
scope: 'GLOBAL',
|
|
963
963
|
valueType: 'BOOLEAN',
|
|
964
964
|
operation: 'update',
|
|
@@ -970,7 +970,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
970
970
|
},
|
|
971
971
|
{
|
|
972
972
|
id: 'ENABLE_FILTERING',
|
|
973
|
-
|
|
973
|
+
intentExamples: ['enable filtering', 'ligar filtros', 'filtrar', 'searchable'],
|
|
974
974
|
scope: 'GLOBAL',
|
|
975
975
|
valueType: 'BOOLEAN',
|
|
976
976
|
operation: 'update',
|
|
@@ -982,7 +982,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
982
982
|
},
|
|
983
983
|
{
|
|
984
984
|
id: 'DISABLE_FILTERING',
|
|
985
|
-
|
|
985
|
+
intentExamples: ['disable filtering', 'desligar filtros', 'no filter'],
|
|
986
986
|
scope: 'GLOBAL',
|
|
987
987
|
valueType: 'BOOLEAN',
|
|
988
988
|
operation: 'update',
|
|
@@ -995,7 +995,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
995
995
|
// --- Advanced Filters ---
|
|
996
996
|
{
|
|
997
997
|
id: 'ENABLE_ADVANCED_FILTERS',
|
|
998
|
-
|
|
998
|
+
intentExamples: ['advanced filters', 'filtros avancados', 'filtro complexo'],
|
|
999
999
|
scope: 'GLOBAL',
|
|
1000
1000
|
valueType: 'BOOLEAN',
|
|
1001
1001
|
operation: 'update',
|
|
@@ -1007,7 +1007,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1007
1007
|
},
|
|
1008
1008
|
{
|
|
1009
1009
|
id: 'SET_FILTER_MODE',
|
|
1010
|
-
|
|
1010
|
+
intentExamples: ['filter mode', 'modo de filtro', 'modo unico do filtro', 'painel de filtro'],
|
|
1011
1011
|
scope: 'GLOBAL',
|
|
1012
1012
|
valueType: 'ENUM',
|
|
1013
1013
|
operation: 'update',
|
|
@@ -1018,7 +1018,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1018
1018
|
},
|
|
1019
1019
|
{
|
|
1020
1020
|
id: 'SET_ALWAYS_VISIBLE_FILTERS',
|
|
1021
|
-
|
|
1021
|
+
intentExamples: ['always visible filter', 'filtro fixo', 'fixar filtro', 'pin filter'],
|
|
1022
1022
|
scope: 'GLOBAL', // Global mas referencia coluna
|
|
1023
1023
|
valueType: 'STRING', // Array na vdd
|
|
1024
1024
|
operation: 'update',
|
|
@@ -1029,7 +1029,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1029
1029
|
},
|
|
1030
1030
|
{
|
|
1031
1031
|
id: 'ENABLE_FILTER_SAVING',
|
|
1032
|
-
|
|
1032
|
+
intentExamples: ['save filters', 'salvar filtros', 'filter tags'],
|
|
1033
1033
|
scope: 'GLOBAL',
|
|
1034
1034
|
valueType: 'BOOLEAN',
|
|
1035
1035
|
operation: 'update',
|
|
@@ -1041,7 +1041,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1041
1041
|
},
|
|
1042
1042
|
{
|
|
1043
1043
|
id: 'ENABLE_SORTING',
|
|
1044
|
-
|
|
1044
|
+
intentExamples: ['enable sorting', 'ligar ordenacao', 'ordenar'],
|
|
1045
1045
|
scope: 'GLOBAL',
|
|
1046
1046
|
valueType: 'BOOLEAN',
|
|
1047
1047
|
operation: 'update',
|
|
@@ -1053,7 +1053,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1053
1053
|
},
|
|
1054
1054
|
{
|
|
1055
1055
|
id: 'DISABLE_SORTING',
|
|
1056
|
-
|
|
1056
|
+
intentExamples: ['disable sorting', 'desligar ordenacao', 'no sort'],
|
|
1057
1057
|
scope: 'GLOBAL',
|
|
1058
1058
|
valueType: 'BOOLEAN',
|
|
1059
1059
|
operation: 'update',
|
|
@@ -1066,7 +1066,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1066
1066
|
// --- Selection ---
|
|
1067
1067
|
{
|
|
1068
1068
|
id: 'ENABLE_SELECTION',
|
|
1069
|
-
|
|
1069
|
+
intentExamples: ['enable selection', 'ativar selecao', 'selecionavel', 'selectable'],
|
|
1070
1070
|
scope: 'GLOBAL',
|
|
1071
1071
|
valueType: 'BOOLEAN',
|
|
1072
1072
|
operation: 'update',
|
|
@@ -1078,7 +1078,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1078
1078
|
},
|
|
1079
1079
|
{
|
|
1080
1080
|
id: 'DISABLE_SELECTION',
|
|
1081
|
-
|
|
1081
|
+
intentExamples: ['disable selection', 'remover selecao', 'not selectable'],
|
|
1082
1082
|
scope: 'GLOBAL',
|
|
1083
1083
|
valueType: 'BOOLEAN',
|
|
1084
1084
|
operation: 'update',
|
|
@@ -1090,7 +1090,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1090
1090
|
},
|
|
1091
1091
|
{
|
|
1092
1092
|
id: 'SET_SELECTION_SINGLE',
|
|
1093
|
-
|
|
1093
|
+
intentExamples: ['single selection', 'selecao unica', 'selecionar um'],
|
|
1094
1094
|
scope: 'GLOBAL',
|
|
1095
1095
|
valueType: 'ENUM',
|
|
1096
1096
|
operation: 'update',
|
|
@@ -1102,7 +1102,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1102
1102
|
},
|
|
1103
1103
|
{
|
|
1104
1104
|
id: 'SET_SELECTION_MULTIPLE',
|
|
1105
|
-
|
|
1105
|
+
intentExamples: ['multiple selection', 'selecao multipla', 'selecionar varios'],
|
|
1106
1106
|
scope: 'GLOBAL',
|
|
1107
1107
|
valueType: 'ENUM',
|
|
1108
1108
|
operation: 'update',
|
|
@@ -1115,7 +1115,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1115
1115
|
// --- Export ---
|
|
1116
1116
|
{
|
|
1117
1117
|
id: 'ENABLE_EXPORT',
|
|
1118
|
-
|
|
1118
|
+
intentExamples: ['enable export', 'ativar exportacao', 'botão exportar', 'excel', 'pdf'],
|
|
1119
1119
|
scope: 'GLOBAL',
|
|
1120
1120
|
valueType: 'BOOLEAN',
|
|
1121
1121
|
operation: 'update',
|
|
@@ -1128,7 +1128,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1128
1128
|
},
|
|
1129
1129
|
{
|
|
1130
1130
|
id: 'DISABLE_EXPORT',
|
|
1131
|
-
|
|
1131
|
+
intentExamples: ['disable export', 'remover exportacao', 'esconder exportar'],
|
|
1132
1132
|
scope: 'GLOBAL',
|
|
1133
1133
|
valueType: 'BOOLEAN',
|
|
1134
1134
|
operation: 'update',
|
|
@@ -1141,7 +1141,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1141
1141
|
// --- Appearance ---
|
|
1142
1142
|
{
|
|
1143
1143
|
id: 'SET_DENSITY',
|
|
1144
|
-
|
|
1144
|
+
intentExamples: ['set density', 'mudar densidade', 'compacto', 'confortavel', 'espacoso'],
|
|
1145
1145
|
scope: 'GLOBAL',
|
|
1146
1146
|
valueType: 'ENUM',
|
|
1147
1147
|
operation: 'update',
|
|
@@ -1152,7 +1152,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1152
1152
|
},
|
|
1153
1153
|
{
|
|
1154
1154
|
id: 'SHOW_BORDERS',
|
|
1155
|
-
|
|
1155
|
+
intentExamples: ['show borders', 'mostrar bordas', 'com bordas', 'grid lines'],
|
|
1156
1156
|
scope: 'GLOBAL',
|
|
1157
1157
|
valueType: 'BOOLEAN',
|
|
1158
1158
|
operation: 'update',
|
|
@@ -1164,7 +1164,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1164
1164
|
},
|
|
1165
1165
|
{
|
|
1166
1166
|
id: 'HIDE_BORDERS',
|
|
1167
|
-
|
|
1167
|
+
intentExamples: ['hide borders', 'ocultar bordas', 'sem bordas', 'clean look'],
|
|
1168
1168
|
scope: 'GLOBAL',
|
|
1169
1169
|
valueType: 'BOOLEAN',
|
|
1170
1170
|
operation: 'update',
|
|
@@ -1176,7 +1176,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1176
1176
|
},
|
|
1177
1177
|
{
|
|
1178
1178
|
id: 'ENABLE_STRIPED_ROWS',
|
|
1179
|
-
|
|
1179
|
+
intentExamples: ['striped rows', 'zebrado', 'linhas alternadas', 'zebra'],
|
|
1180
1180
|
scope: 'GLOBAL',
|
|
1181
1181
|
valueType: 'BOOLEAN',
|
|
1182
1182
|
operation: 'update',
|
|
@@ -1188,7 +1188,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1188
1188
|
},
|
|
1189
1189
|
{
|
|
1190
1190
|
id: 'DISABLE_STRIPED_ROWS',
|
|
1191
|
-
|
|
1191
|
+
intentExamples: ['disable striped', 'remover zebrado', 'fundo solido'],
|
|
1192
1192
|
scope: 'GLOBAL',
|
|
1193
1193
|
valueType: 'BOOLEAN',
|
|
1194
1194
|
operation: 'update',
|
|
@@ -1201,7 +1201,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1201
1201
|
// --- Toolbar ---
|
|
1202
1202
|
{
|
|
1203
1203
|
id: 'SHOW_TOOLBAR',
|
|
1204
|
-
|
|
1204
|
+
intentExamples: ['show toolbar', 'mostrar toolbar', 'barra de ferramentas', 'titulo da tabela'],
|
|
1205
1205
|
scope: 'GLOBAL',
|
|
1206
1206
|
valueType: 'BOOLEAN',
|
|
1207
1207
|
operation: 'update',
|
|
@@ -1213,7 +1213,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1213
1213
|
},
|
|
1214
1214
|
{
|
|
1215
1215
|
id: 'HIDE_TOOLBAR',
|
|
1216
|
-
|
|
1216
|
+
intentExamples: ['hide toolbar', 'esconder toolbar', 'remover titulo'],
|
|
1217
1217
|
scope: 'GLOBAL',
|
|
1218
1218
|
valueType: 'BOOLEAN',
|
|
1219
1219
|
operation: 'update',
|
|
@@ -1225,7 +1225,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1225
1225
|
},
|
|
1226
1226
|
{
|
|
1227
1227
|
id: 'SET_TOOLBAR_POSITION',
|
|
1228
|
-
|
|
1228
|
+
intentExamples: ['toolbar position', 'posicao da toolbar', 'toolbar no topo', 'toolbar embaixo', 'toolbar em cima', 'toolbar ambos'],
|
|
1229
1229
|
scope: 'GLOBAL',
|
|
1230
1230
|
valueType: 'ENUM',
|
|
1231
1231
|
operation: 'update',
|
|
@@ -1236,7 +1236,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1236
1236
|
},
|
|
1237
1237
|
{
|
|
1238
1238
|
id: 'SET_TOOLBAR_ACTIONS_POSITION',
|
|
1239
|
-
|
|
1239
|
+
intentExamples: ['acoes da toolbar', 'barra de acoes', 'acoes no topo', 'acoes embaixo', 'acoes em cima', 'acoes em ambos'],
|
|
1240
1240
|
scope: 'GLOBAL',
|
|
1241
1241
|
valueType: 'ENUM',
|
|
1242
1242
|
operation: 'update',
|
|
@@ -1247,7 +1247,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1247
1247
|
},
|
|
1248
1248
|
{
|
|
1249
1249
|
id: 'SET_TOOLBAR_ACTIONS_BG',
|
|
1250
|
-
|
|
1250
|
+
intentExamples: ['cor barra de acoes', 'fundo da barra de acoes', 'background acoes', 'acoes com cor'],
|
|
1251
1251
|
scope: 'GLOBAL',
|
|
1252
1252
|
valueType: 'STRING',
|
|
1253
1253
|
operation: 'update',
|
|
@@ -1259,7 +1259,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1259
1259
|
// --- Virtualization (Performance) ---
|
|
1260
1260
|
{
|
|
1261
1261
|
id: 'ENABLE_VIRTUALIZATION',
|
|
1262
|
-
|
|
1262
|
+
intentExamples: ['enable virtualization', 'virtualizar', 'scroll infinito', 'performance', 'large dataset'],
|
|
1263
1263
|
scope: 'GLOBAL',
|
|
1264
1264
|
valueType: 'BOOLEAN',
|
|
1265
1265
|
operation: 'update',
|
|
@@ -1272,7 +1272,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1272
1272
|
},
|
|
1273
1273
|
{
|
|
1274
1274
|
id: 'DISABLE_VIRTUALIZATION',
|
|
1275
|
-
|
|
1275
|
+
intentExamples: ['disable virtualization', 'desativar virtualizacao'],
|
|
1276
1276
|
scope: 'GLOBAL',
|
|
1277
1277
|
valueType: 'BOOLEAN',
|
|
1278
1278
|
operation: 'update',
|
|
@@ -1286,7 +1286,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1286
1286
|
// --- Row expansion (Schema-Driven detail) ---
|
|
1287
1287
|
{
|
|
1288
1288
|
id: 'ENABLE_ROW_EXPANSION',
|
|
1289
|
-
|
|
1289
|
+
intentExamples: ['expand row', 'expandir linha', 'detalhe expansivel', 'row details', 'master detail'],
|
|
1290
1290
|
scope: 'GLOBAL',
|
|
1291
1291
|
valueType: 'BOOLEAN',
|
|
1292
1292
|
operation: 'update',
|
|
@@ -1310,7 +1310,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1310
1310
|
},
|
|
1311
1311
|
{
|
|
1312
1312
|
id: 'SET_EXPANSION_SOURCE_MODE',
|
|
1313
|
-
|
|
1313
|
+
intentExamples: ['expansion source', 'detail source', 'schema source', 'resource detail', 'resourcePath detail'],
|
|
1314
1314
|
scope: 'GLOBAL',
|
|
1315
1315
|
valueType: 'ENUM',
|
|
1316
1316
|
operation: 'update',
|
|
@@ -1321,7 +1321,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1321
1321
|
},
|
|
1322
1322
|
{
|
|
1323
1323
|
id: 'SET_EXPANSION_RESOURCE',
|
|
1324
|
-
|
|
1324
|
+
intentExamples: ['detail resource id', 'resource detail id', 'ui composition detail', 'schema detail resource'],
|
|
1325
1325
|
scope: 'GLOBAL',
|
|
1326
1326
|
valueType: 'OBJECT',
|
|
1327
1327
|
operation: 'update',
|
|
@@ -1346,7 +1346,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1346
1346
|
// --- Fine-grained Styles (Columns/Headers) ---
|
|
1347
1347
|
{
|
|
1348
1348
|
id: 'SET_COLUMN_BOLD',
|
|
1349
|
-
|
|
1349
|
+
intentExamples: ['column bold', 'coluna negrito', 'destacar coluna', 'bold text'],
|
|
1350
1350
|
scope: 'COLUMN',
|
|
1351
1351
|
valueType: 'STRING',
|
|
1352
1352
|
operation: 'update',
|
|
@@ -1357,7 +1357,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1357
1357
|
},
|
|
1358
1358
|
{
|
|
1359
1359
|
id: 'SET_COLUMN_COLOR',
|
|
1360
|
-
|
|
1360
|
+
intentExamples: ['column color', 'cor da coluna', 'pintar coluna', 'text color'],
|
|
1361
1361
|
scope: 'COLUMN',
|
|
1362
1362
|
valueType: 'STRING',
|
|
1363
1363
|
operation: 'update',
|
|
@@ -1368,7 +1368,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1368
1368
|
},
|
|
1369
1369
|
{
|
|
1370
1370
|
id: 'SET_HEADER_UPPERCASE',
|
|
1371
|
-
|
|
1371
|
+
intentExamples: ['header uppercase', 'cabecalho maiuscula', 'titulo caixa alta'],
|
|
1372
1372
|
scope: 'COLUMN',
|
|
1373
1373
|
valueType: 'STRING',
|
|
1374
1374
|
operation: 'update',
|
|
@@ -1379,7 +1379,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1379
1379
|
},
|
|
1380
1380
|
{
|
|
1381
1381
|
id: 'SET_HEADER_BOLD',
|
|
1382
|
-
|
|
1382
|
+
intentExamples: ['header bold', 'cabecalho negrito', 'titulo forte'],
|
|
1383
1383
|
scope: 'COLUMN',
|
|
1384
1384
|
valueType: 'STRING',
|
|
1385
1385
|
operation: 'update',
|
|
@@ -1390,7 +1390,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1390
1390
|
},
|
|
1391
1391
|
{
|
|
1392
1392
|
id: 'SET_HEADER_BG_COLOR',
|
|
1393
|
-
|
|
1393
|
+
intentExamples: ['header background', 'fundo cabecalho', 'cor titulo'],
|
|
1394
1394
|
scope: 'COLUMN',
|
|
1395
1395
|
valueType: 'STRING',
|
|
1396
1396
|
operation: 'update',
|
|
@@ -1401,7 +1401,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1401
1401
|
},
|
|
1402
1402
|
{
|
|
1403
1403
|
id: 'SET_HEADER_TEXT_COLOR',
|
|
1404
|
-
|
|
1404
|
+
intentExamples: ['header text color', 'cor texto cabecalho'],
|
|
1405
1405
|
scope: 'COLUMN',
|
|
1406
1406
|
valueType: 'STRING',
|
|
1407
1407
|
operation: 'update',
|
|
@@ -1413,7 +1413,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1413
1413
|
// --- Toolbar Layout ---
|
|
1414
1414
|
{
|
|
1415
1415
|
id: 'SET_TOOLBAR_ALIGNMENT',
|
|
1416
|
-
|
|
1416
|
+
intentExamples: ['toolbar align', 'alinhar toolbar', 'alinhamento barra', 'space-between', 'start', 'end'],
|
|
1417
1417
|
scope: 'GLOBAL',
|
|
1418
1418
|
valueType: 'ENUM',
|
|
1419
1419
|
operation: 'update',
|
|
@@ -1425,7 +1425,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1425
1425
|
// --- Grouping ---
|
|
1426
1426
|
{
|
|
1427
1427
|
id: 'ENABLE_GROUPING',
|
|
1428
|
-
|
|
1428
|
+
intentExamples: ['group by', 'agrupar por', 'agrupamento'],
|
|
1429
1429
|
scope: 'GLOBAL', // Global action, but target is field name
|
|
1430
1430
|
valueType: 'STRING',
|
|
1431
1431
|
operation: 'update',
|
|
@@ -1442,7 +1442,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1442
1442
|
},
|
|
1443
1443
|
{
|
|
1444
1444
|
id: 'CLEAR_GROUPING',
|
|
1445
|
-
|
|
1445
|
+
intentExamples: ['ungroup', 'desagrupar', 'remover agrupamento'],
|
|
1446
1446
|
scope: 'GLOBAL',
|
|
1447
1447
|
valueType: 'BOOLEAN',
|
|
1448
1448
|
operation: 'update',
|
|
@@ -1455,7 +1455,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1455
1455
|
// --- Row Actions ---
|
|
1456
1456
|
{
|
|
1457
1457
|
id: 'ENABLE_ROW_ACTIONS',
|
|
1458
|
-
|
|
1458
|
+
intentExamples: ['enable row actions', 'acoes de linha', 'botoes na linha'],
|
|
1459
1459
|
scope: 'GLOBAL',
|
|
1460
1460
|
valueType: 'BOOLEAN',
|
|
1461
1461
|
operation: 'update',
|
|
@@ -1467,7 +1467,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1467
1467
|
},
|
|
1468
1468
|
{
|
|
1469
1469
|
id: 'ADD_ROW_ACTION_ICON',
|
|
1470
|
-
|
|
1470
|
+
intentExamples: ['add row action', 'botao de acao', 'adicionar botao'],
|
|
1471
1471
|
scope: 'GLOBAL', // Adds to global row actions list
|
|
1472
1472
|
valueType: 'OBJECT',
|
|
1473
1473
|
operation: 'create',
|
|
@@ -1490,7 +1490,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1490
1490
|
},
|
|
1491
1491
|
{
|
|
1492
1492
|
id: 'ADD_ROW_ACTION_MENU',
|
|
1493
|
-
|
|
1493
|
+
intentExamples: ['add row menu', 'acao no menu', 'item de menu'],
|
|
1494
1494
|
scope: 'GLOBAL',
|
|
1495
1495
|
valueType: 'OBJECT',
|
|
1496
1496
|
operation: 'create',
|
|
@@ -1513,7 +1513,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1513
1513
|
// --- Conditional Row Styles ---
|
|
1514
1514
|
{
|
|
1515
1515
|
id: 'ADD_ROW_STYLE_BG',
|
|
1516
|
-
|
|
1516
|
+
intentExamples: ['row background condition', 'pintar linha se', 'cor de fundo condicional'],
|
|
1517
1517
|
scope: 'GLOBAL',
|
|
1518
1518
|
valueType: 'OBJECT',
|
|
1519
1519
|
operation: 'create',
|
|
@@ -1529,7 +1529,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1529
1529
|
},
|
|
1530
1530
|
{
|
|
1531
1531
|
id: 'ADD_ROW_STYLE_COLOR',
|
|
1532
|
-
|
|
1532
|
+
intentExamples: ['row text color condition', 'cor texto linha se'],
|
|
1533
1533
|
scope: 'GLOBAL',
|
|
1534
1534
|
valueType: 'OBJECT',
|
|
1535
1535
|
operation: 'create',
|
|
@@ -1546,7 +1546,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1546
1546
|
// --- Conditional Renderers (Column) ---
|
|
1547
1547
|
{
|
|
1548
1548
|
id: 'ADD_CONDITIONAL_RENDERER',
|
|
1549
|
-
|
|
1549
|
+
intentExamples: [
|
|
1550
1550
|
'conditional renderer',
|
|
1551
1551
|
'renderer condicional',
|
|
1552
1552
|
'badge condicional',
|
|
@@ -1588,7 +1588,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
|
|
|
1588
1588
|
},
|
|
1589
1589
|
{
|
|
1590
1590
|
id: 'ADD_CONDITIONAL_ICON',
|
|
1591
|
-
|
|
1591
|
+
intentExamples: ['conditional icon', 'icone condicional', 'icone se'],
|
|
1592
1592
|
scope: 'COLUMN',
|
|
1593
1593
|
valueType: 'OBJECT',
|
|
1594
1594
|
operation: 'create',
|
|
@@ -1867,6 +1867,10 @@ class TableAiAdapter extends BaseAiAdapter {
|
|
|
1867
1867
|
this.aiService = aiService;
|
|
1868
1868
|
}
|
|
1869
1869
|
// -------- Core contract --------
|
|
1870
|
+
async prepareAuthoringContext() {
|
|
1871
|
+
const tableWithFilterSchema = this.table;
|
|
1872
|
+
await tableWithFilterSchema.ensureFilterSchemaFieldsSnapshot?.();
|
|
1873
|
+
}
|
|
1870
1874
|
compileAiResponse(response) {
|
|
1871
1875
|
const componentEditPlans = coerceTableComponentEditPlans(response);
|
|
1872
1876
|
if (!componentEditPlans) {
|
|
@@ -1902,6 +1906,7 @@ class TableAiAdapter extends BaseAiAdapter {
|
|
|
1902
1906
|
}
|
|
1903
1907
|
getRuntimeState() {
|
|
1904
1908
|
return {
|
|
1909
|
+
resourcePath: this.table.resourcePath || null,
|
|
1905
1910
|
rowsTotal: this.table.dataSource.data.length,
|
|
1906
1911
|
rowsVisible: this.table.paginator ? this.table.paginator.pageSize : this.table.dataSource.data.length,
|
|
1907
1912
|
pageIndex: this.table.paginator ? this.table.paginator.pageIndex : 0,
|
|
@@ -1912,33 +1917,148 @@ class TableAiAdapter extends BaseAiAdapter {
|
|
|
1912
1917
|
};
|
|
1913
1918
|
}
|
|
1914
1919
|
getAuthoringContext() {
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
+
const filterFieldCatalog = this.buildFilterFieldCatalog();
|
|
1921
|
+
const responseModes = [
|
|
1922
|
+
{
|
|
1923
|
+
kind: 'consult',
|
|
1924
|
+
operationKind: 'consult',
|
|
1925
|
+
changeKind: 'answer',
|
|
1926
|
+
preferredResponse: 'info',
|
|
1927
|
+
useWhen: [
|
|
1928
|
+
'The user asks how the current table is configured or connected.',
|
|
1929
|
+
'The user asks which resourcePath, endpoint, schema fields, capabilities, styling options, or computed-column patterns are available.',
|
|
1930
|
+
'The user asks for an explanation, documentation-style answer, or how-to guidance without requesting an immediate change.',
|
|
1931
|
+
],
|
|
1932
|
+
rules: [
|
|
1933
|
+
'Return type "info" with message when answering a consultative question.',
|
|
1934
|
+
'Do not ask the user to choose a dataset when the current table already exposes resourcePath.',
|
|
1935
|
+
'For how-to or documentation-style turns, explain the governed operation shape and give a safe example instead of collecting missing edit parameters.',
|
|
1936
|
+
'Do not return clarification for missing target fields, labels, formats, colors, conditions, or columns unless the selected response mode is edit/componentEditPlan.',
|
|
1937
|
+
'Only produce componentEditPlan when the user asks to apply or materialize a table change.',
|
|
1938
|
+
],
|
|
1939
|
+
},
|
|
1940
|
+
{
|
|
1941
|
+
kind: 'edit',
|
|
1942
|
+
operationKind: 'author',
|
|
1920
1943
|
preferredResponse: 'componentEditPlan',
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
version: TABLE_COMPONENT_EDIT_PLAN_VERSION,
|
|
1925
|
-
schemaId: TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA.$id,
|
|
1926
|
-
allowedOperationIds: [...TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS],
|
|
1927
|
-
allowedChangeKinds: [...TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS],
|
|
1928
|
-
expectedPaths: { ...TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS },
|
|
1929
|
-
capabilities: getTableComponentEditPlanCapabilities(),
|
|
1930
|
-
rules: [
|
|
1931
|
-
'Use componentEditPlan instead of free patch when the request fits an allowed table operationId or changeKind.',
|
|
1932
|
-
'Prefer manifest operationId for governed agentic authoring responses.',
|
|
1933
|
-
'Use batch kind with operations for multiple table edits in one request.',
|
|
1934
|
-
'Use Json Logic objects for computed expressions and conditional rules.',
|
|
1935
|
-
'Do not invent fields, operationIds, changeKinds, capabilityPaths, formats, badge variants, or colors outside the provided contract.',
|
|
1936
|
-
],
|
|
1937
|
-
operationRegistryCoverage: TABLE_AUTHORING_REGISTRY_COVERAGE,
|
|
1938
|
-
},
|
|
1944
|
+
useWhen: [
|
|
1945
|
+
'The user asks to change table configuration, visual rules, renderers, columns, behavior, actions, or appearance.',
|
|
1946
|
+
],
|
|
1939
1947
|
},
|
|
1948
|
+
];
|
|
1949
|
+
const authoringContract = {
|
|
1950
|
+
kind: 'praxis.component-authoring-context',
|
|
1951
|
+
componentId: this.componentId,
|
|
1952
|
+
componentType: this.componentType,
|
|
1953
|
+
preferredResponse: 'componentEditPlan',
|
|
1954
|
+
responseModes,
|
|
1955
|
+
consultativeContext: {
|
|
1956
|
+
resourcePath: this.table.resourcePath || null,
|
|
1957
|
+
answerableQuestionKinds: [
|
|
1958
|
+
'current-resource-path',
|
|
1959
|
+
'current-endpoint',
|
|
1960
|
+
'schema-fields',
|
|
1961
|
+
'styling-capabilities',
|
|
1962
|
+
'conditional-renderers',
|
|
1963
|
+
'conditional-styles',
|
|
1964
|
+
'conditional-animations',
|
|
1965
|
+
'computed-column-how-to',
|
|
1966
|
+
],
|
|
1967
|
+
},
|
|
1968
|
+
componentEditPlan: {
|
|
1969
|
+
kind: TABLE_COMPONENT_EDIT_PLAN_KIND,
|
|
1970
|
+
batchKind: TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND,
|
|
1971
|
+
version: TABLE_COMPONENT_EDIT_PLAN_VERSION,
|
|
1972
|
+
schemaId: TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA.$id,
|
|
1973
|
+
allowedOperationIds: [...TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS],
|
|
1974
|
+
allowedChangeKinds: [...TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS],
|
|
1975
|
+
expectedPaths: { ...TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS },
|
|
1976
|
+
capabilities: getTableComponentEditPlanCapabilities(),
|
|
1977
|
+
...(filterFieldCatalog ? { filterFieldCatalog } : {}),
|
|
1978
|
+
rules: [
|
|
1979
|
+
'Use componentEditPlan instead of free patch when the request fits an allowed table operationId or changeKind.',
|
|
1980
|
+
'Prefer manifest operationId for governed agentic authoring responses.',
|
|
1981
|
+
'Use batch kind with operations for multiple table edits in one request.',
|
|
1982
|
+
'Use Json Logic objects for computed expressions and conditional rules.',
|
|
1983
|
+
'Do not invent fields, operationIds, changeKinds, capabilityPaths, formats, badge variants, or colors outside the provided contract.',
|
|
1984
|
+
],
|
|
1985
|
+
operationRegistryCoverage: TABLE_AUTHORING_REGISTRY_COVERAGE,
|
|
1986
|
+
},
|
|
1987
|
+
};
|
|
1988
|
+
return createComponentAuthoringContext(authoringContract);
|
|
1989
|
+
}
|
|
1990
|
+
buildFilterFieldCatalog() {
|
|
1991
|
+
const fields = this.getFilterSchemaFields();
|
|
1992
|
+
if (!fields.length)
|
|
1993
|
+
return null;
|
|
1994
|
+
const columns = this.getCurrentConfig().columns || [];
|
|
1995
|
+
return {
|
|
1996
|
+
source: 'resource-filter-schema',
|
|
1997
|
+
resourcePath: this.table.resourcePath || null,
|
|
1998
|
+
fields: fields.map((field) => {
|
|
1999
|
+
const aliases = this.buildFilterFieldAliases(field, columns);
|
|
2000
|
+
return {
|
|
2001
|
+
name: field['name'],
|
|
2002
|
+
label: field['label'] ?? field['name'],
|
|
2003
|
+
type: field['type'] ?? null,
|
|
2004
|
+
controlType: field['controlType'] ?? null,
|
|
2005
|
+
...(aliases.length ? { aliases } : {}),
|
|
2006
|
+
};
|
|
2007
|
+
}),
|
|
1940
2008
|
};
|
|
1941
2009
|
}
|
|
2010
|
+
getFilterSchemaFields() {
|
|
2011
|
+
const tableWithFilterSchema = this.table;
|
|
2012
|
+
try {
|
|
2013
|
+
return tableWithFilterSchema.getFilterSchemaFieldsSnapshot?.() ?? [];
|
|
2014
|
+
}
|
|
2015
|
+
catch {
|
|
2016
|
+
return [];
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
buildFilterFieldAliases(field, columns) {
|
|
2020
|
+
const aliases = new Set();
|
|
2021
|
+
for (const key of ['name', 'label']) {
|
|
2022
|
+
const value = this.normalizeAliasValue(field[key]);
|
|
2023
|
+
if (value)
|
|
2024
|
+
aliases.add(value);
|
|
2025
|
+
}
|
|
2026
|
+
for (const value of field['relatedColumnFields'] || []) {
|
|
2027
|
+
const alias = this.normalizeAliasValue(value);
|
|
2028
|
+
if (alias)
|
|
2029
|
+
aliases.add(alias);
|
|
2030
|
+
}
|
|
2031
|
+
for (const value of field['relatedColumnLabels'] || []) {
|
|
2032
|
+
const alias = this.normalizeAliasValue(value);
|
|
2033
|
+
if (alias)
|
|
2034
|
+
aliases.add(alias);
|
|
2035
|
+
}
|
|
2036
|
+
for (const column of columns || []) {
|
|
2037
|
+
const columnField = this.normalizeAliasValue(column?.field);
|
|
2038
|
+
if (!columnField)
|
|
2039
|
+
continue;
|
|
2040
|
+
const fieldName = this.normalizeAliasValue(field['name']);
|
|
2041
|
+
const fieldLabel = this.normalizeAliasValue(field['label']);
|
|
2042
|
+
if (fieldName.includes(columnField) || fieldLabel.includes(columnField)) {
|
|
2043
|
+
aliases.add(columnField);
|
|
2044
|
+
const header = this.normalizeAliasValue(column?.header);
|
|
2045
|
+
if (header)
|
|
2046
|
+
aliases.add(header);
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
return [...aliases];
|
|
2050
|
+
}
|
|
2051
|
+
normalizeAliasValue(value) {
|
|
2052
|
+
if (typeof value !== 'string')
|
|
2053
|
+
return '';
|
|
2054
|
+
return value
|
|
2055
|
+
.normalize('NFD')
|
|
2056
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
2057
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
2058
|
+
.replace(/[^a-zA-Z0-9]+/g, ' ')
|
|
2059
|
+
.trim()
|
|
2060
|
+
.toLowerCase();
|
|
2061
|
+
}
|
|
1942
2062
|
getSuggestionContext() {
|
|
1943
2063
|
const config = this.getCurrentConfig();
|
|
1944
2064
|
const behavior = config.behavior || {};
|
|
@@ -2518,6 +2638,7 @@ Columns Analysis:
|
|
|
2518
2638
|
isFirstChange: () => false
|
|
2519
2639
|
}
|
|
2520
2640
|
});
|
|
2641
|
+
this.table.configChange?.emit?.(config);
|
|
2521
2642
|
}
|
|
2522
2643
|
/**
|
|
2523
2644
|
* If a patch adds a typed format, ensure the column type is set so the
|