@praxisui/table 8.0.0-beta.75 → 8.0.0-beta.77

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-uGmLaI9F.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-CzZSCTe1.mjs';
5
5
 
6
6
  const TABLE_COMPONENT_CONTEXT_PACK = {
7
7
  version: 'v1',
@@ -2025,6 +2025,7 @@ class TableAiAdapter extends BaseAiAdapter {
2025
2025
  'When the user asks for similar, matching, or comparable records from selected records without naming which property should define similarity, return clarification with options derived from filterFieldCatalog labels instead of info text or a patch.',
2026
2026
  'When recordSurfaces exists and the user asks to open, consult, view, navigate, or inspect information related to the selected record, answer from recordSurfaces before considering selection-derived filters.',
2027
2027
  'Resolve related-surface requests by the declared recordSurfaces semantic catalog, including label, description, semanticIntent, kind, scope, and tags; do not fall back to selected-record filters when a declared surface semantically satisfies the request.',
2028
+ 'When several recordSurfaces are semantically close, prefer READ_PROJECTION or VIEW surfaces for user verbs such as show, view, consult, list, inspect, summarize, or tell me about; prefer FORM or PARTIAL_FORM only for edit, update, change, create, or maintenance requests.',
2028
2029
  'Use dynamicPage.surface.open only when recordSurfaces declares the requested surface and the user asks to open, show, navigate to, or display that related surface now.',
2029
2030
  'Do not use table.filter.apply for related-surface requests unless the user explicitly asks to find other records.',
2030
2031
  'When runtimeOperations.filterExpression.supported is not true, do not materialize OR, alternative groups, or nested boolean filters; ask which single filter field/value should be applied or explain the limitation.',
@@ -2057,6 +2058,7 @@ class TableAiAdapter extends BaseAiAdapter {
2057
2058
  'When selectedRecordsContext.filterCandidates exists, treat those candidates as the canonical selection-derived bridge to advanced filters; prefer their labels and criteria over re-inferring values from prose.',
2058
2059
  'When recordSurfaces exists and the user asks what can be opened, consulted, navigated, or viewed for selected records, answer or clarify using recordSurfaces before considering selection-derived filters.',
2059
2060
  'For record-related surface requests, ground the target in recordSurfaces semantic fields such as label, description, semanticIntent, kind, scope, and tags before considering filters.',
2061
+ 'When recordSurfaces contains both read and write surfaces for a similar concept, explain or choose the read surface for information requests and the write surface only for maintenance requests.',
2060
2062
  'Do not use selection-derived filters for requests about related surfaces, detail panels, timelines, teams, profiles, histories, payroll, or other record-adjacent information unless the user explicitly asks to find other records.',
2061
2063
  'If the user asks for a related surface that is not declared in recordSurfaces, say that it is not available in the current context and list the declared surfaces in human-facing labels.',
2062
2064
  'When the user asks how selected records can drive advanced filters or export, bridge the selected records to declared filterFieldCatalog fields and export scopes conceptually; ask for clarification when the shared property or export scope is ambiguous.',
@@ -2093,6 +2095,7 @@ class TableAiAdapter extends BaseAiAdapter {
2093
2095
  rules: [
2094
2096
  'Return type "patch" with tableRuntimeOperations when the request can be materialized by a declared runtimeOperations operation.',
2095
2097
  'For dynamicPage.surface.open, emit tableRuntimeOperations.operations[] with operationId "dynamicPage.surface.open" and input.surfaceId equal to one declared recordSurfaces.surfaces[].id.',
2098
+ 'For dynamicPage.surface.open, choose a READ_PROJECTION or VIEW recordSurface when the user is asking to see or understand information; choose FORM or PARTIAL_FORM only when the user is asking to edit or update information.',
2096
2099
  'Do not answer with a textual confirmation before emitting dynamicPage.surface.open when a single requested record surface is declared and the user asks to open or show it now.',
2097
2100
  'Ask clarification only when more than one declared runtime operation or record surface could satisfy the same user request.',
2098
2101
  'Keep the explanation user-facing; do not expose operationIds, resource paths, field names, or payload details unless the user explicitly asks for technical details.',
@@ -2769,7 +2772,7 @@ class TableAiAdapter extends BaseAiAdapter {
2769
2772
  error: 'A operacao dynamicPage.surface.open exige surfaceId.',
2770
2773
  };
2771
2774
  }
2772
- const surface = this.getRecordSurfaceForOpenInput(operation.input);
2775
+ const surface = await this.resolveRecordSurfaceForOpenInput(operation.input);
2773
2776
  if (!surface) {
2774
2777
  return {
2775
2778
  success: false,
@@ -2831,7 +2834,46 @@ class TableAiAdapter extends BaseAiAdapter {
2831
2834
  const matches = surfaces
2832
2835
  .map((surface) => this.toRecord(surface))
2833
2836
  .filter((surface) => !!surface && aliases.some((alias) => this.recordSurfaceAliases(surface).has(alias)));
2834
- return matches.length === 1 ? matches[0] : null;
2837
+ if (matches.length === 1)
2838
+ return matches[0];
2839
+ return this.getRecordSurfaceBySemanticAlias(aliases);
2840
+ }
2841
+ async resolveRecordSurfaceForOpenInput(input) {
2842
+ const initial = this.getRecordSurfaceForOpenInput(input);
2843
+ if (initial)
2844
+ return initial;
2845
+ const tableWithRecordSurfaces = this.table;
2846
+ try {
2847
+ await tableWithRecordSurfaces.ensureAiAssistantRecordSurfaceContext?.();
2848
+ }
2849
+ catch {
2850
+ return null;
2851
+ }
2852
+ return this.getRecordSurfaceForOpenInput(input);
2853
+ }
2854
+ getRecordSurfaceBySemanticAlias(aliases) {
2855
+ const inputTokens = new Set(aliases.flatMap((alias) => this.recordSurfaceAliasTokens(alias)));
2856
+ if (!inputTokens.size)
2857
+ return null;
2858
+ const recordSurfaces = this.getRecordSurfaceAuthoringContext();
2859
+ const surfaces = Array.isArray(recordSurfaces?.['surfaces']) ? recordSurfaces['surfaces'] : [];
2860
+ const ranked = surfaces
2861
+ .map((surface) => this.toRecord(surface))
2862
+ .filter((surface) => !!surface)
2863
+ .map((surface) => {
2864
+ const surfaceTokens = new Set([...this.recordSurfaceAliases(surface)]
2865
+ .flatMap((alias) => this.recordSurfaceAliasTokens(alias)));
2866
+ const score = [...inputTokens]
2867
+ .filter((token) => surfaceTokens.has(token))
2868
+ .length;
2869
+ return { surface, score };
2870
+ })
2871
+ .filter((entry) => entry.score > 0)
2872
+ .sort((a, b) => b.score - a.score);
2873
+ if (!ranked.length)
2874
+ return null;
2875
+ const [first, second] = ranked;
2876
+ return !second || first.score > second.score ? first.surface : null;
2835
2877
  }
2836
2878
  recordSurfaceAliases(surface) {
2837
2879
  const aliases = new Set();
@@ -2846,9 +2888,19 @@ class TableAiAdapter extends BaseAiAdapter {
2846
2888
  add(surface['id']);
2847
2889
  add(surface['label']);
2848
2890
  add(surface['description']);
2891
+ add(surface['title']);
2892
+ add(surface['semanticIntent']);
2893
+ add(surface['semanticDescription']);
2894
+ add(surface['kind']);
2895
+ add(surface['operationId']);
2896
+ this.compactStringArray(surface['tags']).forEach(add);
2849
2897
  add(resourceSurface?.['id']);
2850
2898
  add(resourceSurface?.['title']);
2851
2899
  add(resourceSurface?.['description']);
2900
+ add(resourceSurface?.['intent']);
2901
+ add(resourceSurface?.['kind']);
2902
+ add(resourceSurface?.['operationId']);
2903
+ this.compactStringArray(resourceSurface?.['tags']).forEach(add);
2852
2904
  return aliases;
2853
2905
  }
2854
2906
  normalizeRecordSurfaceAlias(value) {
@@ -2860,6 +2912,12 @@ class TableAiAdapter extends BaseAiAdapter {
2860
2912
  .replace(/-+/g, '-')
2861
2913
  .replace(/^-|-$/g, '');
2862
2914
  }
2915
+ recordSurfaceAliasTokens(value) {
2916
+ return this.normalizeRecordSurfaceAlias(value)
2917
+ .split('-')
2918
+ .map((token) => token.trim())
2919
+ .filter((token) => token.length >= 2);
2920
+ }
2863
2921
  hydrateRecordSurfaceRowActionPlans(plans) {
2864
2922
  if (!plans?.length)
2865
2923
  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-CzZSCTe1.mjs';
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@praxisui/table",
3
- "version": "8.0.0-beta.75",
3
+ "version": "8.0.0-beta.77",
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.75",
9
- "@praxisui/core": "^8.0.0-beta.75",
10
- "@praxisui/dynamic-fields": "^8.0.0-beta.75",
11
- "@praxisui/dynamic-form": "^8.0.0-beta.75",
12
- "@praxisui/metadata-editor": "^8.0.0-beta.75",
13
- "@praxisui/rich-content": "^8.0.0-beta.75",
14
- "@praxisui/settings-panel": "^8.0.0-beta.75",
15
- "@praxisui/table-rule-builder": "^8.0.0-beta.75",
8
+ "@praxisui/ai": "^8.0.0-beta.77",
9
+ "@praxisui/core": "^8.0.0-beta.77",
10
+ "@praxisui/dynamic-fields": "^8.0.0-beta.77",
11
+ "@praxisui/dynamic-form": "^8.0.0-beta.77",
12
+ "@praxisui/metadata-editor": "^8.0.0-beta.77",
13
+ "@praxisui/rich-content": "^8.0.0-beta.77",
14
+ "@praxisui/settings-panel": "^8.0.0-beta.77",
15
+ "@praxisui/table-rule-builder": "^8.0.0-beta.77",
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.75",
20
+ "@praxisui/dialog": "^8.0.0-beta.77",
21
21
  "rxjs": "~7.8.0"
22
22
  },
23
23
  "dependencies": {