@praxisui/tabs 1.0.0-beta.30 → 1.0.0-beta.40

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.
package/index.d.ts CHANGED
@@ -1,12 +1,29 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, OnChanges, EventEmitter, SimpleChanges, Provider } from '@angular/core';
2
+ import { OnInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges, Provider } from '@angular/core';
3
3
  import { MatTabChangeEvent } from '@angular/material/tabs';
4
4
  import { FormGroup } from '@angular/forms';
5
5
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
6
- import { WidgetDefinition, ComponentDocMeta, ComponentMetadataRegistry } from '@praxisui/core';
6
+ import { WidgetDefinition, ComponentDocMeta, ComponentMetadataRegistry, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
7
+ import { BaseAiAdapter, Capability as Capability$1, PatchResult } from '@praxisui/ai';
7
8
  import { BehaviorSubject } from 'rxjs';
8
9
  import { SettingsValueProvider } from '@praxisui/settings-panel';
9
10
 
11
+ declare class TabsAiAdapter extends BaseAiAdapter<TabsMetadata> {
12
+ private tabs;
13
+ componentName: string;
14
+ constructor(tabs: PraxisTabs);
15
+ getCurrentConfig(): TabsMetadata;
16
+ getCapabilities(): Capability$1[];
17
+ getRuntimeState(): Record<string, any>;
18
+ createSnapshot(): TabsMetadata;
19
+ restoreSnapshot(snapshot: TabsMetadata): Promise<void>;
20
+ applyPatch(patch: Partial<TabsMetadata>): Promise<PatchResult>;
21
+ private applyConfig;
22
+ private smartMergeTabsConfig;
23
+ private mergeByKey;
24
+ private cloneConfig;
25
+ }
26
+
10
27
  interface TabsMetadata {
11
28
  meta?: any;
12
29
  appearance?: TabsAppearanceConfig;
@@ -106,12 +123,17 @@ interface TabsStyleTokens {
106
123
  'divider-color': string;
107
124
  'background-color': string;
108
125
  }
109
- declare class PraxisTabs implements OnInit, OnChanges {
126
+ declare class PraxisTabs implements OnInit, OnChanges, OnDestroy {
110
127
  private readonly settings;
111
128
  private readonly storage;
112
129
  private readonly snack;
130
+ private readonly componentKeys;
131
+ private readonly logger;
132
+ private readonly route;
133
+ private warnedMissingId;
113
134
  config: TabsMetadata | null;
114
- tabsId?: string;
135
+ tabsId: string;
136
+ componentInstanceId?: string;
115
137
  editModeEnabled: boolean;
116
138
  form: FormGroup | null;
117
139
  context: Record<string, any> | null;
@@ -130,12 +152,15 @@ declare class PraxisTabs implements OnInit, OnChanges {
130
152
  output?: string;
131
153
  payload?: any;
132
154
  }>;
155
+ aiAdapter: TabsAiAdapter;
133
156
  protected currentNavIndex: i0.WritableSignal<number>;
134
157
  protected selectedIndexSignal: i0.WritableSignal<number>;
135
158
  private groupLoaded;
136
159
  private navLoaded;
160
+ private readonly destroy$;
137
161
  ngOnInit(): void;
138
162
  ngOnChanges(changes: SimpleChanges): void;
163
+ ngOnDestroy(): void;
139
164
  isNavMode(): boolean;
140
165
  effectiveAnimationDuration(): string;
141
166
  getNavActive(i: number): boolean;
@@ -150,6 +175,12 @@ declare class PraxisTabs implements OnInit, OnChanges {
150
175
  resetPreferences(): void;
151
176
  openQuickSetup(): void;
152
177
  private storageKey;
178
+ private syncSelectionFromConfig;
179
+ private persistConfig;
180
+ private componentKeyId;
181
+ private warnMissingId;
182
+ private clampIndex;
183
+ applyConfigFromAdapter(next: TabsMetadata): void;
153
184
  private isLazy;
154
185
  protected groupContentReady(index: number): boolean;
155
186
  protected navContentReady(index: number): boolean;
@@ -164,9 +195,12 @@ declare class PraxisTabs implements OnInit, OnChanges {
164
195
  output?: string;
165
196
  payload?: any;
166
197
  }): void;
198
+ protected styleScopeId(): string;
199
+ protected safeCustomCss(): string | null;
200
+ private sanitizeCssValue;
167
201
  protected styleCss(): string | null;
168
202
  static ɵfac: i0.ɵɵFactoryDeclaration<PraxisTabs, never>;
169
- static ɵcmp: i0.ɵɵComponentDeclaration<PraxisTabs, "praxis-tabs", never, { "config": { "alias": "config"; "required": false; }; "tabsId": { "alias": "tabsId"; "required": false; }; "editModeEnabled": { "alias": "editModeEnabled"; "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>;
203
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisTabs, "praxis-tabs", never, { "config": { "alias": "config"; "required": false; }; "tabsId": { "alias": "tabsId"; "required": true; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "editModeEnabled": { "alias": "editModeEnabled"; "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>;
170
204
  }
171
205
 
172
206
  declare const PRAXIS_TABS_COMPONENT_METADATA: ComponentDocMeta;
@@ -269,5 +303,28 @@ declare class PraxisTabsConfigEditor implements SettingsValueProvider {
269
303
  static ɵcmp: i0.ɵɵComponentDeclaration<PraxisTabsConfigEditor, "praxis-tabs-config-editor", never, {}, {}, never, never, true, never>;
270
304
  }
271
305
 
272
- export { PRAXIS_TABS_COMPONENT_METADATA, PraxisTabs, PraxisTabsConfigEditor, providePraxisTabsMetadata };
273
- export type { TabGroupMetadata, TabLinkMetadata, TabMetadata, TabNavMetadata, TabsAccessibilityConfig, TabsAppearanceConfig, TabsBehaviorConfig, TabsEventConfig, TabsMetadata, TabsStyleTokens };
306
+ /**
307
+ * Capabilities catalog for Praxis Tabs (TabsMetadata).
308
+ * Paths follow TabsMetadata shape (patches are merged at config root).
309
+ */
310
+
311
+ declare module '@praxisui/core' {
312
+ interface AiCapabilityCategoryMap {
313
+ meta: true;
314
+ group: true;
315
+ nav: true;
316
+ tabs: true;
317
+ }
318
+ }
319
+ type CapabilityCategory = AiCapabilityCategory;
320
+ type ValueKind = AiValueKind;
321
+ interface Capability extends AiCapability {
322
+ category: CapabilityCategory;
323
+ }
324
+ interface CapabilityCatalog extends AiCapabilityCatalog {
325
+ capabilities: Capability[];
326
+ }
327
+ declare const TABS_AI_CAPABILITIES: CapabilityCatalog;
328
+
329
+ export { PRAXIS_TABS_COMPONENT_METADATA, PraxisTabs, PraxisTabsConfigEditor, TABS_AI_CAPABILITIES, providePraxisTabsMetadata };
330
+ export type { Capability, CapabilityCatalog, CapabilityCategory, TabGroupMetadata, TabLinkMetadata, TabMetadata, TabNavMetadata, TabsAccessibilityConfig, TabsAppearanceConfig, TabsBehaviorConfig, TabsEventConfig, TabsMetadata, TabsStyleTokens, ValueKind };
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@praxisui/tabs",
3
- "version": "1.0.0-beta.30",
3
+ "version": "1.0.0-beta.40",
4
4
  "description": "Configurable tabs (group and nav) for Praxis UI with metadata-driven content and runtime editor.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.0.0",
7
7
  "@angular/core": "^20.0.0",
8
8
  "@angular/material": "^20.0.0",
9
9
  "@angular/cdk": "^20.0.0",
10
- "@praxisui/core": "^1.0.0-beta.30",
11
- "@praxisui/dynamic-fields": "^1.0.0-beta.30",
12
- "@praxisui/settings-panel": "^1.0.0-beta.30"
10
+ "@praxisui/core": "^1.0.0-beta.40",
11
+ "@praxisui/dynamic-fields": "^1.0.0-beta.40",
12
+ "@praxisui/settings-panel": "^1.0.0-beta.40"
13
13
  },
14
14
  "dependencies": {
15
15
  "tslib": "^2.3.0",