@praxisui/table 9.0.0-beta.9 → 9.0.0-rc.1

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.
@@ -1,4 +1,6 @@
1
1
  import { Observable, firstValueFrom } from 'rxjs';
2
+ import { withAuthoringScopePolicy } from '@praxisui/ai';
3
+ import { ad as setTableActionGlobalActionRef } from './praxisui-table-praxisui-table-eK40cyyN.mjs';
2
4
 
3
5
  class TableAgenticAuthoringTurnFlow {
4
6
  adapter;
@@ -62,26 +64,31 @@ class TableAgenticAuthoringTurnFlow {
62
64
  this.filterExpressionSupportedForTurn = this.resolveFilterExpressionSupported(contextHints);
63
65
  this.contextHintsForTurn = contextHints;
64
66
  const messages = this.withCapabilitySystemMessages(this.toChatMessages(request.messages, prompt), contextHints, prompt);
65
- return {
66
- contextHints,
67
- patchRequest: {
67
+ const patchRequest = withAuthoringScopePolicy({
68
+ componentId,
69
+ componentType,
70
+ userPrompt: prompt,
71
+ sessionId: request.sessionId,
72
+ clientTurnId: request.clientTurnId,
73
+ messages,
74
+ currentState,
75
+ currentStateDigest: this.buildCurrentStateDigest(currentState, dataProfile),
76
+ uiContextRef: {
68
77
  componentId,
69
78
  componentType,
70
- userPrompt: prompt,
71
- sessionId: request.sessionId,
72
- clientTurnId: request.clientTurnId,
73
- messages,
74
- currentState,
75
- currentStateDigest: this.buildCurrentStateDigest(currentState, dataProfile),
76
- uiContextRef: {
77
- componentId,
78
- componentType,
79
- },
80
- ...(dataProfile ? { dataProfile } : {}),
81
- ...(runtimeState ? { runtimeState } : {}),
82
- ...(schemaFields?.length ? { schemaFields } : {}),
83
- ...(contextHints ? { contextHints } : {}),
84
79
  },
80
+ ...(dataProfile ? { dataProfile } : {}),
81
+ ...(runtimeState ? { runtimeState } : {}),
82
+ ...(schemaFields?.length ? { schemaFields } : {}),
83
+ ...(contextHints ? { contextHints } : {}),
84
+ }, {
85
+ componentId,
86
+ componentType,
87
+ componentLabel: this.adapter.componentName || 'tabela',
88
+ });
89
+ return {
90
+ contextHints: patchRequest.contextHints ?? contextHints,
91
+ patchRequest,
85
92
  };
86
93
  };
87
94
  const progressPrompt = this.progressPromptFor(request, prompt);
@@ -2403,6 +2410,7 @@ class TableAgenticAuthoringTurnFlow {
2403
2410
  ? []
2404
2411
  : this.toQuickReplies(response, request),
2405
2412
  canApply: false,
2413
+ diagnostics: response.warnings?.length ? { warnings: response.warnings } : undefined,
2406
2414
  };
2407
2415
  }
2408
2416
  if (response.type === 'error') {
@@ -2466,6 +2474,11 @@ class TableAgenticAuthoringTurnFlow {
2466
2474
  return this.normalizeLabel(response.code ?? '') === 'turn in progress';
2467
2475
  }
2468
2476
  compileAdapterResponse(response, request) {
2477
+ response = this.normalizeConsultativeSourcePlaceholderResponse(response, request);
2478
+ const consultativePresentationOptions = this.consultativePresentationOptionsBoundary(response, request);
2479
+ if (consultativePresentationOptions) {
2480
+ return consultativePresentationOptions;
2481
+ }
2469
2482
  response = this.normalizeCategoricalRendererPalette(response, request);
2470
2483
  const incompatibleBooleanStatusPresentation = this.incompatibleBooleanStatusPresentationBoundary(response, request);
2471
2484
  if (incompatibleBooleanStatusPresentation) {
@@ -2764,6 +2777,43 @@ class TableAgenticAuthoringTurnFlow {
2764
2777
  return openOnlySurfaceRuntimeOperation;
2765
2778
  return this.normalizeGovernedCategoricalSelectionExecutableResponse(compiledResponse, request);
2766
2779
  }
2780
+ consultativePresentationOptionsBoundary(response, request) {
2781
+ if (!request)
2782
+ return null;
2783
+ if (this.requestIsCanonicalRendererSelection(request))
2784
+ return null;
2785
+ if (this.requestHasGovernedCategoricalSelection(request))
2786
+ return null;
2787
+ if (this.responseCarriesClarificationChoices(response))
2788
+ return null;
2789
+ if ((response.options ?? []).length || (response.optionPayloads ?? []).length)
2790
+ return null;
2791
+ const normalizedCurrentPrompt = this.normalizeLabel(request.prompt ?? '');
2792
+ const normalizedConversationPrompt = this.normalizeLabel(this.componentPresentationPromptForTurn(request));
2793
+ if (!this.promptRequestsPresentationOptions(normalizedConversationPrompt))
2794
+ return null;
2795
+ if (this.promptRequestsExplicitMaterialization(normalizedCurrentPrompt)
2796
+ || this.promptRequestsExplicitMaterialization(normalizedConversationPrompt)) {
2797
+ return null;
2798
+ }
2799
+ const hasExecutableEnvelope = this.responseMayContainExecutableEnvelope(response)
2800
+ || this.componentEditOperations(response.componentEditPlan).length > 0
2801
+ || !!this.toRecord(response.patch);
2802
+ if (!hasExecutableEnvelope && response.type !== 'info' && response.type !== 'clarification') {
2803
+ return null;
2804
+ }
2805
+ return {
2806
+ ...response,
2807
+ type: response.type === 'clarification' ? 'clarification' : 'info',
2808
+ componentEditPlan: undefined,
2809
+ patch: undefined,
2810
+ warnings: [
2811
+ ...(response.warnings ?? []),
2812
+ 'consultative-presentation-options-kept-non-executable',
2813
+ 'A residual continuity guard preserved a follow-up question about table presentation/formatting options as consultative because no explicit apply/change request was present; semantic intent still comes from the LLM-authored turn context.',
2814
+ ],
2815
+ };
2816
+ }
2767
2817
  visualPresentationChoiceClarificationBoundary(response, request) {
2768
2818
  const carriesVisualPayload = (response.optionPayloads ?? [])
2769
2819
  .some((payload) => this.isVisualPresentationClarificationPayload(payload));
@@ -2848,6 +2898,32 @@ class TableAgenticAuthoringTurnFlow {
2848
2898
  'visual',
2849
2899
  ].some((token) => this.normalizedTextContainsApproxPhrase(normalized, token));
2850
2900
  }
2901
+ promptRequestsExplicitMaterialization(normalizedPrompt) {
2902
+ if (!normalizedPrompt)
2903
+ return false;
2904
+ return [
2905
+ 'aplica',
2906
+ 'aplicar',
2907
+ 'aplique',
2908
+ 'altera',
2909
+ 'alterar',
2910
+ 'altere',
2911
+ 'configura',
2912
+ 'configurar',
2913
+ 'configure',
2914
+ 'cria',
2915
+ 'criar',
2916
+ 'crie',
2917
+ 'muda',
2918
+ 'mudar',
2919
+ 'mude',
2920
+ 'mostra como',
2921
+ 'mostre como',
2922
+ 'transforma',
2923
+ 'transformar',
2924
+ 'transforme',
2925
+ ].some((token) => this.normalizedTextContainsApproxPhrase(normalizedPrompt, token));
2926
+ }
2851
2927
  normalizeCategoricalRendererPalette(response, request) {
2852
2928
  const plan = this.toRecord(response.componentEditPlan);
2853
2929
  const operations = this.componentEditOperations(plan);
@@ -3891,8 +3967,7 @@ class TableAgenticAuthoringTurnFlow {
3891
3967
  query: { ids: '${runtime.selectedIds}' },
3892
3968
  },
3893
3969
  };
3894
- action.globalAction = globalAction;
3895
- action.effects = [{ kind: 'global-action', globalAction }];
3970
+ setTableActionGlobalActionRef(action, globalAction);
3896
3971
  if (!this.stringValue(action.action)) {
3897
3972
  action.action = 'navigation.openRoute';
3898
3973
  }
@@ -9539,6 +9614,7 @@ class TableAgenticAuthoringTurnFlow {
9539
9614
  }
9540
9615
  withCapabilitySystemMessages(messages, contextHints, prompt = '') {
9541
9616
  const policies = [
9617
+ this.buildConsultativeContextSystemPolicy(contextHints),
9542
9618
  this.buildRecommendedCapabilitiesSystemPolicy(contextHints),
9543
9619
  this.buildSelectedRecordsAnalysisSystemPolicy(contextHints),
9544
9620
  this.buildComponentPresentationAuthoringSystemPolicy(contextHints, prompt),
@@ -9548,6 +9624,152 @@ class TableAgenticAuthoringTurnFlow {
9548
9624
  ].filter((message) => !!message);
9549
9625
  return policies.length ? [...policies, ...messages] : messages;
9550
9626
  }
9627
+ buildConsultativeContextSystemPolicy(contextHints) {
9628
+ const facts = this.tableConsultativeContextFacts(contextHints);
9629
+ if (!facts.length)
9630
+ return null;
9631
+ return {
9632
+ role: 'system',
9633
+ content: [
9634
+ 'Praxis table consultative context policy:',
9635
+ '- The facts below are governed runtime/context evidence for read-only questions about the current table.',
9636
+ '- When answering consultative questions, use the concrete fact value. Never answer with placeholders such as "fonte confirmada" or "source confirmed" when a value is declared.',
9637
+ '- Do not emit visual presentation options, componentEditPlan, tableRuntimeOperations, or quick replies for a purely factual answer unless the user explicitly asks to change, apply, format, filter, open, or export something.',
9638
+ '- Endpoint paths and resourcePath values are technical details: include them only when the user asks for the data source, origin, endpoint, resource, URL, path, or resourcePath.',
9639
+ 'Declared consultative facts:',
9640
+ ...facts,
9641
+ ].join('\n'),
9642
+ };
9643
+ }
9644
+ tableConsultativeContextFacts(contextHints) {
9645
+ const facts = [];
9646
+ const resourcePath = this.extractResourcePath(contextHints)
9647
+ ?? this.extractResourcePath(this.optionalJsonObject(this.adapter.getRuntimeState?.()))
9648
+ ?? this.extractResourcePath(this.optionalJsonObject(this.adapter.getAuthoringContext?.()));
9649
+ if (resourcePath) {
9650
+ facts.push(`- resourcePath: ${resourcePath}`);
9651
+ }
9652
+ const dataProfile = this.optionalJsonObject(this.adapter.getDataProfile?.());
9653
+ const rowCount = this.numberValue(dataProfile?.['rowCount'] ?? dataProfile?.['totalRows'] ?? dataProfile?.['totalElements']);
9654
+ if (rowCount != null) {
9655
+ facts.push(`- dataProfile.rowCount: ${rowCount}`);
9656
+ }
9657
+ const runtimeState = this.optionalJsonObject(this.adapter.getRuntimeState?.());
9658
+ const pageSize = this.numberValue(runtimeState?.['pageSize']);
9659
+ const pageIndex = this.numberValue(runtimeState?.['pageIndex'] ?? runtimeState?.['page']);
9660
+ if (pageSize != null) {
9661
+ facts.push(`- runtimeState.pageSize: ${pageSize}`);
9662
+ }
9663
+ if (pageIndex != null) {
9664
+ facts.push(`- runtimeState.pageIndex: ${pageIndex}`);
9665
+ }
9666
+ const consultativeKinds = this.tableConsultativeQuestionKinds(contextHints);
9667
+ if (consultativeKinds.length) {
9668
+ facts.push(`- consultativeContext.answerableQuestionKinds: ${consultativeKinds.join(', ')}`);
9669
+ }
9670
+ const columnFacts = this.tableConsultativeColumnFacts();
9671
+ if (columnFacts.length) {
9672
+ facts.push('- declaredColumns:');
9673
+ facts.push(...columnFacts);
9674
+ }
9675
+ return facts;
9676
+ }
9677
+ tableConsultativeQuestionKinds(contextHints) {
9678
+ const consultativeContext = this.toRecord(this.toRecord(contextHints?.['authoringContract'])?.['consultativeContext']);
9679
+ const kinds = consultativeContext?.['answerableQuestionKinds'];
9680
+ if (!Array.isArray(kinds))
9681
+ return [];
9682
+ const unique = new Set();
9683
+ kinds
9684
+ .map((kind) => this.stringValue(kind).trim())
9685
+ .filter((kind) => !!kind)
9686
+ .forEach((kind) => unique.add(kind));
9687
+ return [...unique].slice(0, 24);
9688
+ }
9689
+ tableConsultativeColumnFacts() {
9690
+ const currentConfig = this.toRecord(this.adapter.getCurrentConfig?.());
9691
+ const columns = Array.isArray(currentConfig?.['columns'])
9692
+ ? currentConfig['columns']
9693
+ : [];
9694
+ const schemaFieldByName = new Map();
9695
+ for (const schemaField of this.adapter.getSchemaFields?.() ?? []) {
9696
+ const record = this.toRecord(schemaField);
9697
+ if (!record)
9698
+ continue;
9699
+ const name = this.stringValue(record['name']) || this.stringValue(record['field']);
9700
+ if (name)
9701
+ schemaFieldByName.set(name, record);
9702
+ }
9703
+ return columns
9704
+ .map((column) => this.toRecord(column))
9705
+ .filter((column) => !!column)
9706
+ .map((column) => {
9707
+ const field = this.stringValue(column['field']).trim();
9708
+ if (!field)
9709
+ return null;
9710
+ const schemaField = schemaFieldByName.get(field);
9711
+ const label = this.stringValue(column['header'])
9712
+ || this.stringValue(column['label'])
9713
+ || this.stringValue(column['title'])
9714
+ || this.stringValue(schemaField?.['label'])
9715
+ || this.stringValue(schemaField?.['title'])
9716
+ || field;
9717
+ const schemaFormat = this.stringValue(schemaField?.['format']);
9718
+ const type = this.tableConsultativeColumnType(column, schemaField, schemaFormat);
9719
+ const format = this.stringValue(column['format']) || schemaFormat;
9720
+ const renderer = this.stringValue(this.toRecord(column['renderer'])?.['type']);
9721
+ return [
9722
+ ` - ${field}`,
9723
+ `label=${label}`,
9724
+ `type=${type}`,
9725
+ ...(format ? [`format=${format}`] : []),
9726
+ ...(renderer ? [`renderer=${renderer}`] : []),
9727
+ ].join('; ');
9728
+ })
9729
+ .filter((fact) => !!fact)
9730
+ .slice(0, 40);
9731
+ }
9732
+ tableConsultativeColumnType(column, schemaField, schemaFormat) {
9733
+ const columnType = this.stringValue(column['type']) || this.stringValue(column['dataType']);
9734
+ const schemaType = this.stringValue(schemaField?.['type']) || this.stringValue(schemaField?.['dataType']);
9735
+ if (schemaFormat === 'date' || schemaFormat === 'date-time')
9736
+ return schemaFormat;
9737
+ return columnType || schemaType || 'unknown';
9738
+ }
9739
+ normalizeConsultativeSourcePlaceholderResponse(response, request) {
9740
+ if (response.type && response.type !== 'info')
9741
+ return response;
9742
+ if (response.patch && Object.keys(response.patch).length > 0)
9743
+ return response;
9744
+ const message = this.stringValue(response.message || response.explanation);
9745
+ if (!this.isConfirmedSourcePlaceholderMessage(message))
9746
+ return response;
9747
+ const resourcePath = this.extractResourcePath(this.contextHintsForTurn)
9748
+ ?? this.extractResourcePath(this.optionalJsonObject(request?.runtimeState))
9749
+ ?? this.extractResourcePath(this.optionalJsonObject(this.adapter.getRuntimeState?.()))
9750
+ ?? this.extractResourcePath(this.optionalJsonObject(this.adapter.getAuthoringContext?.()));
9751
+ if (!resourcePath)
9752
+ return response;
9753
+ return {
9754
+ ...response,
9755
+ type: 'info',
9756
+ message: `O resourcePath usado por esta tabela é \`${resourcePath}\`.`,
9757
+ explanation: undefined,
9758
+ optionPayloads: undefined,
9759
+ options: undefined,
9760
+ warnings: [
9761
+ ...(response.warnings ?? []),
9762
+ 'consultative-source-placeholder-normalized',
9763
+ 'Resposta informativa normalizada a partir de authoringContract.consultativeContext.resourcePath; nao houve roteamento primario de intencao por palavras-chave.',
9764
+ ],
9765
+ };
9766
+ }
9767
+ isConfirmedSourcePlaceholderMessage(message) {
9768
+ const normalized = this.normalizeLabel(message);
9769
+ return !!normalized
9770
+ && (normalized.includes('fonte confirmada') || normalized.includes('source confirmed'))
9771
+ && (normalized.includes('fonte') || normalized.includes('source') || normalized.includes('resource'));
9772
+ }
9551
9773
  buildSelectedRecordsAnalysisSystemPolicy(contextHints) {
9552
9774
  const selectedRecordsContext = this.selectedRecordsContextRecord(contextHints);
9553
9775
  if (!selectedRecordsContext)
@@ -9632,6 +9854,8 @@ class TableAgenticAuthoringTurnFlow {
9632
9854
  }
9633
9855
  buildComponentPresentationAuthoringSystemPolicy(contextHints, prompt) {
9634
9856
  const normalizedPrompt = this.normalizeLabel(prompt);
9857
+ if (this.promptRequestsPresentationOptions(normalizedPrompt))
9858
+ return null;
9635
9859
  const presentationIntent = this.promptRequestsVisualOrStructuralEdit(normalizedPrompt)
9636
9860
  || this.promptRequestsCompoundColumnPresentationEdit(normalizedPrompt);
9637
9861
  if (!presentationIntent)
@@ -1,8 +1,13 @@
1
1
  import { firstValueFrom } from 'rxjs';
2
2
  import { BaseAiAdapter, sanitizePraxisAssistantText, 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-B-goiuDf.mjs';
4
+ import { I as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, l as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, Z as coerceTableComponentEditPlans, $ as compileTableComponentEditPlans, L as TASK_PRESETS, a4 as getTableComponentEditPlanCapabilities, E as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, y as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, G as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, K as TABLE_COMPONENT_EDIT_PLAN_VERSION, z as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, H as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-eK40cyyN.mjs';
5
5
 
6
+ const TABLE_ROW_EXPRESSION_CONTEXT_OPTION = {
7
+ mode: 'expression',
8
+ options: [],
9
+ suggestedRoots: ['row', 'rowData', 'computed'],
10
+ };
6
11
  const TABLE_COMPONENT_CONTEXT_PACK = {
7
12
  version: 'v1',
8
13
  optionsByPath: {
@@ -332,6 +337,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
332
337
  { value: 'menu', label: 'Menu' },
333
338
  { value: 'rating', label: 'Rating' },
334
339
  { value: 'html', label: 'HTML' },
340
+ { value: 'microVisualization', label: 'Micro visualization' },
335
341
  { value: 'compose', label: 'Compose' },
336
342
  ],
337
343
  },
@@ -389,6 +395,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
389
395
  { value: 'filled', label: 'Filled' },
390
396
  { value: 'outlined', label: 'Outlined' },
391
397
  { value: 'soft', label: 'Soft' },
398
+ { value: 'plain', label: 'Plain' },
392
399
  ],
393
400
  },
394
401
  'columns[].renderer.chip.variant': {
@@ -397,6 +404,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
397
404
  { value: 'filled', label: 'Filled' },
398
405
  { value: 'outlined', label: 'Outlined' },
399
406
  { value: 'soft', label: 'Soft' },
407
+ { value: 'plain', label: 'Plain' },
400
408
  ],
401
409
  },
402
410
  'columns[].renderer.rating.size': {
@@ -422,8 +430,45 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
422
430
  { value: 'menu', label: 'Menu' },
423
431
  { value: 'rating', label: 'Rating' },
424
432
  { value: 'html', label: 'HTML' },
433
+ { value: 'microVisualization', label: 'Micro visualization' },
425
434
  ],
426
435
  },
436
+ 'columns[].renderer.microVisualization.visualization.valueExpr': {
437
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
438
+ },
439
+ 'columns[].renderer.microVisualization.visualization.valueSuffixExpr': {
440
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
441
+ },
442
+ 'columns[].renderer.microVisualization.visualization.totalExpr': {
443
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
444
+ },
445
+ 'columns[].renderer.microVisualization.visualization.targetExpr': {
446
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
447
+ },
448
+ 'columns[].renderer.microVisualization.visualization.baselineExpr': {
449
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
450
+ },
451
+ 'columns[].renderer.microVisualization.visualization.segmentsExpr': {
452
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
453
+ },
454
+ 'columns[].renderer.microVisualization.visualization.pointsExpr': {
455
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
456
+ },
457
+ 'columns[].renderer.microVisualization.visualization.thresholdsExpr': {
458
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
459
+ },
460
+ 'columns[].renderer.microVisualization.visualization.itemsExpr': {
461
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
462
+ },
463
+ 'columns[].renderer.microVisualization.visualization.toneExpr': {
464
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
465
+ },
466
+ 'columns[].renderer.microVisualization.visualization.ariaLabelExpr': {
467
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
468
+ },
469
+ 'columns[].renderer.microVisualization.visualization.fallbackTextExpr': {
470
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
471
+ },
427
472
  'columns[].conditionalRenderers[].renderer.type': {
428
473
  mode: 'enum',
429
474
  options: [
@@ -439,6 +484,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
439
484
  { value: 'menu', label: 'Menu' },
440
485
  { value: 'rating', label: 'Rating' },
441
486
  { value: 'html', label: 'HTML' },
487
+ { value: 'microVisualization', label: 'Micro visualization' },
442
488
  { value: 'compose', label: 'Compose' },
443
489
  ],
444
490
  },
@@ -529,6 +575,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
529
575
  { value: 'menu', label: 'Menu' },
530
576
  { value: 'rating', label: 'Rating' },
531
577
  { value: 'html', label: 'HTML' },
578
+ { value: 'microVisualization', label: 'Micro visualization' },
532
579
  ],
533
580
  },
534
581
  'actions.row.actions[].color': {
@@ -826,7 +873,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
826
873
  {
827
874
  name: 'variant',
828
875
  type: 'ENUM',
829
- options: ['filled', 'outlined', 'soft'],
876
+ options: ['filled', 'outlined', 'soft', 'plain'],
830
877
  description: 'Estilo visual do badge'
831
878
  },
832
879
  {
@@ -846,7 +893,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
846
893
  text: '{{target}}', // Default to field value if text not generic
847
894
  textField: '{{target}}', // Bind to field
848
895
  color: '{{params.color}}', // primary, accent, warn, success, info
849
- variant: '{{params.variant}}', // filled, outlined, soft
896
+ variant: '{{params.variant}}', // filled, outlined, soft, plain
850
897
  },
851
898
  },
852
899
  },
@@ -1577,7 +1624,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
1577
1624
  {
1578
1625
  name: 'condition',
1579
1626
  type: 'STRING',
1580
- description: 'Expressao condicional (ex: recompensa > 500000)'
1627
+ description: 'Objeto JSON Logic canonico serializado, nunca DSL textual (ex: { ">": [{ "var": "recompensa" }, 500000] })'
1581
1628
  },
1582
1629
  {
1583
1630
  name: 'renderer',
@@ -2204,6 +2251,9 @@ class TableAiAdapter extends BaseAiAdapter {
2204
2251
  'bulk-actions',
2205
2252
  'selection-derived-export-scope',
2206
2253
  'styling-capabilities',
2254
+ 'column-format-options',
2255
+ 'column-presentation-options',
2256
+ 'boolean-status-presentation-options',
2207
2257
  'conditional-renderers',
2208
2258
  'conditional-styles',
2209
2259
  'conditional-animations',
@@ -3678,7 +3728,13 @@ Columns Analysis:
3678
3728
  const isRootArray = currentPath && (allowedPaths.has(currentPath + '[]') || Array.from(allowedPaths).some(p => p.startsWith(currentPath + '[].')));
3679
3729
  if (!isRootArray)
3680
3730
  return obj; // É um valor array (ex: tags), retorna direto
3681
- return obj.map(item => recurse(item, currentPath + '[]'));
3731
+ const items = obj.map(item => recurse(item, currentPath + '[]'));
3732
+ if (currentPath === 'columns[].conditionalRenderers'
3733
+ || currentPath === 'columns[].conditionalStyles'
3734
+ || currentPath === 'rowConditionalStyles') {
3735
+ return items.filter((item) => this.hasCanonicalConditionalRule(item));
3736
+ }
3737
+ return items;
3682
3738
  }
3683
3739
  const cleanObj = {};
3684
3740
  for (const key of Object.keys(obj)) {
@@ -3690,14 +3746,6 @@ Columns Analysis:
3690
3746
  const exactMatch = allowedPaths.has(newPath) || isIdentityField;
3691
3747
  const prefixMatch = Array.from(allowedPaths).some(p => p.startsWith(newPath + '.') || p.startsWith(newPath + '['));
3692
3748
  if (exactMatch || prefixMatch) {
3693
- if (exactMatch
3694
- && (passthroughObjectPaths.has(newPath) || jsonLogicObjectPaths.has(newPath))
3695
- && typeof obj[key] === 'object'
3696
- && obj[key] !== null
3697
- && !Array.isArray(obj[key])) {
3698
- cleanObj[key] = obj[key];
3699
- continue;
3700
- }
3701
3749
  if (newPath === 'columns[].computed.expression') {
3702
3750
  if (!obj[key] || typeof obj[key] !== 'object' || Array.isArray(obj[key])) {
3703
3751
  warnings.push(`Computed expression inválida: ${newPath} (deve ser Json Logic)`);
@@ -3710,6 +3758,22 @@ Columns Analysis:
3710
3758
  cleanObj[key] = obj[key];
3711
3759
  continue;
3712
3760
  }
3761
+ if (exactMatch && jsonLogicObjectPaths.has(newPath)) {
3762
+ if (!this.isCanonicalJsonLogicObject(obj[key])) {
3763
+ warnings.push(`Condicao Json Logic invalida: ${newPath} (deve ser objeto Json Logic)`);
3764
+ continue;
3765
+ }
3766
+ cleanObj[key] = obj[key];
3767
+ continue;
3768
+ }
3769
+ if (exactMatch
3770
+ && passthroughObjectPaths.has(newPath)
3771
+ && typeof obj[key] === 'object'
3772
+ && obj[key] !== null
3773
+ && !Array.isArray(obj[key])) {
3774
+ cleanObj[key] = obj[key];
3775
+ continue;
3776
+ }
3713
3777
  const val = recurse(obj[key], newPath);
3714
3778
  // Se for objeto vazio após limpeza, não inclui (salvo se for intenção explicita de limpar config, mas patch geralmente é aditivo)
3715
3779
  if (typeof val === 'object' && val !== null && !Array.isArray(val) && Object.keys(val).length === 0) {
@@ -3728,6 +3792,17 @@ Columns Analysis:
3728
3792
  const sanitized = recurse(patch, '');
3729
3793
  return { sanitized, warnings };
3730
3794
  }
3795
+ isCanonicalJsonLogicObject(value) {
3796
+ return !!value
3797
+ && typeof value === 'object'
3798
+ && !Array.isArray(value)
3799
+ && Object.keys(value).length === 1;
3800
+ }
3801
+ hasCanonicalConditionalRule(value) {
3802
+ if (!value || typeof value !== 'object' || Array.isArray(value))
3803
+ return false;
3804
+ return this.isCanonicalJsonLogicObject(value['condition']);
3805
+ }
3731
3806
  // -------- Internal helpers --------
3732
3807
  /**
3733
3808
  * Specialized merge for TableConfig that handles Array reconciliation safely.
@@ -3979,15 +4054,40 @@ Columns Analysis:
3979
4054
  iconObj.name = renderer.icon;
3980
4055
  if (renderer.icon?.name)
3981
4056
  iconObj.name = renderer.icon.name;
4057
+ if (renderer.icon?.text)
4058
+ iconObj.text = renderer.icon.text;
4059
+ if (renderer.icon?.textField)
4060
+ iconObj.textField = renderer.icon.textField;
4061
+ if (renderer.icon?.prefix)
4062
+ iconObj.prefix = renderer.icon.prefix;
4063
+ if (renderer.icon?.suffix)
4064
+ iconObj.suffix = renderer.icon.suffix;
3982
4065
  if (renderer.icon?.color)
3983
4066
  iconObj.color = renderer.icon.color;
3984
4067
  if (renderer.icon?.size)
3985
4068
  iconObj.size = renderer.icon.size;
4069
+ if (renderer.icon?.ariaLabel)
4070
+ iconObj.ariaLabel = renderer.icon.ariaLabel;
4071
+ if (renderer.text && !iconObj.text)
4072
+ iconObj.text = renderer.text;
4073
+ if (renderer.textField && !iconObj.textField)
4074
+ iconObj.textField = renderer.textField;
4075
+ if (renderer.prefix && !iconObj.prefix)
4076
+ iconObj.prefix = renderer.prefix;
4077
+ if (renderer.suffix && !iconObj.suffix)
4078
+ iconObj.suffix = renderer.suffix;
4079
+ if (renderer.ariaLabel && !iconObj.ariaLabel)
4080
+ iconObj.ariaLabel = renderer.ariaLabel;
3986
4081
  if (renderer.color && !iconObj.color)
3987
4082
  iconObj.color = renderer.color;
3988
4083
  if (renderer.size && !iconObj.size)
3989
4084
  iconObj.size = renderer.size;
3990
4085
  out.icon = iconObj;
4086
+ delete out.text;
4087
+ delete out.textField;
4088
+ delete out.prefix;
4089
+ delete out.suffix;
4090
+ delete out.ariaLabel;
3991
4091
  delete out.color;
3992
4092
  delete out.size;
3993
4093
  }
@@ -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-B-goiuDf.mjs';
1
+ export { A as ANALYTICS_TABLE_ROW_KEY_FIELD, a as AnalyticsTableConfigAdapterService, b as AnalyticsTableContractService, c as AnalyticsTableStatsApiService, B as BOOLEAN_PRESETS, d as BehaviorConfigEditorComponent, C as CURRENCY_PRESETS, e as ColumnsConfigEditorComponent, D as DATE_PRESETS, f as DataFormatterComponent, g as DataFormattingService, F as FORMULA_TEMPLATES, h as FilterConfigService, i as FilterSettingsComponent, j as FormulaGeneratorService, J as JsonConfigEditorComponent, M as MessagesLocalizationEditorComponent, N as NUMBER_PRESETS, P as PERCENTAGE_PRESETS, k as PRAXIS_FILTER_COMPONENT_METADATA, l as PRAXIS_TABLE_AUTHORING_MANIFEST, m as PRAXIS_TABLE_COMPONENT_METADATA, n as PRAXIS_TABLE_TOOLBAR_APPEARANCE_PRESETS, o as PRAXIS_TABLE_TOOLBAR_DEFAULT_APPEARANCE, p as PRAXIS_TABLE_TOOLBAR_TOKEN_PRESETS, q as PraxisFilter, r as PraxisFilterWidgetConfigEditor, s as PraxisTable, t as PraxisTableConfigEditor, u as PraxisTableInlineAuthoringEditorComponent, v as PraxisTableToolbar, w as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, x as TABLE_COMPONENT_AI_CAPABILITIES, y as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, z as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, E as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, G as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, H as TABLE_COMPONENT_EDIT_PLAN_KIND, K as TABLE_COMPONENT_EDIT_PLAN_VERSION, L as TASK_PRESETS, O as TableDefaultsProvider, Q as TableRulesEditorComponent, R as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, U as VisualFormulaBuilderComponent, W as analyticsComparisonMetricField, X as buildTableApplyPlan, Y as coerceTableComponentEditPlan, Z as coerceTableComponentEditPlans, _ as compileTableComponentEditPlan, $ as compileTableComponentEditPlans, a0 as createTableAuthoringDocument, a1 as getActionId, a2 as getEnum, a3 as getTableCapabilities, a4 as getTableComponentEditPlanCapabilities, a5 as isTableRendererSupportedByRichContentP0, a6 as mapTableRendererToRichContentP0, a7 as normalizeTableAuthoringDocument, a8 as parseLegacyOrTableDocument, a9 as providePraxisFilterMetadata, aa as providePraxisTableMetadata, ab as providePraxisTableToolbarAppearance, ac as serializeTableAuthoringDocument, ae as toCanonicalTableConfig, af as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-eK40cyyN.mjs';
package/package.json CHANGED
@@ -1,23 +1,24 @@
1
1
  {
2
2
  "name": "@praxisui/table",
3
- "version": "9.0.0-beta.9",
3
+ "version": "9.0.0-rc.1",
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": "^9.0.0-beta.9",
9
- "@praxisui/core": "^9.0.0-beta.9",
10
- "@praxisui/dynamic-fields": "^9.0.0-beta.9",
11
- "@praxisui/dynamic-form": "^9.0.0-beta.9",
12
- "@praxisui/metadata-editor": "^9.0.0-beta.9",
13
- "@praxisui/rich-content": "^9.0.0-beta.9",
14
- "@praxisui/settings-panel": "^9.0.0-beta.9",
15
- "@praxisui/table-rule-builder": "^9.0.0-beta.9",
8
+ "@angular/platform-browser": "^21.0.0",
9
+ "@praxisui/ai": "^9.0.0-rc.1",
10
+ "@praxisui/core": "^9.0.0-rc.1",
11
+ "@praxisui/dynamic-fields": "^9.0.0-rc.1",
12
+ "@praxisui/dynamic-form": "^9.0.0-rc.1",
13
+ "@praxisui/metadata-editor": "^9.0.0-rc.1",
14
+ "@praxisui/rich-content": "^9.0.0-rc.1",
15
+ "@praxisui/settings-panel": "^9.0.0-rc.1",
16
+ "@praxisui/table-rule-builder": "^9.0.0-rc.1",
16
17
  "@angular/cdk": "^21.0.0",
17
18
  "@angular/forms": "^21.0.0",
18
19
  "@angular/material": "^21.0.0",
19
20
  "@angular/router": "^21.0.0",
20
- "@praxisui/dialog": "^9.0.0-beta.9",
21
+ "@praxisui/dialog": "^9.0.0-rc.1",
21
22
  "rxjs": "~7.8.0"
22
23
  },
23
24
  "dependencies": {
@@ -31,6 +32,7 @@
31
32
  "keywords": [
32
33
  "angular",
33
34
  "praxisui",
35
+ "praxis",
34
36
  "table",
35
37
  "data-grid",
36
38
  "filtering",
@@ -51,7 +53,10 @@
51
53
  "./filter-drawer-adapter": {
52
54
  "types": "./types/praxisui-table-filter-drawer-adapter.d.ts",
53
55
  "default": "./fesm2022/praxisui-table-filter-drawer-adapter.mjs"
56
+ },
57
+ "./ai/component-registry.json": {
58
+ "default": "./ai/component-registry.json"
54
59
  }
55
60
  },
56
61
  "type": "module"
57
- }
62
+ }