@praxisui/table 9.0.0-beta.3 → 9.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.
@@ -1,4 +1,5 @@
1
1
  import { Observable, firstValueFrom } from 'rxjs';
2
+ import { withAuthoringScopePolicy } from '@praxisui/ai';
2
3
 
3
4
  class TableAgenticAuthoringTurnFlow {
4
5
  adapter;
@@ -62,26 +63,31 @@ class TableAgenticAuthoringTurnFlow {
62
63
  this.filterExpressionSupportedForTurn = this.resolveFilterExpressionSupported(contextHints);
63
64
  this.contextHintsForTurn = contextHints;
64
65
  const messages = this.withCapabilitySystemMessages(this.toChatMessages(request.messages, prompt), contextHints, prompt);
65
- return {
66
- contextHints,
67
- patchRequest: {
66
+ const patchRequest = withAuthoringScopePolicy({
67
+ componentId,
68
+ componentType,
69
+ userPrompt: prompt,
70
+ sessionId: request.sessionId,
71
+ clientTurnId: request.clientTurnId,
72
+ messages,
73
+ currentState,
74
+ currentStateDigest: this.buildCurrentStateDigest(currentState, dataProfile),
75
+ uiContextRef: {
68
76
  componentId,
69
77
  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
78
  },
79
+ ...(dataProfile ? { dataProfile } : {}),
80
+ ...(runtimeState ? { runtimeState } : {}),
81
+ ...(schemaFields?.length ? { schemaFields } : {}),
82
+ ...(contextHints ? { contextHints } : {}),
83
+ }, {
84
+ componentId,
85
+ componentType,
86
+ componentLabel: this.adapter.componentName || 'tabela',
87
+ });
88
+ return {
89
+ contextHints: patchRequest.contextHints ?? contextHints,
90
+ patchRequest,
85
91
  };
86
92
  };
87
93
  const progressPrompt = this.progressPromptFor(request, prompt);
@@ -2403,6 +2409,7 @@ class TableAgenticAuthoringTurnFlow {
2403
2409
  ? []
2404
2410
  : this.toQuickReplies(response, request),
2405
2411
  canApply: false,
2412
+ diagnostics: response.warnings?.length ? { warnings: response.warnings } : undefined,
2406
2413
  };
2407
2414
  }
2408
2415
  if (response.type === 'error') {
@@ -2466,6 +2473,11 @@ class TableAgenticAuthoringTurnFlow {
2466
2473
  return this.normalizeLabel(response.code ?? '') === 'turn in progress';
2467
2474
  }
2468
2475
  compileAdapterResponse(response, request) {
2476
+ response = this.normalizeConsultativeSourcePlaceholderResponse(response, request);
2477
+ const consultativePresentationOptions = this.consultativePresentationOptionsBoundary(response, request);
2478
+ if (consultativePresentationOptions) {
2479
+ return consultativePresentationOptions;
2480
+ }
2469
2481
  response = this.normalizeCategoricalRendererPalette(response, request);
2470
2482
  const incompatibleBooleanStatusPresentation = this.incompatibleBooleanStatusPresentationBoundary(response, request);
2471
2483
  if (incompatibleBooleanStatusPresentation) {
@@ -2764,6 +2776,43 @@ class TableAgenticAuthoringTurnFlow {
2764
2776
  return openOnlySurfaceRuntimeOperation;
2765
2777
  return this.normalizeGovernedCategoricalSelectionExecutableResponse(compiledResponse, request);
2766
2778
  }
2779
+ consultativePresentationOptionsBoundary(response, request) {
2780
+ if (!request)
2781
+ return null;
2782
+ if (this.requestIsCanonicalRendererSelection(request))
2783
+ return null;
2784
+ if (this.requestHasGovernedCategoricalSelection(request))
2785
+ return null;
2786
+ if (this.responseCarriesClarificationChoices(response))
2787
+ return null;
2788
+ if ((response.options ?? []).length || (response.optionPayloads ?? []).length)
2789
+ return null;
2790
+ const normalizedCurrentPrompt = this.normalizeLabel(request.prompt ?? '');
2791
+ const normalizedConversationPrompt = this.normalizeLabel(this.componentPresentationPromptForTurn(request));
2792
+ if (!this.promptRequestsPresentationOptions(normalizedConversationPrompt))
2793
+ return null;
2794
+ if (this.promptRequestsExplicitMaterialization(normalizedCurrentPrompt)
2795
+ || this.promptRequestsExplicitMaterialization(normalizedConversationPrompt)) {
2796
+ return null;
2797
+ }
2798
+ const hasExecutableEnvelope = this.responseMayContainExecutableEnvelope(response)
2799
+ || this.componentEditOperations(response.componentEditPlan).length > 0
2800
+ || !!this.toRecord(response.patch);
2801
+ if (!hasExecutableEnvelope && response.type !== 'info' && response.type !== 'clarification') {
2802
+ return null;
2803
+ }
2804
+ return {
2805
+ ...response,
2806
+ type: response.type === 'clarification' ? 'clarification' : 'info',
2807
+ componentEditPlan: undefined,
2808
+ patch: undefined,
2809
+ warnings: [
2810
+ ...(response.warnings ?? []),
2811
+ 'consultative-presentation-options-kept-non-executable',
2812
+ '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.',
2813
+ ],
2814
+ };
2815
+ }
2767
2816
  visualPresentationChoiceClarificationBoundary(response, request) {
2768
2817
  const carriesVisualPayload = (response.optionPayloads ?? [])
2769
2818
  .some((payload) => this.isVisualPresentationClarificationPayload(payload));
@@ -2848,6 +2897,32 @@ class TableAgenticAuthoringTurnFlow {
2848
2897
  'visual',
2849
2898
  ].some((token) => this.normalizedTextContainsApproxPhrase(normalized, token));
2850
2899
  }
2900
+ promptRequestsExplicitMaterialization(normalizedPrompt) {
2901
+ if (!normalizedPrompt)
2902
+ return false;
2903
+ return [
2904
+ 'aplica',
2905
+ 'aplicar',
2906
+ 'aplique',
2907
+ 'altera',
2908
+ 'alterar',
2909
+ 'altere',
2910
+ 'configura',
2911
+ 'configurar',
2912
+ 'configure',
2913
+ 'cria',
2914
+ 'criar',
2915
+ 'crie',
2916
+ 'muda',
2917
+ 'mudar',
2918
+ 'mude',
2919
+ 'mostra como',
2920
+ 'mostre como',
2921
+ 'transforma',
2922
+ 'transformar',
2923
+ 'transforme',
2924
+ ].some((token) => this.normalizedTextContainsApproxPhrase(normalizedPrompt, token));
2925
+ }
2851
2926
  normalizeCategoricalRendererPalette(response, request) {
2852
2927
  const plan = this.toRecord(response.componentEditPlan);
2853
2928
  const operations = this.componentEditOperations(plan);
@@ -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-CunEk0vb.mjs';
4
+ import { G as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, W as coerceTableComponentEditPlans, Y as compileTableComponentEditPlans, I as TASK_PRESETS, a1 as getTableComponentEditPlanCapabilities, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, E as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-DWQN-OpC.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
  },
@@ -422,8 +428,45 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
422
428
  { value: 'menu', label: 'Menu' },
423
429
  { value: 'rating', label: 'Rating' },
424
430
  { value: 'html', label: 'HTML' },
431
+ { value: 'microVisualization', label: 'Micro visualization' },
425
432
  ],
426
433
  },
434
+ 'columns[].renderer.microVisualization.visualization.valueExpr': {
435
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
436
+ },
437
+ 'columns[].renderer.microVisualization.visualization.valueSuffixExpr': {
438
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
439
+ },
440
+ 'columns[].renderer.microVisualization.visualization.totalExpr': {
441
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
442
+ },
443
+ 'columns[].renderer.microVisualization.visualization.targetExpr': {
444
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
445
+ },
446
+ 'columns[].renderer.microVisualization.visualization.baselineExpr': {
447
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
448
+ },
449
+ 'columns[].renderer.microVisualization.visualization.segmentsExpr': {
450
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
451
+ },
452
+ 'columns[].renderer.microVisualization.visualization.pointsExpr': {
453
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
454
+ },
455
+ 'columns[].renderer.microVisualization.visualization.thresholdsExpr': {
456
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
457
+ },
458
+ 'columns[].renderer.microVisualization.visualization.itemsExpr': {
459
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
460
+ },
461
+ 'columns[].renderer.microVisualization.visualization.toneExpr': {
462
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
463
+ },
464
+ 'columns[].renderer.microVisualization.visualization.ariaLabelExpr': {
465
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
466
+ },
467
+ 'columns[].renderer.microVisualization.visualization.fallbackTextExpr': {
468
+ ...TABLE_ROW_EXPRESSION_CONTEXT_OPTION,
469
+ },
427
470
  'columns[].conditionalRenderers[].renderer.type': {
428
471
  mode: 'enum',
429
472
  options: [
@@ -439,6 +482,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
439
482
  { value: 'menu', label: 'Menu' },
440
483
  { value: 'rating', label: 'Rating' },
441
484
  { value: 'html', label: 'HTML' },
485
+ { value: 'microVisualization', label: 'Micro visualization' },
442
486
  { value: 'compose', label: 'Compose' },
443
487
  ],
444
488
  },
@@ -529,6 +573,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
529
573
  { value: 'menu', label: 'Menu' },
530
574
  { value: 'rating', label: 'Rating' },
531
575
  { value: 'html', label: 'HTML' },
576
+ { value: 'microVisualization', label: 'Micro visualization' },
532
577
  ],
533
578
  },
534
579
  'actions.row.actions[].color': {
@@ -1577,7 +1622,7 @@ const TABLE_COMPONENT_CONTEXT_PACK = {
1577
1622
  {
1578
1623
  name: 'condition',
1579
1624
  type: 'STRING',
1580
- description: 'Expressao condicional (ex: recompensa > 500000)'
1625
+ description: 'Objeto JSON Logic canonico serializado, nunca DSL textual (ex: { ">": [{ "var": "recompensa" }, 500000] })'
1581
1626
  },
1582
1627
  {
1583
1628
  name: 'renderer',
@@ -2204,6 +2249,9 @@ class TableAiAdapter extends BaseAiAdapter {
2204
2249
  'bulk-actions',
2205
2250
  'selection-derived-export-scope',
2206
2251
  'styling-capabilities',
2252
+ 'column-format-options',
2253
+ 'column-presentation-options',
2254
+ 'boolean-status-presentation-options',
2207
2255
  'conditional-renderers',
2208
2256
  'conditional-styles',
2209
2257
  'conditional-animations',
@@ -3678,7 +3726,13 @@ Columns Analysis:
3678
3726
  const isRootArray = currentPath && (allowedPaths.has(currentPath + '[]') || Array.from(allowedPaths).some(p => p.startsWith(currentPath + '[].')));
3679
3727
  if (!isRootArray)
3680
3728
  return obj; // É um valor array (ex: tags), retorna direto
3681
- return obj.map(item => recurse(item, currentPath + '[]'));
3729
+ const items = obj.map(item => recurse(item, currentPath + '[]'));
3730
+ if (currentPath === 'columns[].conditionalRenderers'
3731
+ || currentPath === 'columns[].conditionalStyles'
3732
+ || currentPath === 'rowConditionalStyles') {
3733
+ return items.filter((item) => this.hasCanonicalConditionalRule(item));
3734
+ }
3735
+ return items;
3682
3736
  }
3683
3737
  const cleanObj = {};
3684
3738
  for (const key of Object.keys(obj)) {
@@ -3690,14 +3744,6 @@ Columns Analysis:
3690
3744
  const exactMatch = allowedPaths.has(newPath) || isIdentityField;
3691
3745
  const prefixMatch = Array.from(allowedPaths).some(p => p.startsWith(newPath + '.') || p.startsWith(newPath + '['));
3692
3746
  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
3747
  if (newPath === 'columns[].computed.expression') {
3702
3748
  if (!obj[key] || typeof obj[key] !== 'object' || Array.isArray(obj[key])) {
3703
3749
  warnings.push(`Computed expression inválida: ${newPath} (deve ser Json Logic)`);
@@ -3710,6 +3756,22 @@ Columns Analysis:
3710
3756
  cleanObj[key] = obj[key];
3711
3757
  continue;
3712
3758
  }
3759
+ if (exactMatch && jsonLogicObjectPaths.has(newPath)) {
3760
+ if (!this.isCanonicalJsonLogicObject(obj[key])) {
3761
+ warnings.push(`Condicao Json Logic invalida: ${newPath} (deve ser objeto Json Logic)`);
3762
+ continue;
3763
+ }
3764
+ cleanObj[key] = obj[key];
3765
+ continue;
3766
+ }
3767
+ if (exactMatch
3768
+ && passthroughObjectPaths.has(newPath)
3769
+ && typeof obj[key] === 'object'
3770
+ && obj[key] !== null
3771
+ && !Array.isArray(obj[key])) {
3772
+ cleanObj[key] = obj[key];
3773
+ continue;
3774
+ }
3713
3775
  const val = recurse(obj[key], newPath);
3714
3776
  // Se for objeto vazio após limpeza, não inclui (salvo se for intenção explicita de limpar config, mas patch geralmente é aditivo)
3715
3777
  if (typeof val === 'object' && val !== null && !Array.isArray(val) && Object.keys(val).length === 0) {
@@ -3728,6 +3790,17 @@ Columns Analysis:
3728
3790
  const sanitized = recurse(patch, '');
3729
3791
  return { sanitized, warnings };
3730
3792
  }
3793
+ isCanonicalJsonLogicObject(value) {
3794
+ return !!value
3795
+ && typeof value === 'object'
3796
+ && !Array.isArray(value)
3797
+ && Object.keys(value).length === 1;
3798
+ }
3799
+ hasCanonicalConditionalRule(value) {
3800
+ if (!value || typeof value !== 'object' || Array.isArray(value))
3801
+ return false;
3802
+ return this.isCanonicalJsonLogicObject(value['condition']);
3803
+ }
3731
3804
  // -------- Internal helpers --------
3732
3805
  /**
3733
3806
  * Specialized merge for TableConfig that handles Array reconciliation safely.
@@ -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-CunEk0vb.mjs';
1
+ export { A as AnalyticsTableConfigAdapterService, a as AnalyticsTableContractService, b as AnalyticsTableStatsApiService, B as BOOLEAN_PRESETS, c as BehaviorConfigEditorComponent, C as CURRENCY_PRESETS, d as ColumnsConfigEditorComponent, D as DATE_PRESETS, e as DataFormatterComponent, f as DataFormattingService, F as FORMULA_TEMPLATES, g as FilterConfigService, h as FilterSettingsComponent, i as FormulaGeneratorService, J as JsonConfigEditorComponent, M as MessagesLocalizationEditorComponent, N as NUMBER_PRESETS, P as PERCENTAGE_PRESETS, j as PRAXIS_FILTER_COMPONENT_METADATA, k as PRAXIS_TABLE_AUTHORING_MANIFEST, l as PRAXIS_TABLE_COMPONENT_METADATA, m as PRAXIS_TABLE_TOOLBAR_DEFAULT_APPEARANCE, n as PRAXIS_TABLE_TOOLBAR_TOKEN_PRESETS, o as PraxisFilter, p as PraxisFilterWidgetConfigEditor, q as PraxisTable, r as PraxisTableConfigEditor, s as PraxisTableInlineAuthoringEditorComponent, t as PraxisTableToolbar, u as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, v as TABLE_COMPONENT_AI_CAPABILITIES, w as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, z as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_KIND, H as TABLE_COMPONENT_EDIT_PLAN_VERSION, I as TASK_PRESETS, K as TableDefaultsProvider, L as TableRulesEditorComponent, O as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, Q as VisualFormulaBuilderComponent, R as buildTableApplyPlan, U as coerceTableComponentEditPlan, W as coerceTableComponentEditPlans, X as compileTableComponentEditPlan, Y as compileTableComponentEditPlans, Z as createTableAuthoringDocument, _ as getActionId, $ as getEnum, a0 as getTableCapabilities, a1 as getTableComponentEditPlanCapabilities, a2 as isTableRendererSupportedByRichContentP0, a3 as mapTableRendererToRichContentP0, a4 as normalizeTableAuthoringDocument, a5 as parseLegacyOrTableDocument, a6 as providePraxisFilterMetadata, a7 as providePraxisTableMetadata, a8 as providePraxisTableToolbarAppearance, a9 as serializeTableAuthoringDocument, aa as toCanonicalTableConfig, ab as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-DWQN-OpC.mjs';
package/package.json CHANGED
@@ -1,23 +1,24 @@
1
1
  {
2
2
  "name": "@praxisui/table",
3
- "version": "9.0.0-beta.3",
3
+ "version": "9.0.0-beta.31",
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.3",
9
- "@praxisui/core": "^9.0.0-beta.3",
10
- "@praxisui/dynamic-fields": "^9.0.0-beta.3",
11
- "@praxisui/dynamic-form": "^9.0.0-beta.3",
12
- "@praxisui/metadata-editor": "^9.0.0-beta.3",
13
- "@praxisui/rich-content": "^9.0.0-beta.3",
14
- "@praxisui/settings-panel": "^9.0.0-beta.3",
15
- "@praxisui/table-rule-builder": "^9.0.0-beta.3",
8
+ "@angular/platform-browser": "^21.0.0",
9
+ "@praxisui/ai": "^9.0.0-beta.31",
10
+ "@praxisui/core": "^9.0.0-beta.31",
11
+ "@praxisui/dynamic-fields": "^9.0.0-beta.31",
12
+ "@praxisui/dynamic-form": "^9.0.0-beta.31",
13
+ "@praxisui/metadata-editor": "^9.0.0-beta.31",
14
+ "@praxisui/rich-content": "^9.0.0-beta.31",
15
+ "@praxisui/settings-panel": "^9.0.0-beta.31",
16
+ "@praxisui/table-rule-builder": "^9.0.0-beta.31",
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.3",
21
+ "@praxisui/dialog": "^9.0.0-beta.31",
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
+ }