@praxisui/table 8.0.0-beta.74 → 8.0.0-beta.76

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.
@@ -39578,7 +39578,7 @@ class PraxisTable {
39578
39578
  if (this.aiAdapter || this.aiAdapterLoadStarted)
39579
39579
  return;
39580
39580
  this.aiAdapterLoadStarted = true;
39581
- import('./praxisui-table-table-ai.adapter-ZaGeIt0F.mjs')
39581
+ import('./praxisui-table-table-ai.adapter-CAcaQOuS.mjs')
39582
39582
  .then(({ TableAiAdapter }) => {
39583
39583
  this.aiAdapter = new TableAiAdapter(this);
39584
39584
  this.initializeAiAssistantController();
@@ -1,7 +1,7 @@
1
1
  import { firstValueFrom } from 'rxjs';
2
2
  import { BaseAiAdapter, createComponentAuthoringContext } from '@praxisui/ai';
3
3
  import { deepMerge } from '@praxisui/core';
4
- import { z as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, R as coerceTableComponentEditPlans, W as compileTableComponentEditPlans, G as TASK_PRESETS, $ as getTableComponentEditPlanCapabilities, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-s848_dht.mjs';
4
+ import { z as TABLE_COMPONENT_EDIT_PLAN_OPERATION_IDS, k as PRAXIS_TABLE_AUTHORING_MANIFEST, T as TABLE_AI_CAPABILITIES, R as coerceTableComponentEditPlans, W as compileTableComponentEditPlans, G as TASK_PRESETS, $ as getTableComponentEditPlanCapabilities, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, y as TABLE_COMPONENT_EDIT_PLAN_KIND } from './praxisui-table-praxisui-table-B11kGhJt.mjs';
5
5
 
6
6
  const TABLE_COMPONENT_CONTEXT_PACK = {
7
7
  version: 'v1',
@@ -2769,7 +2769,7 @@ class TableAiAdapter extends BaseAiAdapter {
2769
2769
  error: 'A operacao dynamicPage.surface.open exige surfaceId.',
2770
2770
  };
2771
2771
  }
2772
- const surface = this.getRecordSurfaceForOpenInput(operation.input);
2772
+ const surface = await this.resolveRecordSurfaceForOpenInput(operation.input);
2773
2773
  if (!surface) {
2774
2774
  return {
2775
2775
  success: false,
@@ -2831,7 +2831,46 @@ class TableAiAdapter extends BaseAiAdapter {
2831
2831
  const matches = surfaces
2832
2832
  .map((surface) => this.toRecord(surface))
2833
2833
  .filter((surface) => !!surface && aliases.some((alias) => this.recordSurfaceAliases(surface).has(alias)));
2834
- return matches.length === 1 ? matches[0] : null;
2834
+ if (matches.length === 1)
2835
+ return matches[0];
2836
+ return this.getRecordSurfaceBySemanticAlias(aliases);
2837
+ }
2838
+ async resolveRecordSurfaceForOpenInput(input) {
2839
+ const initial = this.getRecordSurfaceForOpenInput(input);
2840
+ if (initial)
2841
+ return initial;
2842
+ const tableWithRecordSurfaces = this.table;
2843
+ try {
2844
+ await tableWithRecordSurfaces.ensureAiAssistantRecordSurfaceContext?.();
2845
+ }
2846
+ catch {
2847
+ return null;
2848
+ }
2849
+ return this.getRecordSurfaceForOpenInput(input);
2850
+ }
2851
+ getRecordSurfaceBySemanticAlias(aliases) {
2852
+ const inputTokens = new Set(aliases.flatMap((alias) => this.recordSurfaceAliasTokens(alias)));
2853
+ if (!inputTokens.size)
2854
+ return null;
2855
+ const recordSurfaces = this.getRecordSurfaceAuthoringContext();
2856
+ const surfaces = Array.isArray(recordSurfaces?.['surfaces']) ? recordSurfaces['surfaces'] : [];
2857
+ const ranked = surfaces
2858
+ .map((surface) => this.toRecord(surface))
2859
+ .filter((surface) => !!surface)
2860
+ .map((surface) => {
2861
+ const surfaceTokens = new Set([...this.recordSurfaceAliases(surface)]
2862
+ .flatMap((alias) => this.recordSurfaceAliasTokens(alias)));
2863
+ const score = [...inputTokens]
2864
+ .filter((token) => surfaceTokens.has(token))
2865
+ .length;
2866
+ return { surface, score };
2867
+ })
2868
+ .filter((entry) => entry.score > 0)
2869
+ .sort((a, b) => b.score - a.score);
2870
+ if (!ranked.length)
2871
+ return null;
2872
+ const [first, second] = ranked;
2873
+ return !second || first.score > second.score ? first.surface : null;
2835
2874
  }
2836
2875
  recordSurfaceAliases(surface) {
2837
2876
  const aliases = new Set();
@@ -2846,9 +2885,19 @@ class TableAiAdapter extends BaseAiAdapter {
2846
2885
  add(surface['id']);
2847
2886
  add(surface['label']);
2848
2887
  add(surface['description']);
2888
+ add(surface['title']);
2889
+ add(surface['semanticIntent']);
2890
+ add(surface['semanticDescription']);
2891
+ add(surface['kind']);
2892
+ add(surface['operationId']);
2893
+ this.compactStringArray(surface['tags']).forEach(add);
2849
2894
  add(resourceSurface?.['id']);
2850
2895
  add(resourceSurface?.['title']);
2851
2896
  add(resourceSurface?.['description']);
2897
+ add(resourceSurface?.['intent']);
2898
+ add(resourceSurface?.['kind']);
2899
+ add(resourceSurface?.['operationId']);
2900
+ this.compactStringArray(resourceSurface?.['tags']).forEach(add);
2852
2901
  return aliases;
2853
2902
  }
2854
2903
  normalizeRecordSurfaceAlias(value) {
@@ -2860,6 +2909,12 @@ class TableAiAdapter extends BaseAiAdapter {
2860
2909
  .replace(/-+/g, '-')
2861
2910
  .replace(/^-|-$/g, '');
2862
2911
  }
2912
+ recordSurfaceAliasTokens(value) {
2913
+ return this.normalizeRecordSurfaceAlias(value)
2914
+ .split('-')
2915
+ .map((token) => token.trim())
2916
+ .filter((token) => token.length >= 2);
2917
+ }
2863
2918
  hydrateRecordSurfaceRowActionPlans(plans) {
2864
2919
  if (!plans?.length)
2865
2920
  return plans;
@@ -1 +1 @@
1
- export { A as AnalyticsTableConfigAdapterService, a as AnalyticsTableContractService, b as AnalyticsTableStatsApiService, B as BOOLEAN_PRESETS, c as BehaviorConfigEditorComponent, C as CURRENCY_PRESETS, d as ColumnsConfigEditorComponent, D as DATE_PRESETS, e as DataFormatterComponent, f as DataFormattingService, F as FORMULA_TEMPLATES, g as FilterConfigService, h as FilterSettingsComponent, i as FormulaGeneratorService, J as JsonConfigEditorComponent, M as MessagesLocalizationEditorComponent, N as NUMBER_PRESETS, P as PERCENTAGE_PRESETS, j as PRAXIS_FILTER_COMPONENT_METADATA, k as PRAXIS_TABLE_AUTHORING_MANIFEST, l as PRAXIS_TABLE_COMPONENT_METADATA, m as PraxisFilter, n as PraxisFilterWidgetConfigEditor, o as PraxisTable, p as PraxisTableConfigEditor, q as PraxisTableInlineAuthoringEditorComponent, r as PraxisTableToolbar, s as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, t as TABLE_COMPONENT_AI_CAPABILITIES, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, y as TABLE_COMPONENT_EDIT_PLAN_KIND, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, G as TASK_PRESETS, H as TableDefaultsProvider, I as TableRulesEditorComponent, K as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, L as VisualFormulaBuilderComponent, O as buildTableApplyPlan, Q as coerceTableComponentEditPlan, R as coerceTableComponentEditPlans, U as compileTableComponentEditPlan, W as compileTableComponentEditPlans, X as createTableAuthoringDocument, Y as getActionId, Z as getEnum, _ as getTableCapabilities, $ as getTableComponentEditPlanCapabilities, a0 as isTableRendererSupportedByRichContentP0, a1 as mapTableRendererToRichContentP0, a2 as normalizeTableAuthoringDocument, a3 as parseLegacyOrTableDocument, a4 as providePraxisFilterMetadata, a5 as providePraxisTableMetadata, a6 as serializeTableAuthoringDocument, a7 as toCanonicalTableConfig, a8 as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-s848_dht.mjs';
1
+ export { A as AnalyticsTableConfigAdapterService, a as AnalyticsTableContractService, b as AnalyticsTableStatsApiService, B as BOOLEAN_PRESETS, c as BehaviorConfigEditorComponent, C as CURRENCY_PRESETS, d as ColumnsConfigEditorComponent, D as DATE_PRESETS, e as DataFormatterComponent, f as DataFormattingService, F as FORMULA_TEMPLATES, g as FilterConfigService, h as FilterSettingsComponent, i as FormulaGeneratorService, J as JsonConfigEditorComponent, M as MessagesLocalizationEditorComponent, N as NUMBER_PRESETS, P as PERCENTAGE_PRESETS, j as PRAXIS_FILTER_COMPONENT_METADATA, k as PRAXIS_TABLE_AUTHORING_MANIFEST, l as PRAXIS_TABLE_COMPONENT_METADATA, m as PraxisFilter, n as PraxisFilterWidgetConfigEditor, o as PraxisTable, p as PraxisTableConfigEditor, q as PraxisTableInlineAuthoringEditorComponent, r as PraxisTableToolbar, s as PraxisTableWidgetConfigEditor, S as STRING_PRESETS, T as TABLE_AI_CAPABILITIES, t as TABLE_COMPONENT_AI_CAPABILITIES, u as TABLE_COMPONENT_EDIT_PLAN_ALLOWED_CHANGE_KINDS, v as TABLE_COMPONENT_EDIT_PLAN_BATCH_KIND, w as TABLE_COMPONENT_EDIT_PLAN_EXPECTED_PATHS, x as TABLE_COMPONENT_EDIT_PLAN_JSON_SCHEMA, y as TABLE_COMPONENT_EDIT_PLAN_KIND, E as TABLE_COMPONENT_EDIT_PLAN_VERSION, G as TASK_PRESETS, H as TableDefaultsProvider, I as TableRulesEditorComponent, K as ToolbarActionsEditorComponent, V as ValueMappingEditorComponent, L as VisualFormulaBuilderComponent, O as buildTableApplyPlan, Q as coerceTableComponentEditPlan, R as coerceTableComponentEditPlans, U as compileTableComponentEditPlan, W as compileTableComponentEditPlans, X as createTableAuthoringDocument, Y as getActionId, Z as getEnum, _ as getTableCapabilities, $ as getTableComponentEditPlanCapabilities, a0 as isTableRendererSupportedByRichContentP0, a1 as mapTableRendererToRichContentP0, a2 as normalizeTableAuthoringDocument, a3 as parseLegacyOrTableDocument, a4 as providePraxisFilterMetadata, a5 as providePraxisTableMetadata, a6 as serializeTableAuthoringDocument, a7 as toCanonicalTableConfig, a8 as validateTableAuthoringDocument } from './praxisui-table-praxisui-table-B11kGhJt.mjs';
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@praxisui/table",
3
- "version": "8.0.0-beta.74",
3
+ "version": "8.0.0-beta.76",
4
4
  "description": "Advanced data table for Angular (Praxis UI) with editing, filtering, sorting, virtualization, and settings panel integration.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
7
7
  "@angular/core": "^21.0.0",
8
- "@praxisui/ai": "^8.0.0-beta.74",
9
- "@praxisui/core": "^8.0.0-beta.74",
10
- "@praxisui/dynamic-fields": "^8.0.0-beta.74",
11
- "@praxisui/dynamic-form": "^8.0.0-beta.74",
12
- "@praxisui/metadata-editor": "^8.0.0-beta.74",
13
- "@praxisui/rich-content": "^8.0.0-beta.74",
14
- "@praxisui/settings-panel": "^8.0.0-beta.74",
15
- "@praxisui/table-rule-builder": "^8.0.0-beta.74",
8
+ "@praxisui/ai": "^8.0.0-beta.76",
9
+ "@praxisui/core": "^8.0.0-beta.76",
10
+ "@praxisui/dynamic-fields": "^8.0.0-beta.76",
11
+ "@praxisui/dynamic-form": "^8.0.0-beta.76",
12
+ "@praxisui/metadata-editor": "^8.0.0-beta.76",
13
+ "@praxisui/rich-content": "^8.0.0-beta.76",
14
+ "@praxisui/settings-panel": "^8.0.0-beta.76",
15
+ "@praxisui/table-rule-builder": "^8.0.0-beta.76",
16
16
  "@angular/cdk": "^21.0.0",
17
17
  "@angular/forms": "^21.0.0",
18
18
  "@angular/material": "^21.0.0",
19
19
  "@angular/router": "^21.0.0",
20
- "@praxisui/dialog": "^8.0.0-beta.74",
20
+ "@praxisui/dialog": "^8.0.0-beta.76",
21
21
  "rxjs": "~7.8.0"
22
22
  },
23
23
  "dependencies": {