@praxisui/settings-panel 10.0.0-rc.5 → 10.0.0-rc.50
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 +3 -0
- package/ai/component-registry.json +136 -8
- package/fesm2022/praxisui-settings-panel.mjs +588 -70
- package/package.json +4 -4
- package/types/praxisui-settings-panel.d.ts +68 -4
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.50",
|
|
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.50",
|
|
11
|
+
"@praxisui/core": "^10.0.0-rc.50",
|
|
12
|
+
"@praxisui/dynamic-fields": "^10.0.0-rc.50",
|
|
13
13
|
"rxjs": "~7.8.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
@@ -3,11 +3,35 @@ 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 { SurfaceOutcome, PraxisI18nService, SurfaceDrawerNavigationFrame, SurfaceDrawerNavigationGuard, ConfigStorageSaveError, 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 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
|
+
}
|
|
11
35
|
interface SettingsPanelConfig {
|
|
12
36
|
/** Transient owner lifetime; never persisted or forwarded to editor inputs. */
|
|
13
37
|
owner?: DestroyRef;
|
|
@@ -17,12 +41,20 @@ 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;
|
|
26
58
|
diagnostics?: SettingsPanelDiagnosticsConfig;
|
|
27
59
|
/** Lazy inputs run once after close mediation accepts this opening. */
|
|
28
60
|
content: {
|
|
@@ -449,6 +481,10 @@ declare class SettingsPanelComponent {
|
|
|
449
481
|
expanded: boolean;
|
|
450
482
|
interactionActive: boolean;
|
|
451
483
|
previewTarget?: () => HTMLElement | null;
|
|
484
|
+
contextNavigation?: SettingsPanelContextNavigation;
|
|
485
|
+
configStorageKey?: string;
|
|
486
|
+
showWriteScope: boolean;
|
|
487
|
+
canSwitchWriteScope: boolean;
|
|
452
488
|
previewing: boolean;
|
|
453
489
|
private previewElement;
|
|
454
490
|
private previewScroll;
|
|
@@ -479,11 +515,23 @@ declare class SettingsPanelComponent {
|
|
|
479
515
|
private collapsedWidthBeforeExpand;
|
|
480
516
|
private readonly destroyRef;
|
|
481
517
|
private readonly i18n;
|
|
518
|
+
private readonly directApiStorage;
|
|
519
|
+
private readonly asyncConfigStorage;
|
|
520
|
+
private readonly scopeErrorStorage;
|
|
521
|
+
readonly storageSaveError: i0.WritableSignal<ConfigStorageSaveError | null>;
|
|
482
522
|
readonly applyActionLabel: string;
|
|
483
523
|
readonly saveActionLabel: string;
|
|
484
524
|
private contentHost;
|
|
485
525
|
constructor(cdr: ChangeDetectorRef, dialog: MatDialog, elementRef: ElementRef<HTMLElement>, overlayContainer: OverlayContainer);
|
|
486
526
|
get canInspectPreview(): boolean;
|
|
527
|
+
get hasContextNavigation(): boolean;
|
|
528
|
+
get activeTargetIndex(): number;
|
|
529
|
+
get canSelectPreviousTarget(): boolean;
|
|
530
|
+
get canSelectNextTarget(): boolean;
|
|
531
|
+
selectPreviousTarget(): void;
|
|
532
|
+
selectNextTarget(): void;
|
|
533
|
+
selectContextTarget(targetId: string, selectElement?: HTMLSelectElement | null): void;
|
|
534
|
+
selectContextMode(modeId: string): void;
|
|
487
535
|
showPreview(): void;
|
|
488
536
|
returnFromPreview(): void;
|
|
489
537
|
private restorePreviewPage;
|
|
@@ -499,6 +547,17 @@ declare class SettingsPanelComponent {
|
|
|
499
547
|
get showBusyIndicator(): boolean;
|
|
500
548
|
get statusTone(): 'busy' | 'dirty' | 'invalid' | 'applied' | 'saved' | 'idle';
|
|
501
549
|
get statusMessage(): string;
|
|
550
|
+
get activeWriteScope(): ConfigStorageScope | null;
|
|
551
|
+
get showWriteScopeControls(): boolean;
|
|
552
|
+
get canToggleWriteScope(): boolean;
|
|
553
|
+
get canResetPersonalOverride(): boolean;
|
|
554
|
+
get writeScopeLabel(): string;
|
|
555
|
+
get writeScopeToggleLabel(): string;
|
|
556
|
+
get formattedSaveErrorMessage(): string;
|
|
557
|
+
toggleWriteScope(): void;
|
|
558
|
+
switchToPersonalScopeFromError(): void;
|
|
559
|
+
dismissSaveError(): void;
|
|
560
|
+
resetPersonalOverrideToTenant(): void;
|
|
502
561
|
tx(text: string, params?: Record<string, string | number | boolean | null | undefined>): string;
|
|
503
562
|
actionLabel(text: string): string;
|
|
504
563
|
attachContent(component: Type<any>, injector: Injector, ref: SettingsPanelRef, inputs?: Record<string, unknown>): void;
|
|
@@ -616,8 +675,9 @@ interface GlobalConfigEditorState {
|
|
|
616
675
|
crud: NonNullable<GlobalConfig['crud']>;
|
|
617
676
|
dynamicFields: NonNullable<GlobalConfig['dynamicFields']>;
|
|
618
677
|
table: NonNullable<GlobalConfig['table']>;
|
|
678
|
+
pages?: NonNullable<GlobalConfig['pages']>;
|
|
619
679
|
}
|
|
620
|
-
type GlobalConfigEditorGroup = 'CRUD' | 'Dynamic Fields' | 'Table';
|
|
680
|
+
type GlobalConfigEditorGroup = 'CRUD' | 'Dynamic Fields' | 'Table' | 'Dynamic Pages';
|
|
621
681
|
interface GlobalConfigEditorOption<T = any> {
|
|
622
682
|
label: string;
|
|
623
683
|
value: T;
|
|
@@ -661,6 +721,7 @@ declare class GlobalConfigEditorComponent implements OnInit, AfterViewInit {
|
|
|
661
721
|
hostCache: ViewContainerRef;
|
|
662
722
|
hostTable: ViewContainerRef;
|
|
663
723
|
hostDialog: ViewContainerRef;
|
|
724
|
+
hostPages: ViewContainerRef;
|
|
664
725
|
hostAiCredentials: ViewContainerRef;
|
|
665
726
|
hostAiModel: ViewContainerRef;
|
|
666
727
|
hostAiEmbedding: ViewContainerRef;
|
|
@@ -672,6 +733,7 @@ declare class GlobalConfigEditorComponent implements OnInit, AfterViewInit {
|
|
|
672
733
|
private readonly logger;
|
|
673
734
|
private readonly logContext;
|
|
674
735
|
private readonly providedDynamicFormCtor;
|
|
736
|
+
private readonly componentMetadata;
|
|
675
737
|
private dynamicFormCtor;
|
|
676
738
|
private loggedMissingDynamicForm;
|
|
677
739
|
private dialogFormInst;
|
|
@@ -752,6 +814,7 @@ declare class GlobalConfigEditorComponent implements OnInit, AfterViewInit {
|
|
|
752
814
|
private resolveSaveErrorMessage;
|
|
753
815
|
private normalizeFieldValue;
|
|
754
816
|
private validateCompactTableAppearancePayload;
|
|
817
|
+
private validatePagesDefaultsPayload;
|
|
755
818
|
getVariantIcon(key: string): string | undefined;
|
|
756
819
|
pickVariantIcon(key: string): Promise<void>;
|
|
757
820
|
clearVariantIcon(key: string): void;
|
|
@@ -777,6 +840,7 @@ type OpenGlobalConfigOptions = {
|
|
|
777
840
|
id?: string;
|
|
778
841
|
title?: string;
|
|
779
842
|
titleIcon?: string;
|
|
843
|
+
owner?: DestroyRef;
|
|
780
844
|
tx?: (text: string, params?: Record<string, string | number | boolean | null | undefined>) => string;
|
|
781
845
|
};
|
|
782
846
|
/**
|
|
@@ -784,7 +848,7 @@ type OpenGlobalConfigOptions = {
|
|
|
784
848
|
* Usage:
|
|
785
849
|
* openGlobalConfigEditor(settings);
|
|
786
850
|
*/
|
|
787
|
-
declare function openGlobalConfigEditor(settings: SettingsPanelService, opts?: OpenGlobalConfigOptions):
|
|
851
|
+
declare function openGlobalConfigEditor(settings: SettingsPanelService, opts?: OpenGlobalConfigOptions): SettingsPanelRef;
|
|
788
852
|
|
|
789
853
|
/**
|
|
790
854
|
* Capabilities catalog for SettingsPanelConfig.
|
|
@@ -813,4 +877,4 @@ declare const PRAXIS_SETTINGS_PANEL_COMPONENT_METADATA: ComponentDocMeta;
|
|
|
813
877
|
declare function providePraxisSettingsPanelMetadata(): Provider;
|
|
814
878
|
|
|
815
879
|
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 };
|
|
880
|
+
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 };
|