@praxisui/tabs 8.0.0-beta.6 → 8.0.0-beta.61

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,27 +1,47 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges, Provider } from '@angular/core';
2
+ import { OnInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges, Provider, AfterViewInit } from '@angular/core';
3
3
  import { MatTabChangeEvent } from '@angular/material/tabs';
4
- import { AiCapability, WidgetDefinition, WidgetEventEnvelope, WidgetEventPathSegment, PraxisI18nConfig, ComponentDocMeta, ComponentMetadataRegistry, AiCapabilityCategory, AiValueKind, AiCapabilityCatalog } from '@praxisui/core';
4
+ import { AiCapability, WidgetDefinition, WidgetEventEnvelope, WidgetEventPathSegment, PraxisI18nConfig, ComponentDocMeta, ComponentMetadataRegistry, SettingsValueProvider as SettingsValueProvider$1, AiCapabilityCategory, AiCapabilityCatalog, AiValueKind, ComponentAuthoringManifest } from '@praxisui/core';
5
5
  import { FormGroup } from '@angular/forms';
6
6
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
7
- import { BaseAiAdapter, PatchResult } from '@praxisui/ai';
7
+ import { BaseAiAdapter, AiResponseCompileResult, PatchResult, PraxisAssistantTurnViewState, PraxisAssistantShellLayout, PraxisAssistantShellLabels, PraxisAssistantSessionSnapshot, PraxisAssistantShellQuickReply, PraxisAssistantShellMessage } from '@praxisui/ai';
8
8
  import { BehaviorSubject } from 'rxjs';
9
9
  import { SettingsValueProvider } from '@praxisui/settings-panel';
10
10
 
11
+ type TabsAiSummaryParams = Record<string, string | number | boolean | null | undefined>;
12
+ type TabsAiTranslate = (key: string, fallback: string, params?: TabsAiSummaryParams) => string;
11
13
  declare class TabsAiAdapter extends BaseAiAdapter<TabsMetadata> {
12
14
  private tabs;
15
+ private readonly translate?;
13
16
  componentName: string;
14
- constructor(tabs: PraxisTabs);
17
+ componentId: string;
18
+ componentType: string;
19
+ constructor(tabs: PraxisTabs, translate?: TabsAiTranslate | undefined);
20
+ compileAiResponse(response: Record<string, unknown>): AiResponseCompileResult | null;
15
21
  getCurrentConfig(): TabsMetadata;
16
22
  getCapabilities(): AiCapability[];
23
+ getDataProfile(): Record<string, any>;
24
+ getSchemaFields(): Record<string, any>[];
25
+ getAuthoringContext(): Record<string, any>;
17
26
  getRuntimeState(): Record<string, any>;
18
27
  createSnapshot(): TabsMetadata;
19
28
  restoreSnapshot(snapshot: TabsMetadata): Promise<void>;
20
29
  applyPatch(patch: Partial<TabsMetadata>): Promise<PatchResult>;
21
30
  private applyConfig;
22
31
  private smartMergeTabsConfig;
32
+ private coalesceByKey;
23
33
  private mergeByKey;
24
34
  private cloneConfig;
35
+ private resolveTargetId;
36
+ private resolveTextLabel;
37
+ private resolveTabAddInput;
38
+ private resolveTabContentInput;
39
+ private summarizeOperations;
40
+ private t;
41
+ private interpolate;
42
+ private toRecord;
43
+ private toText;
44
+ private normalizeToken;
25
45
  }
26
46
 
