@praxisui/settings-panel 10.0.0-rc.60 → 10.0.0-rc.62

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/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@praxisui/settings-panel",
3
- "version": "10.0.0-rc.60",
3
+ "version": "10.0.0-rc.62",
4
4
  "description": "Settings panel for Praxis UI libraries: open editors for configuration at runtime and persist settings.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
7
7
  "@angular/core": "^21.0.0",
8
8
  "@angular/cdk": "^21.0.0",
9
9
  "@angular/material": "^21.0.0",
10
- "@praxisui/ai": "^10.0.0-rc.60",
11
- "@praxisui/core": "^10.0.0-rc.60",
12
- "@praxisui/dynamic-fields": "^10.0.0-rc.60",
10
+ "@praxisui/ai": "^10.0.0-rc.62",
11
+ "@praxisui/core": "^10.0.0-rc.62",
12
+ "@praxisui/dynamic-fields": "^10.0.0-rc.62",
13
13
  "rxjs": "~7.8.0"
14
14
  },
15
15
  "dependencies": {
@@ -3,7 +3,7 @@ import { DestroyRef, Type, Injector, ComponentRef, Provider, OnDestroy, ChangeDe
3
3
  import * as rxjs from 'rxjs';
4
4
  import { Observable, BehaviorSubject } from 'rxjs';
5
5
  import { OverlayRef, Overlay, OverlayContainer } from '@angular/cdk/overlay';
6
- import { SurfaceOutcome, PraxisI18nService, SurfaceDrawerNavigationFrame, SurfaceDrawerNavigationGuard, ConfigStorageSaveError, ConfigStorageScope, GlobalConfig, FormConfig, FormValueChangeEvent, AiCapability, AiCapabilityCategory, AiCapabilityCatalog, AiValueKind, ComponentAuthoringManifest, ComponentDocMeta } from '@praxisui/core';
6
+ import { ConfigStorageSaveError, SurfaceOutcome, PraxisI18nService, SurfaceDrawerNavigationFrame, SurfaceDrawerNavigationGuard, ConfigStorageScope, GlobalConfig, FormConfig, FormValueChangeEvent, AiCapability, AiCapabilityCategory, AiCapabilityCatalog, AiValueKind, ComponentAuthoringManifest, ComponentDocMeta } from '@praxisui/core';
7
7
  import { MatDialog } from '@angular/material/dialog';
8
8
  import { MatSnackBar } from '@angular/material/snack-bar';
9
9
  import { AiProviderCatalogItem } from '@praxisui/ai';
@@ -32,7 +32,7 @@ interface SettingsPanelContextNavigation {
32
32
  activeModeId?: string;
33
33
  onSelectMode?: (modeId: string) => void;
34
34
  }
35
- interface SettingsPanelConfig {
35
+ interface SettingsPanelConfig<TValue = any> {
36
36
  /** Transient owner lifetime; never persisted or forwarded to editor inputs. */
37
37
  owner?: DestroyRef;
38
38
  id: string;
@@ -55,6 +55,16 @@ interface SettingsPanelConfig {
55
55
  showWriteScope?: boolean;
56
56
  /** Allows switching between personal ('user') and shared ('tenant') configuration scopes. */
57
57
  canSwitchWriteScope?: boolean;
58
+ /**
59
+ * Optional async persistence hook invoked with the saved settings value before closing the panel.
60
+ * When provided and throwing/rejecting/erroring, the panel stays open with the inline error banner.
61
+ */
62
+ onSave?: (value: TValue) => unknown | Promise<unknown> | Observable<unknown>;
63
+ /**
64
+ * Optional async persistence hook invoked on reset before emitting reset/resetToDefaults.
65
+ * When provided and throwing/rejecting/erroring, the panel stays open with the inline error banner.
66
+ */
67
+ onReset?: () => unknown | Promise<unknown> | Observable<unknown>;
58
68
  diagnostics?: SettingsPanelDiagnosticsConfig;
59
69
  /** Lazy inputs run once after close mediation accepts this opening. */
60
70
  content: {
@@ -157,16 +167,20 @@ declare class SettingsPanelRef {
157
167
  private appliedSubject;
158
168
  private savedSubject;
159
169
  private resetSubject;
170
+ private tenantBaselineRestoredSubject;
160
171
  private closedSubject;
161
172
  private sizeChangedSubject;
173
+ private persistenceErrorSubject;
162
174
  private sizePersistor?;
163
175
  applied$: rxjs.Observable<any>;
164
176
  saved$: rxjs.Observable<any>;
165
177
  reset$: rxjs.Observable<void>;
178
+ tenantBaselineRestored$: rxjs.Observable<unknown>;
166
179
  closed$: rxjs.Observable<SettingsPanelCloseReason>;
167
180
  sizeChanged$: rxjs.Observable<{
168
181
  width: string;
169
182
  }>;
183
+ persistenceError$: rxjs.Observable<ConfigStorageSaveError>;
170
184
  constructor(overlayRef: OverlayRef);
171
185
  apply(value: any): void;
172
186
  /**
@@ -177,6 +191,8 @@ declare class SettingsPanelRef {
177
191
  */
178
192
  save(value: any): void;
179
193
  reset(): void;
194
+ notifyTenantBaselineRestored(baseline: unknown): void;
195
+ reportPersistenceError(error: ConfigStorageSaveError): void;
180
196
  bindSizePersistor(fn: (width: string) => void): void;
181
197
  updateSize(width: string | number, options?: {
182
198
  persist?: boolean;
@@ -190,21 +206,27 @@ declare class DeferredSettingsPanelRef {
190
206
  private readonly appliedSubject;
191
207
  private readonly savedSubject;
192
208
  private readonly resetSubject;
209
+ private readonly tenantBaselineRestoredSubject;
193
210
  private readonly closedSubject;
194
211
  private readonly sizeChangedSubject;
212
+ private readonly persistenceErrorSubject;
195
213
  private target?;
196
214
  private completed;
197
215
  applied$: rxjs.Observable<any>;
198
216
  saved$: rxjs.Observable<any>;
199
217
  reset$: rxjs.Observable<void>;
218
+ tenantBaselineRestored$: rxjs.Observable<unknown>;
200
219
  closed$: rxjs.Observable<SettingsPanelCloseReason>;
201
220
  sizeChanged$: rxjs.Observable<{
202
221
  width: string;
203
222
  }>;
223
+ persistenceError$: rxjs.Observable<ConfigStorageSaveError>;
204
224
  resolve(target: SettingsPanelRef): void;
205
225
  apply(value: any): void;
206
226
  save(value: any): void;
207
227
  reset(): void;
228
+ notifyTenantBaselineRestored(baseline: unknown): void;
229
+ reportPersistenceError(error: ConfigStorageSaveError): void;
208
230
  bindSizePersistor(_fn: (width: string) => void): void;
209
231
  setPreviewing(previewing: boolean): void;
210
232
  updateSize(width: string | number, options?: {
@@ -485,6 +507,8 @@ declare class SettingsPanelComponent {
485
507
  configStorageKey?: string;
486
508
  showWriteScope: boolean;
487
509
  canSwitchWriteScope: boolean;
510
+ persistSaveHandler?: (value: any) => unknown | Promise<unknown> | Observable<unknown>;
511
+ persistResetHandler?: () => unknown | Promise<unknown> | Observable<unknown>;
488
512
  previewing: boolean;
489
513
  private previewElement;
490
514
  private previewScroll;
@@ -499,7 +523,8 @@ declare class SettingsPanelComponent {
499
523
  titleId: string;
500
524
  private readonly dirtyState;
501
525
  private readonly validState;
502
- private readonly busyState;
526
+ private readonly providerBusyState;
527
+ private readonly persistenceBusyState;
503
528
  get isDirty(): boolean;
504
529
  set isDirty(value: boolean);
505
530
  get isValid(): boolean;
@@ -509,12 +534,18 @@ declare class SettingsPanelComponent {
509
534
  diagnostics: Required<SettingsPanelDiagnosticsConfig>;
510
535
  private lastSavedAt;
511
536
  private hasAppliedChanges;
537
+ private saveFailedPendingRetry;
538
+ private confirmDialogOpen;
539
+ private saveErrorStreamBound;
540
+ get isConfirmDialogOpen(): boolean;
512
541
  private activePointerId;
513
542
  private dragStartX;
514
543
  private dragStartWidth;
515
544
  private collapsedWidthBeforeExpand;
516
545
  private readonly destroyRef;
546
+ private readonly injector;
517
547
  private readonly i18n;
548
+ private readonly contextSwitchGuard;
518
549
  private readonly directApiStorage;
519
550
  private readonly asyncConfigStorage;
520
551
  private readonly scopeErrorStorage;
@@ -522,6 +553,7 @@ declare class SettingsPanelComponent {
522
553
  readonly applyActionLabel: string;
523
554
  readonly saveActionLabel: string;
524
555
  private contentHost;
556
+ private saveErrorBanner?;
525
557
  constructor(cdr: ChangeDetectorRef, dialog: MatDialog, elementRef: ElementRef<HTMLElement>, overlayContainer: OverlayContainer);
526
558
  get canInspectPreview(): boolean;
527
559
  get hasContextNavigation(): boolean;
@@ -550,22 +582,35 @@ declare class SettingsPanelComponent {
550
582
  get activeWriteScope(): ConfigStorageScope | null;
551
583
  get showWriteScopeControls(): boolean;
552
584
  get canToggleWriteScope(): boolean;
585
+ private resolveTenantResetStorage;
553
586
  get canResetPersonalOverride(): boolean;
554
587
  get writeScopeLabel(): string;
555
588
  get writeScopeToggleLabel(): string;
556
589
  get formattedSaveErrorMessage(): string;
590
+ get saveErrorFieldMessages(): string[];
591
+ get canSwitchToPersonalScopeFromError(): boolean;
557
592
  toggleWriteScope(): void;
558
593
  switchToPersonalScopeFromError(): void;
559
594
  dismissSaveError(): void;
560
595
  resetPersonalOverrideToTenant(): void;
596
+ private matchesPanelStorageKey;
597
+ private resolveScopeErrorStorage;
598
+ private checkWriteGate;
599
+ private isPrebuiltSaveError;
600
+ private handlePersistenceFailure;
561
601
  tx(text: string, params?: Record<string, string | number | boolean | null | undefined>): string;
562
602
  actionLabel(text: string): string;
563
603
  attachContent(component: Type<any>, injector: Injector, ref: SettingsPanelRef, inputs?: Record<string, unknown>): void;
564
604
  private applyInputs;
565
605
  private resolveSupportedInputs;
566
606
  onReset(): void;
607
+ private finalizeReset;
608
+ private runAsyncResetFlow;
567
609
  onApply(): void;
568
610
  onSave(): void;
611
+ private runAsyncSaveFlow;
612
+ private awaitResult;
613
+ private canProceedWithSave;
569
614
  private emitSave;
570
615
  private formatClock;
571
616
  initializeLayout(state: SettingsPanelLayoutState): void;