@praxisui/settings-panel 10.0.0-rc.6 → 10.0.0-rc.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.
- package/README.md +10 -0
- package/ai/component-registry.json +136 -8
- package/fesm2022/praxisui-settings-panel.mjs +1223 -115
- package/package.json +4 -4
- package/types/praxisui-settings-panel.d.ts +115 -6
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/settings-panel",
|
|
3
|
-
"version": "10.0.0-rc.
|
|
3
|
+
"version": "10.0.0-rc.61",
|
|
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.
|
|
11
|
-
"@praxisui/core": "^10.0.0-rc.
|
|
12
|
-
"@praxisui/dynamic-fields": "^10.0.0-rc.
|
|
10
|
+
"@praxisui/ai": "^10.0.0-rc.61",
|
|
11
|
+
"@praxisui/core": "^10.0.0-rc.61",
|
|
12
|
+
"@praxisui/dynamic-fields": "^10.0.0-rc.61",
|
|
13
13
|
"rxjs": "~7.8.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
@@ -3,12 +3,36 @@ 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, 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';
|
|
10
10
|
|
|
11
|
-
interface
|
|
11
|
+
interface SettingsPanelContextTarget {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
interface SettingsPanelContextMode {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
icon?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Optional logical group identifier. Modes sharing the same `editorGroup`
|
|
22
|
+
* operate on the same active editor instance (in-place tab/section switch)
|
|
23
|
+
* without triggering an intermediate `onApply()` before switching.
|
|
24
|
+
*/
|
|
25
|
+
editorGroup?: string;
|
|
26
|
+
}
|
|
27
|
+
interface SettingsPanelContextNavigation {
|
|
28
|
+
targets?: ReadonlyArray<SettingsPanelContextTarget>;
|
|
29
|
+
activeTargetId?: string;
|
|
30
|
+
onSelectTarget?: (targetId: string) => void;
|
|
31
|
+
modes?: ReadonlyArray<SettingsPanelContextMode>;
|
|
32
|
+
activeModeId?: string;
|
|
33
|
+
onSelectMode?: (modeId: string) => void;
|
|
34
|
+
}
|
|
35
|
+
interface SettingsPanelConfig<TValue = any> {
|
|
12
36
|
/** Transient owner lifetime; never persisted or forwarded to editor inputs. */
|
|
13
37
|
owner?: DestroyRef;
|
|
14
38
|
id: string;
|
|
@@ -17,12 +41,30 @@ interface SettingsPanelConfig {
|
|
|
17
41
|
titleIcon?: string;
|
|
18
42
|
/** Ephemeral target for a read-only look at the live result; never persisted. */
|
|
19
43
|
previewTarget?: () => HTMLElement | null;
|
|
44
|
+
/** Optional contextual target/mode navigation bar rendered in the settings panel shell. */
|
|
45
|
+
contextNavigation?: SettingsPanelContextNavigation;
|
|
20
46
|
/** Optional initial expanded state */
|
|
21
47
|
expanded?: boolean;
|
|
22
48
|
resizable?: boolean;
|
|
23
49
|
persistSizeKey?: string;
|
|
24
50
|
minWidth?: string;
|
|
25
51
|
maxWidth?: string;
|
|
52
|
+
/** Optional storage key allowing personal overrides to be reset to tenant baseline. */
|
|
53
|
+
configStorageKey?: string;
|
|
54
|
+
/** Controls visibility of the write-scope indicator/toggle when ApiConfigStorage is active. */
|
|
55
|
+
showWriteScope?: boolean;
|
|
56
|
+
/** Allows switching between personal ('user') and shared ('tenant') configuration scopes. */
|
|
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>;
|
|
26
68
|
diagnostics?: SettingsPanelDiagnosticsConfig;
|
|
27
69
|
/** Lazy inputs run once after close mediation accepts this opening. */
|
|
28
70
|
content: {
|
|
@@ -125,16 +167,20 @@ declare class SettingsPanelRef {
|
|
|
125
167
|
private appliedSubject;
|
|
126
168
|
private savedSubject;
|
|
127
169
|
private resetSubject;
|
|
170
|
+
private tenantBaselineRestoredSubject;
|
|
128
171
|
private closedSubject;
|
|
129
172
|
private sizeChangedSubject;
|
|
173
|
+
private persistenceErrorSubject;
|
|
130
174
|
private sizePersistor?;
|
|
131
175
|
applied$: rxjs.Observable<any>;
|
|
132
176
|
saved$: rxjs.Observable<any>;
|
|
133
177
|
reset$: rxjs.Observable<void>;
|
|
178
|
+
tenantBaselineRestored$: rxjs.Observable<unknown>;
|
|
134
179
|
closed$: rxjs.Observable<SettingsPanelCloseReason>;
|
|
135
180
|
sizeChanged$: rxjs.Observable<{
|
|
136
181
|
width: string;
|
|
137
182
|
}>;
|
|
183
|
+
persistenceError$: rxjs.Observable<ConfigStorageSaveError>;
|
|
138
184
|
constructor(overlayRef: OverlayRef);
|
|
139
185
|
apply(value: any): void;
|
|
140
186
|
/**
|
|
@@ -145,6 +191,8 @@ declare class SettingsPanelRef {
|
|
|
145
191
|
*/
|
|
146
192
|
save(value: any): void;
|
|
147
193
|
reset(): void;
|
|
194
|
+
notifyTenantBaselineRestored(baseline: unknown): void;
|
|
195
|
+
reportPersistenceError(error: ConfigStorageSaveError): void;
|
|
148
196
|
bindSizePersistor(fn: (width: string) => void): void;
|
|
149
197
|
updateSize(width: string | number, options?: {
|
|
150
198
|
persist?: boolean;
|
|
@@ -158,21 +206,27 @@ declare class DeferredSettingsPanelRef {
|
|
|
158
206
|
private readonly appliedSubject;
|
|
159
207
|
private readonly savedSubject;
|
|
160
208
|
private readonly resetSubject;
|
|
209
|
+
private readonly tenantBaselineRestoredSubject;
|
|
161
210
|
private readonly closedSubject;
|
|
162
211
|
private readonly sizeChangedSubject;
|
|
212
|
+
private readonly persistenceErrorSubject;
|
|
163
213
|
private target?;
|
|
164
214
|
private completed;
|
|
165
215
|
applied$: rxjs.Observable<any>;
|
|
166
216
|
saved$: rxjs.Observable<any>;
|
|
167
217
|
reset$: rxjs.Observable<void>;
|
|
218
|
+
tenantBaselineRestored$: rxjs.Observable<unknown>;
|
|
168
219
|
closed$: rxjs.Observable<SettingsPanelCloseReason>;
|
|
169
220
|
sizeChanged$: rxjs.Observable<{
|
|
170
221
|
width: string;
|
|
171
222
|
}>;
|
|
223
|
+
persistenceError$: rxjs.Observable<ConfigStorageSaveError>;
|
|
172
224
|
resolve(target: SettingsPanelRef): void;
|
|
173
225
|
apply(value: any): void;
|
|
174
226
|
save(value: any): void;
|
|
175
227
|
reset(): void;
|
|
228
|
+
notifyTenantBaselineRestored(baseline: unknown): void;
|
|
229
|
+
reportPersistenceError(error: ConfigStorageSaveError): void;
|
|
176
230
|
bindSizePersistor(_fn: (width: string) => void): void;
|
|
177
231
|
setPreviewing(previewing: boolean): void;
|
|
178
232
|
updateSize(width: string | number, options?: {
|
|
@@ -449,6 +503,12 @@ declare class SettingsPanelComponent {
|
|
|
449
503
|
expanded: boolean;
|
|
450
504
|
interactionActive: boolean;
|
|
451
505
|
previewTarget?: () => HTMLElement | null;
|
|
506
|
+
contextNavigation?: SettingsPanelContextNavigation;
|
|
507
|
+
configStorageKey?: string;
|
|
508
|
+
showWriteScope: boolean;
|
|
509
|
+
canSwitchWriteScope: boolean;
|
|
510
|
+
persistSaveHandler?: (value: any) => unknown | Promise<unknown> | Observable<unknown>;
|
|
511
|
+
persistResetHandler?: () => unknown | Promise<unknown> | Observable<unknown>;
|
|
452
512
|
previewing: boolean;
|
|
453
513
|
private previewElement;
|
|
454
514
|
private previewScroll;
|
|
@@ -463,7 +523,8 @@ declare class SettingsPanelComponent {
|
|
|
463
523
|
titleId: string;
|
|
464
524
|
private readonly dirtyState;
|
|
465
525
|
private readonly validState;
|
|
466
|
-
private readonly
|
|
526
|
+
private readonly providerBusyState;
|
|
527
|
+
private readonly persistenceBusyState;
|
|
467
528
|
get isDirty(): boolean;
|
|
468
529
|
set isDirty(value: boolean);
|
|
469
530
|
get isValid(): boolean;
|
|
@@ -473,17 +534,36 @@ declare class SettingsPanelComponent {
|
|
|
473
534
|
diagnostics: Required<SettingsPanelDiagnosticsConfig>;
|
|
474
535
|
private lastSavedAt;
|
|
475
536
|
private hasAppliedChanges;
|
|
537
|
+
private saveFailedPendingRetry;
|
|
538
|
+
private confirmDialogOpen;
|
|
539
|
+
private saveErrorStreamBound;
|
|
540
|
+
get isConfirmDialogOpen(): boolean;
|
|
476
541
|
private activePointerId;
|
|
477
542
|
private dragStartX;
|
|
478
543
|
private dragStartWidth;
|
|
479
544
|
private collapsedWidthBeforeExpand;
|
|
480
545
|
private readonly destroyRef;
|
|
546
|
+
private readonly injector;
|
|
481
547
|
private readonly i18n;
|
|
548
|
+
private readonly contextSwitchGuard;
|
|
549
|
+
private readonly directApiStorage;
|
|
550
|
+
private readonly asyncConfigStorage;
|
|
551
|
+
private readonly scopeErrorStorage;
|
|
552
|
+
readonly storageSaveError: i0.WritableSignal<ConfigStorageSaveError | null>;
|
|
482
553
|
readonly applyActionLabel: string;
|
|
483
554
|
readonly saveActionLabel: string;
|
|
484
555
|
private contentHost;
|
|
556
|
+
private saveErrorBanner?;
|
|
485
557
|
constructor(cdr: ChangeDetectorRef, dialog: MatDialog, elementRef: ElementRef<HTMLElement>, overlayContainer: OverlayContainer);
|
|
486
558
|
get canInspectPreview(): boolean;
|
|
559
|
+
get hasContextNavigation(): boolean;
|
|
560
|
+
get activeTargetIndex(): number;
|
|
561
|
+
get canSelectPreviousTarget(): boolean;
|
|
562
|
+
get canSelectNextTarget(): boolean;
|
|
563
|
+
selectPreviousTarget(): void;
|
|
564
|
+
selectNextTarget(): void;
|
|
565
|
+
selectContextTarget(targetId: string, selectElement?: HTMLSelectElement | null): void;
|
|
566
|
+
selectContextMode(modeId: string): void;
|
|
487
567
|
showPreview(): void;
|
|
488
568
|
returnFromPreview(): void;
|
|
489
569
|
private restorePreviewPage;
|
|
@@ -499,14 +579,38 @@ declare class SettingsPanelComponent {
|
|
|
499
579
|
get showBusyIndicator(): boolean;
|
|
500
580
|
get statusTone(): 'busy' | 'dirty' | 'invalid' | 'applied' | 'saved' | 'idle';
|
|
501
581
|
get statusMessage(): string;
|
|
582
|
+
get activeWriteScope(): ConfigStorageScope | null;
|
|
583
|
+
get showWriteScopeControls(): boolean;
|
|
584
|
+
get canToggleWriteScope(): boolean;
|
|
585
|
+
private resolveTenantResetStorage;
|
|
586
|
+
get canResetPersonalOverride(): boolean;
|
|
587
|
+
get writeScopeLabel(): string;
|
|
588
|
+
get writeScopeToggleLabel(): string;
|
|
589
|
+
get formattedSaveErrorMessage(): string;
|
|
590
|
+
get saveErrorFieldMessages(): string[];
|
|
591
|
+
get canSwitchToPersonalScopeFromError(): boolean;
|
|
592
|
+
toggleWriteScope(): void;
|
|
593
|
+
switchToPersonalScopeFromError(): void;
|
|
594
|
+
dismissSaveError(): void;
|
|
595
|
+
resetPersonalOverrideToTenant(): void;
|
|
596
|
+
private matchesPanelStorageKey;
|
|
597
|
+
private resolveScopeErrorStorage;
|
|
598
|
+
private checkWriteGate;
|
|
599
|
+
private isPrebuiltSaveError;
|
|
600
|
+
private handlePersistenceFailure;
|
|
502
601
|
tx(text: string, params?: Record<string, string | number | boolean | null | undefined>): string;
|
|
503
602
|
actionLabel(text: string): string;
|
|
504
603
|
attachContent(component: Type<any>, injector: Injector, ref: SettingsPanelRef, inputs?: Record<string, unknown>): void;
|
|
505
604
|
private applyInputs;
|
|
506
605
|
private resolveSupportedInputs;
|
|
507
606
|
onReset(): void;
|
|
607
|
+
private finalizeReset;
|
|
608
|
+
private runAsyncResetFlow;
|
|
508
609
|
onApply(): void;
|
|
509
610
|
onSave(): void;
|
|
611
|
+
private runAsyncSaveFlow;
|
|
612
|
+
private awaitResult;
|
|
613
|
+
private canProceedWithSave;
|
|
510
614
|
private emitSave;
|
|
511
615
|
private formatClock;
|
|
512
616
|
initializeLayout(state: SettingsPanelLayoutState): void;
|
|
@@ -616,8 +720,9 @@ interface GlobalConfigEditorState {
|
|
|
616
720
|
crud: NonNullable<GlobalConfig['crud']>;
|
|
617
721
|
dynamicFields: NonNullable<GlobalConfig['dynamicFields']>;
|
|
618
722
|
table: NonNullable<GlobalConfig['table']>;
|
|
723
|
+
pages?: NonNullable<GlobalConfig['pages']>;
|
|
619
724
|
}
|
|
620
|
-
type GlobalConfigEditorGroup = 'CRUD' | 'Dynamic Fields' | 'Table';
|
|
725
|
+
type GlobalConfigEditorGroup = 'CRUD' | 'Dynamic Fields' | 'Table' | 'Dynamic Pages';
|
|
621
726
|
interface GlobalConfigEditorOption<T = any> {
|
|
622
727
|
label: string;
|
|
623
728
|
value: T;
|
|
@@ -661,6 +766,7 @@ declare class GlobalConfigEditorComponent implements OnInit, AfterViewInit {
|
|
|
661
766
|
hostCache: ViewContainerRef;
|
|
662
767
|
hostTable: ViewContainerRef;
|
|
663
768
|
hostDialog: ViewContainerRef;
|
|
769
|
+
hostPages: ViewContainerRef;
|
|
664
770
|
hostAiCredentials: ViewContainerRef;
|
|
665
771
|
hostAiModel: ViewContainerRef;
|
|
666
772
|
hostAiEmbedding: ViewContainerRef;
|
|
@@ -672,6 +778,7 @@ declare class GlobalConfigEditorComponent implements OnInit, AfterViewInit {
|
|
|
672
778
|
private readonly logger;
|
|
673
779
|
private readonly logContext;
|
|
674
780
|
private readonly providedDynamicFormCtor;
|
|
781
|
+
private readonly componentMetadata;
|
|
675
782
|
private dynamicFormCtor;
|
|
676
783
|
private loggedMissingDynamicForm;
|
|
677
784
|
private dialogFormInst;
|
|
@@ -752,6 +859,7 @@ declare class GlobalConfigEditorComponent implements OnInit, AfterViewInit {
|
|
|
752
859
|
private resolveSaveErrorMessage;
|
|
753
860
|
private normalizeFieldValue;
|
|
754
861
|
private validateCompactTableAppearancePayload;
|
|
862
|
+
private validatePagesDefaultsPayload;
|
|
755
863
|
getVariantIcon(key: string): string | undefined;
|
|
756
864
|
pickVariantIcon(key: string): Promise<void>;
|
|
757
865
|
clearVariantIcon(key: string): void;
|
|
@@ -777,6 +885,7 @@ type OpenGlobalConfigOptions = {
|
|
|
777
885
|
id?: string;
|
|
778
886
|
title?: string;
|
|
779
887
|
titleIcon?: string;
|
|
888
|
+
owner?: DestroyRef;
|
|
780
889
|
tx?: (text: string, params?: Record<string, string | number | boolean | null | undefined>) => string;
|
|
781
890
|
};
|
|
782
891
|
/**
|
|
@@ -784,7 +893,7 @@ type OpenGlobalConfigOptions = {
|
|
|
784
893
|
* Usage:
|
|
785
894
|
* openGlobalConfigEditor(settings);
|
|
786
895
|
*/
|
|
787
|
-
declare function openGlobalConfigEditor(settings: SettingsPanelService, opts?: OpenGlobalConfigOptions):
|
|
896
|
+
declare function openGlobalConfigEditor(settings: SettingsPanelService, opts?: OpenGlobalConfigOptions): SettingsPanelRef;
|
|
788
897
|
|
|
789
898
|
/**
|
|
790
899
|
* Capabilities catalog for SettingsPanelConfig.
|
|
@@ -813,4 +922,4 @@ declare const PRAXIS_SETTINGS_PANEL_COMPONENT_METADATA: ComponentDocMeta;
|
|
|
813
922
|
declare function providePraxisSettingsPanelMetadata(): Provider;
|
|
814
923
|
|
|
815
924
|
export { BASE_SIDE_PANEL_DATA, BASE_SIDE_PANEL_REF, BaseSidePanelComponent, BaseSidePanelOverlayRef, BaseSidePanelService, DeferredSettingsPanelRef, GLOBAL_CONFIG_DYNAMIC_FORM_COMPONENT, GlobalConfigAdminService, GlobalConfigEditorComponent, PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST, PRAXIS_SETTINGS_PANEL_COMPONENT_METADATA, SETTINGS_PANEL_AI_CAPABILITIES, SETTINGS_PANEL_DATA, SETTINGS_PANEL_REF, SIDE_PANEL_THEME_CSS_VARS, SettingsPanelComponent, SettingsPanelRef, SettingsPanelService, SurfaceDrawerComponent, buildGlobalConfigFormConfig, openGlobalConfigEditor, providePraxisSettingsPanelBridge, providePraxisSettingsPanelMetadata, providePraxisSurfaceDrawerBridge };
|
|
816
|
-
export type { BaseSidePanelCloseReason, BaseSidePanelContent, BaseSidePanelOpenOptions, BaseSidePanelRef, BaseSidePanelResizeAxis, BaseSidePanelResult, Capability, CapabilityCatalog, CapabilityCategory, GlobalConfigEditorFieldSpec, GlobalConfigEditorGroup, GlobalConfigEditorOption, GlobalConfigEditorState, OpenGlobalConfigOptions, SettingsPanelAction, SettingsPanelCloseReason, SettingsPanelConfig, SettingsPanelDiagnosticsConfig, SettingsValueProvider, SidePanelCssVarName, SidePanelMotionContract, SidePanelThemeContract, SidePanelWidthPreset, ValueKind };
|
|
925
|
+
export type { BaseSidePanelCloseReason, BaseSidePanelContent, BaseSidePanelOpenOptions, BaseSidePanelRef, BaseSidePanelResizeAxis, BaseSidePanelResult, Capability, CapabilityCatalog, CapabilityCategory, GlobalConfigEditorFieldSpec, GlobalConfigEditorGroup, GlobalConfigEditorOption, GlobalConfigEditorState, OpenGlobalConfigOptions, SettingsPanelAction, SettingsPanelCloseReason, SettingsPanelConfig, SettingsPanelContextMode, SettingsPanelContextNavigation, SettingsPanelContextTarget, SettingsPanelDiagnosticsConfig, SettingsValueProvider, SidePanelCssVarName, SidePanelMotionContract, SidePanelThemeContract, SidePanelWidthPreset, ValueKind };
|