27
47
  interface TabsMetadata {
@@ -34,6 +54,12 @@ interface TabsMetadata {
34
54
  tabs?: TabMetadata[];
35
55
  nav?: TabNavMetadata;
36
56
  }
57
+ interface TabsConfigChangeEvent {
58
+ inputPatch: {
59
+ config: TabsMetadata;
60
+ };
61
+ }
62
+ type TabsConfigPersistenceStrategy = 'storage-first' | 'input-first';
37
63
  interface TabsAppearanceConfig {
38
64
  density?: 'compact' | 'comfortable' | 'spacious';
39
65
  themeClass?: string;
@@ -81,9 +107,11 @@ interface TabMetadata {
81
107
  ariaLabel?: string;
82
108
  ariaLabelledby?: string;
83
109
  textLabel?: string;
110
+ icon?: string;
84
111
  labelClass?: string | string[];
85
112
  bodyClass?: string | string[];
86
113
  disabled?: boolean;
114
+ visible?: boolean;
87
115
  content?: any[];
88
116
  widgets?: WidgetDefinition[];
89
117
  isActive?: boolean;
@@ -106,8 +134,10 @@ interface TabNavMetadata {
106
134
  interface TabLinkMetadata {
107
135
  id?: string;
108
136
  label: string;
137
+ icon?: string;
109
138
  active?: boolean;
110
139
  disabled?: boolean;
140
+ visible?: boolean;
111
141
  disableRipple?: boolean;
112
142
  fitInkBarToContent?: boolean;
113
143
  content?: any[];
@@ -135,11 +165,19 @@ declare class PraxisTabs implements OnInit, OnChanges, OnDestroy {
135
165
  private readonly snack;
136
166
  private readonly componentKeys;
137
167
  private readonly logger;
168
+ private readonly cdr;
169
+ private readonly aiApi;
170
+ private readonly assistantSessions;
171
+ private readonly aiTurnOrchestrator;
138
172
  private readonly route;
173
+ private readonly aiAssistantSessionEffect;
139
174
  private warnedMissingId;
175
+ private loadedStorageKey;
140
176
  config: TabsMetadata | null;
141
177
  tabsId: string;
142
178
  componentInstanceId?: string;
179
+ configPersistenceStrategy: TabsConfigPersistenceStrategy;
180
+ set selectedIndex(index: number | null | undefined);
143
181
  enableCustomization: boolean;
144
182
  form: FormGroup | null;
145
183
  context: Record<string, any> | null;
@@ -149,26 +187,76 @@ declare class PraxisTabs implements OnInit, OnChanges, OnDestroy {
149
187
  selectedTabChange: EventEmitter<MatTabChangeEvent>;
150
188
  indexFocused: EventEmitter<number>;
151
189
  selectFocusedIndex: EventEmitter<number>;
190
+ configChange: EventEmitter<TabsConfigChangeEvent>;
152
191
  widgetEvent: EventEmitter<WidgetEventEnvelope>;
153
192
  aiAdapter: TabsAiAdapter;
193
+ aiAssistantOpen: boolean;
194
+ aiAssistantPrompt: string;
195
+ aiAssistantViewState: PraxisAssistantTurnViewState | null;
196
+ aiAssistantLayout: PraxisAssistantShellLayout;
197
+ readonly aiAssistantLabels: Partial<PraxisAssistantShellLabels>;
198
+ private aiAssistantController;
199
+ private aiAssistantStateSubscription;
154
200
  protected currentNavIndex: i0.WritableSignal<number>;
155
201
  protected selectedIndexSignal: i0.WritableSignal<number>;
156
202
  private groupLoaded;
157
203
  private navLoaded;
204
+ private controlledSelectedIndex?;
158
205
  private readonly destroy$;
159
206
  private readonly widgetDefinitionCache;
207
+ private readonly generatedContentForm;
160
208
  ngOnInit(): void;
161
209
  ngOnChanges(changes: SimpleChanges): void;
162
210
  ngOnDestroy(): void;
163
211
  isNavMode(): boolean;
164
212
  effectiveAnimationDuration(): string;
165
213
  getNavActive(i: number): boolean;
214
+ protected visibleNavLinkEntries(): Array<{
215
+ link: TabLinkMetadata;
216
+ index: number;
217
+ }>;
218
+ protected visibleTabEntries(): Array<{
219
+ tab: TabMetadata;
220
+ index: number;
221
+ }>;
222
+ protected selectedVisibleNavIndex(): number;
223
+ protected selectedVisibleTabIndex(): number;
224
+ protected effectiveContentForm(): FormGroup;
225
+ protected onVisibleTabIndexChange(index: number): void;
166
226
  onNavClick(i: number): void;
167
227
  onNavDrop(event: CdkDragDrop<any>): void;
228
+ protected onVisibleNavDrop(event: CdkDragDrop<any>): void;
168
229
  onSelectedIndexChange(index: number): void;
230
+ private applySelectedIndex;
231
+ private reapplyControlledSelectedIndex;
169
232
  closeTab(index: number): void;
170
233
  moveTab(index: number, delta: number): void;
171
234
  openEditor(): void;
235
+ openAiAssistant(): void;
236
+ openAiAssistantFromSession(session: PraxisAssistantSessionSnapshot): void;
237
+ closeAiAssistant(): void;
238
+ onAiAssistantPromptChange(prompt: string): void;
239
+ onAiAssistantSubmit(prompt: string): void;
240
+ onAiAssistantApply(): void;
241
+ onAiAssistantRetry(): void;
242
+ onAiAssistantCancel(): void;
243
+ onAiAssistantQuickReply(reply: PraxisAssistantShellQuickReply): void;
244
+ onAiAssistantEditMessage(message: PraxisAssistantShellMessage): void;
245
+ onAiAssistantResendMessage(message: PraxisAssistantShellMessage): void;
246
+ onAiAssistantLayoutChange(layout: PraxisAssistantShellLayout): void;
247
+ private initializeAiAssistantController;
248
+ private buildAiAssistantContextItems;
249
+ private buildAiAssistantContextSnapshot;
250
+ private syncAiAssistantSession;
251
+ private hasAiAssistantSessionState;
252
+ private resolveAiAssistantSessionId;
253
+ private resolveAiAssistantOwnerId;
254
+ private resolveAiAssistantRouteKey;
255
+ private resolveAiAssistantSummary;
256
+ private resolveAiAssistantBadge;
257
+ private resolveAiAssistantIcon;
258
+ private collectContentFieldNames;
259
+ private collectTabsCounts;
172
260
  addEmptyTab(): void;
173
261
  /** Clears persisted tabs configuration to fallback to defaults */
174
262
  resetPreferences(): void;
@@ -177,8 +265,11 @@ declare class PraxisTabs implements OnInit, OnChanges, OnDestroy {
177
265
  t(key: string, fallback: string): string;
178
266
  private applyTabsAuthoringPlan;
179
267
  private storageKey;
268
+ private loadStoredConfigForCurrentIdentity;
180
269
  private syncSelectionFromConfig;
270
+ private pruneLoadedIndexes;
181
271
  private persistConfig;
272
+ private usesInputFirstConfig;
182
273
  private componentKeyId;
183
274
  private warnMissingId;
184
275
  private clampIndex;
@@ -187,11 +278,26 @@ declare class PraxisTabs implements OnInit, OnChanges, OnDestroy {
187
278
  protected groupContentReady(index: number): boolean;
188
279
  protected navContentReady(index: number): boolean;
189
280
  protected isEmptyGlobal(): boolean;
281
+ protected trackVisibleNavLink(index: number, entry: {
282
+ link: TabLinkMetadata;
283
+ index: number;
284
+ }): string;
285
+ protected trackVisibleTab(index: number, entry: {
286
+ tab: TabMetadata;
287
+ index: number;
288
+ }): string;
190
289
  protected trackNavLink(index: number, link: TabLinkMetadata): string;
191
290
  protected trackTab(index: number, tab: TabMetadata): string;
192
291
  protected trackWidgetDefinition(index: number, widget: WidgetDefinition): string;
292
+ protected safeWidgetDefinitions(widgets: unknown): WidgetDefinition[];
193
293
  protected resolveWidgetDefinition(widget: WidgetDefinition): WidgetDefinition;
294
+ private syncGeneratedContentForm;
295
+ private collectContentFields;
296
+ private resolveContentFieldName;
194
297
  protected emitWidgetEvent(path: WidgetEventPathSegment[], ev: WidgetEventEnvelope): void;
298
+ private emitAgenticPageCompositionRequest;
299
+ private shouldDelegateAiAssistantPromptToPageBuilder;
300
+ private normalizeAssistantPrompt;
195
301
  protected tabEventPath(tabId: string | undefined, tabIndex: number): WidgetEventPathSegment[];
196
302
  protected linkEventPath(linkId: string | undefined, linkIndex: number): WidgetEventPathSegment[];
197
303
  protected styleScopeId(): string;
@@ -199,8 +305,9 @@ declare class PraxisTabs implements OnInit, OnChanges, OnDestroy {
199
305
  private sanitizeCssValue;
200
306
  protected styleCss(): string | null;
201
307
  private cloneWidgetDefinition;
308
+ private cloneTabsMetadata;
202
309
  static ɵfac: i0.ɵɵFactoryDeclaration<PraxisTabs, never>;
203
- static ɵcmp: i0.ɵɵComponentDeclaration<PraxisTabs, "praxis-tabs", never, { "config": { "alias": "config"; "required": false; }; "tabsId": { "alias": "tabsId"; "required": true; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; }; "form": { "alias": "form"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, { "animationDone": "animationDone"; "focusChange": "focusChange"; "selectedIndexChange": "selectedIndexChange"; "selectedTabChange": "selectedTabChange"; "indexFocused": "indexFocused"; "selectFocusedIndex": "selectFocusedIndex"; "widgetEvent": "widgetEvent"; }, never, never, true, never>;
310
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisTabs, "praxis-tabs", never, { "config": { "alias": "config"; "required": false; }; "tabsId": { "alias": "tabsId"; "required": true; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "configPersistenceStrategy": { "alias": "configPersistenceStrategy"; "required": false; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; }; "form": { "alias": "form"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, { "animationDone": "animationDone"; "focusChange": "focusChange"; "selectedIndexChange": "selectedIndexChange"; "selectedTabChange": "selectedTabChange"; "indexFocused": "indexFocused"; "selectFocusedIndex": "selectFocusedIndex"; "configChange": "configChange"; "widgetEvent": "widgetEvent"; }, never, never, true, never>;
204
311
  }
205
312
 
206
313
  declare const PRAXIS_TABS_I18N_NAMESPACE = "praxisTabs";
@@ -258,6 +365,7 @@ interface TabsApplyPlan {
258
365
  declare class PraxisTabsConfigEditor implements SettingsValueProvider {
259
366
  private registry;
260
367
  private readonly i18n;
368
+ set document(value: TabsAuthoringDocument | null | undefined);
261
369
  primaryMode: 'group' | 'nav';
262
370
  editedDocument: TabsAuthoringDocument;
263
371
  editedConfig: TabsMetadata;
@@ -331,6 +439,7 @@ declare class PraxisTabsConfigEditor implements SettingsValueProvider {
331
439
  isValid$: BehaviorSubject<boolean>;
332
440
  isBusy$: BehaviorSubject<boolean>;
333
441
  constructor(data: any, registry: ComponentMetadataRegistry);
442
+ private initializeDocument;
334
443
  private inferPrimaryMode;
335
444
  setPrimaryMode(mode: 'group' | 'nav'): void;
336
445
  private updateDirty;
@@ -373,7 +482,44 @@ declare class PraxisTabsConfigEditor implements SettingsValueProvider {
373
482
  onTabWidgetDrop(tabIndex: number, event: CdkDragDrop<WidgetDefinition[]>): void;
374
483
  onLinkWidgetDrop(linkIndex: number, event: CdkDragDrop<WidgetDefinition[]>): void;
375
484
  static ɵfac: i0.ɵɵFactoryDeclaration<PraxisTabsConfigEditor, never>;
376
- static ɵcmp: i0.ɵɵComponentDeclaration<PraxisTabsConfigEditor, "praxis-tabs-config-editor", never, {}, {}, never, never, true, never>;
485
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisTabsConfigEditor, "praxis-tabs-config-editor", never, { "document": { "alias": "document"; "required": false; }; }, {}, never, never, true, never>;
486
+ }
487
+
488
+ interface PraxisTabsWidgetEditorInputs {
489
+ config?: TabsMetadata | null;
490
+ tabsId?: string | null;
491
+ componentInstanceId?: string | null;
492
+ [key: string]: unknown;
493
+ }
494
+ interface PraxisTabsWidgetEditorValue {
495
+ inputs: PraxisTabsWidgetEditorInputs;
496
+ }
497
+ declare class PraxisTabsWidgetConfigEditor implements SettingsValueProvider$1, AfterViewInit, OnDestroy {
498
+ set inputs(value: PraxisTabsWidgetEditorInputs | null);
499
+ get inputs(): PraxisTabsWidgetEditorInputs | null;
500
+ set widgetKey(value: string | undefined);
501
+ get widgetKey(): string | undefined;
502
+ tabsEditor?: PraxisTabsConfigEditor;
503
+ readonly isDirty$: BehaviorSubject<boolean>;
504
+ readonly isValid$: BehaviorSubject<boolean>;
505
+ readonly isBusy$: BehaviorSubject<boolean>;
506
+ private readonly subscription;
507
+ private readonly emptyConfig;
508
+ private _inputs;
509
+ private _widgetKey?;
510
+ editorDocument: TabsAuthoringDocument;
511
+ get config(): TabsMetadata;
512
+ get tabsId(): string | null | undefined;
513
+ get componentInstanceId(): string | null | undefined;
514
+ ngAfterViewInit(): void;
515
+ ngOnDestroy(): void;
516
+ getSettingsValue(): PraxisTabsWidgetEditorValue;
517
+ onSave(): PraxisTabsWidgetEditorValue;
518
+ reset(): void;
519
+ private buildValue;
520
+ private createDocument;
521
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisTabsWidgetConfigEditor, never>;
522
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisTabsWidgetConfigEditor, "praxis-tabs-widget-config-editor", never, { "inputs": { "alias": "inputs"; "required": false; }; "widgetKey": { "alias": "widgetKey"; "required": false; }; }, {}, never, never, true, never>;
377
523
  }
378
524
 
379
525
  declare function createTabsAuthoringDocument(source: {
@@ -412,5 +558,7 @@ interface CapabilityCatalog extends AiCapabilityCatalog {
412
558
  }
413
559
  declare const TABS_AI_CAPABILITIES: CapabilityCatalog;
414
560
 
415
- export { PRAXIS_TABS_COMPONENT_METADATA, PRAXIS_TABS_I18N_CONFIG, PRAXIS_TABS_I18N_NAMESPACE, PraxisTabs, PraxisTabsConfigEditor, TABS_AI_CAPABILITIES, buildTabsApplyPlan, createPraxisTabsI18nConfig, createTabsAuthoringDocument, normalizeTabsAuthoringDocument, providePraxisTabsI18n, providePraxisTabsMetadata, serializeTabsAuthoringDocument, toCanonicalTabsConfig, validateTabsAuthoringDocument };
416
- export type { Capability, CapabilityCatalog, CapabilityCategory, TabGroupMetadata, TabLinkMetadata, TabMetadata, TabNavMetadata, TabsAccessibilityConfig, TabsAppearanceConfig, TabsApplyPlan, TabsAuthoringBindings, TabsAuthoringDocument, TabsBehaviorConfig, TabsBindingsDiff, TabsEditorDiagnostic, TabsEditorDiagnosticLevel, TabsEditorDocumentKind, TabsEventConfig, TabsMetadata, TabsRuntimeContext, TabsRuntimePlan, TabsStyleTokens, ValueKind };
561
+ declare const PRAXIS_TABS_AUTHORING_MANIFEST: ComponentAuthoringManifest;
562
+
563
+ export { PRAXIS_TABS_AUTHORING_MANIFEST, PRAXIS_TABS_COMPONENT_METADATA, PRAXIS_TABS_I18N_CONFIG, PRAXIS_TABS_I18N_NAMESPACE, PraxisTabs, PraxisTabsConfigEditor, PraxisTabsWidgetConfigEditor, TABS_AI_CAPABILITIES, buildTabsApplyPlan, createPraxisTabsI18nConfig, createTabsAuthoringDocument, normalizeTabsAuthoringDocument, providePraxisTabsI18n, providePraxisTabsMetadata, serializeTabsAuthoringDocument, toCanonicalTabsConfig, validateTabsAuthoringDocument };
564
+ export type { Capability, CapabilityCatalog, CapabilityCategory, PraxisTabsWidgetEditorInputs, PraxisTabsWidgetEditorValue, TabGroupMetadata, TabLinkMetadata, TabMetadata, TabNavMetadata, TabsAccessibilityConfig, TabsAppearanceConfig, TabsApplyPlan, TabsAuthoringBindings, TabsAuthoringDocument, TabsBehaviorConfig, TabsBindingsDiff, TabsConfigChangeEvent, TabsConfigPersistenceStrategy, TabsEditorDiagnostic, TabsEditorDiagnosticLevel, TabsEditorDocumentKind, TabsEventConfig, TabsMetadata, TabsRuntimeContext, TabsRuntimePlan, TabsStyleTokens, ValueKind };