@praxisui/settings-panel 1.0.0-beta.8 → 3.0.0-beta.0
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 +78 -1
- package/fesm2022/praxisui-settings-panel.mjs +1684 -196
- package/fesm2022/praxisui-settings-panel.mjs.map +1 -1
- package/index.d.ts +126 -9
- package/package.json +7 -6
package/index.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Type, Injector, ComponentRef, ChangeDetectorRef, InjectionToken, OnInit, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { Type, Injector, ComponentRef, ChangeDetectorRef, InjectionToken, OnInit, AfterViewInit, ViewContainerRef } from '@angular/core';
|
|
3
3
|
import { OverlayRef, Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import * as rxjs from 'rxjs';
|
|
5
5
|
import { Observable, BehaviorSubject } from 'rxjs';
|
|
6
6
|
import { MatDialog } from '@angular/material/dialog';
|
|
7
|
-
import { GlobalConfig, FormConfig, FormValueChangeEvent } from '@praxisui/core';
|
|
7
|
+
import { GlobalConfig, FormConfig, FormValueChangeEvent, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
|
|
8
8
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
9
|
+
import { AiProviderCatalogItem } from '@praxisui/ai';
|
|
9
10
|
|
|
10
11
|
interface SettingsPanelConfig {
|
|
11
12
|
id: string;
|
|
12
13
|
title: string;
|
|
13
14
|
/** Optional Material icon name to display in header before the title */
|
|
14
15
|
titleIcon?: string;
|
|
16
|
+
/** Optional initial expanded state */
|
|
17
|
+
expanded?: boolean;
|
|
15
18
|
content: {
|
|
16
19
|
component: Type<any>;
|
|
17
20
|
inputs?: Record<string, any>;
|
|
@@ -152,9 +155,12 @@ declare class SettingsPanelComponent {
|
|
|
152
155
|
isDirty: boolean;
|
|
153
156
|
isValid: boolean;
|
|
154
157
|
isBusy: boolean;
|
|
158
|
+
private lastSavedAt;
|
|
155
159
|
get canApply(): boolean;
|
|
156
160
|
get canSave(): boolean;
|
|
157
161
|
get disabledReason(): string;
|
|
162
|
+
get statusTone(): 'busy' | 'dirty' | 'saved' | 'idle';
|
|
163
|
+
get statusMessage(): string;
|
|
158
164
|
private readonly destroyRef;
|
|
159
165
|
private contentHost;
|
|
160
166
|
constructor(cdr: ChangeDetectorRef, dialog: MatDialog);
|
|
@@ -162,6 +168,8 @@ declare class SettingsPanelComponent {
|
|
|
162
168
|
onReset(): void;
|
|
163
169
|
onApply(): void;
|
|
164
170
|
onSave(): void;
|
|
171
|
+
private emitSave;
|
|
172
|
+
private formatClock;
|
|
165
173
|
toggleExpand(): void;
|
|
166
174
|
onCancel(): void;
|
|
167
175
|
handleKeydown(event: KeyboardEvent): void;
|
|
@@ -181,7 +189,11 @@ declare class GlobalConfigAdminService {
|
|
|
181
189
|
/** Returns the effective merged configuration (providers + storage). */
|
|
182
190
|
getEffectiveConfig(): GlobalConfig;
|
|
183
191
|
/** Persist a partial update and notify listeners. */
|
|
184
|
-
save(partial: Partial<GlobalConfig>): void
|
|
192
|
+
save(partial: Partial<GlobalConfig>): Promise<void>;
|
|
193
|
+
/** True when a tenant/global config exists in storage (overrides env defaults). */
|
|
194
|
+
hasStoredConfig(): Promise<boolean>;
|
|
195
|
+
/** Clear stored config for the active tenant and refresh the cache. */
|
|
196
|
+
clearStoredConfig(): Promise<void>;
|
|
185
197
|
static ɵfac: i0.ɵɵFactoryDeclaration<GlobalConfigAdminService, never>;
|
|
186
198
|
static ɵprov: i0.ɵɵInjectableDeclaration<GlobalConfigAdminService>;
|
|
187
199
|
}
|
|
@@ -218,7 +230,7 @@ interface GlobalConfigEditorFieldSpec {
|
|
|
218
230
|
*/
|
|
219
231
|
declare function buildGlobalConfigFormConfig(): FormConfig;
|
|
220
232
|
|
|
221
|
-
declare class GlobalConfigEditorComponent implements OnInit {
|
|
233
|
+
declare class GlobalConfigEditorComponent implements OnInit, AfterViewInit {
|
|
222
234
|
private admin;
|
|
223
235
|
private snack;
|
|
224
236
|
formConfig: FormConfig;
|
|
@@ -232,20 +244,98 @@ declare class GlobalConfigEditorComponent implements OnInit {
|
|
|
232
244
|
readonly isBusy$: BehaviorSubject<boolean>;
|
|
233
245
|
hostCrud: ViewContainerRef;
|
|
234
246
|
hostFields: ViewContainerRef;
|
|
247
|
+
hostCache: ViewContainerRef;
|
|
235
248
|
hostTable: ViewContainerRef;
|
|
236
249
|
hostDialog: ViewContainerRef;
|
|
250
|
+
hostAiCredentials: ViewContainerRef;
|
|
251
|
+
hostAiModel: ViewContainerRef;
|
|
252
|
+
hostAiEmbedding: ViewContainerRef;
|
|
237
253
|
private readonly destroyRef;
|
|
238
254
|
private readonly iconPicker;
|
|
255
|
+
private readonly aiApi;
|
|
256
|
+
private readonly cdr;
|
|
257
|
+
private readonly logger;
|
|
258
|
+
private readonly logContext;
|
|
259
|
+
private readonly providedDynamicFormCtor;
|
|
260
|
+
private dynamicFormCtor;
|
|
261
|
+
private loggedMissingDynamicForm;
|
|
239
262
|
private dialogFormInst;
|
|
263
|
+
private aiModelFormRef;
|
|
264
|
+
private aiEmbeddingFormRef;
|
|
265
|
+
private pendingModelOptions;
|
|
266
|
+
private readonly embeddingModelOptions;
|
|
267
|
+
private componentRefs;
|
|
240
268
|
readonly dialogVariantKeys: readonly ["danger", "info", "success", "question", "error"];
|
|
269
|
+
isTestingAi: boolean;
|
|
270
|
+
isRefetchingModels: boolean;
|
|
271
|
+
isClearingGlobalConfig: boolean;
|
|
272
|
+
aiTestResult: {
|
|
273
|
+
success: boolean;
|
|
274
|
+
message: string;
|
|
275
|
+
} | null;
|
|
276
|
+
private availableModels;
|
|
277
|
+
providers: AiProviderCatalogItem[];
|
|
278
|
+
selectedProvider: AiProviderCatalogItem | null;
|
|
279
|
+
apiKeyLast4: string | null;
|
|
280
|
+
hasStoredApiKey: boolean;
|
|
281
|
+
hasStoredGlobalConfig: boolean;
|
|
282
|
+
configSourceLabel: string;
|
|
283
|
+
private apiKeyChanged$;
|
|
284
|
+
hasApiKey: boolean;
|
|
285
|
+
selectedModelDetails: string;
|
|
286
|
+
get hasCurrentApiKey(): boolean;
|
|
287
|
+
get apiKeyStatusLabel(): string;
|
|
241
288
|
constructor(admin: GlobalConfigAdminService, snack: MatSnackBar);
|
|
242
|
-
ngOnInit(): void
|
|
289
|
+
ngOnInit(): Promise<void>;
|
|
290
|
+
ngAfterViewInit(): void;
|
|
243
291
|
onValueChange(sectionId: string, ev: FormValueChangeEvent): void;
|
|
244
|
-
private
|
|
292
|
+
private buildSectionConfig;
|
|
293
|
+
private bootstrapDynamicForms;
|
|
294
|
+
private ensureAiModelForm;
|
|
295
|
+
private loadProviderCatalog;
|
|
296
|
+
private buildFallbackProviders;
|
|
297
|
+
private applyProviderOptions;
|
|
298
|
+
private applyEmbeddingProviderOptions;
|
|
299
|
+
private setProviderFieldOptions;
|
|
300
|
+
private setEmbeddingProviderFieldOptions;
|
|
301
|
+
private resolveDefaultProvider;
|
|
302
|
+
private setFieldDefaultValue;
|
|
303
|
+
private updateSelectedProvider;
|
|
304
|
+
private updateApiKeyState;
|
|
305
|
+
get embeddingUseSameAsLlm(): boolean;
|
|
306
|
+
get embeddingDimensionMismatch(): boolean;
|
|
307
|
+
get canUseLlmForEmbeddings(): boolean;
|
|
308
|
+
private canAutoRefreshModels;
|
|
309
|
+
private ensureDefaultModelSelection;
|
|
310
|
+
private clearModelSelection;
|
|
311
|
+
private findProvider;
|
|
312
|
+
private setModelFieldOptions;
|
|
313
|
+
private applyConfigSnapshot;
|
|
314
|
+
private patchFormsWithValues;
|
|
315
|
+
private refreshAiStateAfterConfig;
|
|
316
|
+
private refreshStoredConfigState;
|
|
317
|
+
clearStoredConfig(): Promise<void>;
|
|
318
|
+
private syncEmbeddingDefaults;
|
|
319
|
+
private ensureEmbeddingModelDefaults;
|
|
320
|
+
private ensureEmbeddingDimensionsDefaults;
|
|
321
|
+
useLlmForEmbeddings(): void;
|
|
322
|
+
private createAiModelForm;
|
|
323
|
+
private setEmbeddingValue;
|
|
324
|
+
private recreateAiModelForm;
|
|
325
|
+
private updateModelDetails;
|
|
245
326
|
reset(): void;
|
|
246
327
|
getSettingsValue(): any;
|
|
247
|
-
onSave(): any
|
|
328
|
+
onSave(): Promise<any>;
|
|
329
|
+
refreshModels(force?: boolean, silent?: boolean): Promise<void>;
|
|
330
|
+
private applyModelOptions;
|
|
331
|
+
testAiConnection(): Promise<void>;
|
|
332
|
+
private buildLogOptions;
|
|
248
333
|
private safeName;
|
|
334
|
+
private buildChangedValues;
|
|
335
|
+
private shouldIncludeField;
|
|
336
|
+
private resolveSaveErrorMessage;
|
|
337
|
+
private normalizeFieldValue;
|
|
338
|
+
private validateCompactTableAppearancePayload;
|
|
249
339
|
getVariantIcon(key: string): string | undefined;
|
|
250
340
|
pickVariantIcon(key: string): Promise<void>;
|
|
251
341
|
clearVariantIcon(key: string): void;
|
|
@@ -259,6 +349,14 @@ declare class GlobalConfigEditorComponent implements OnInit {
|
|
|
259
349
|
static ɵcmp: i0.ɵɵComponentDeclaration<GlobalConfigEditorComponent, "praxis-global-config-editor", never, {}, {}, never, never, true, never>;
|
|
260
350
|
}
|
|
261
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Optional token used by GlobalConfigEditorComponent to render forms.
|
|
354
|
+
* Provide the PraxisDynamicForm component (or a compatible dynamic form)
|
|
355
|
+
* to avoid creating a hard dependency from @praxisui/settings-panel to
|
|
356
|
+
* @praxisui/dynamic-form.
|
|
357
|
+
*/
|
|
358
|
+
declare const GLOBAL_CONFIG_DYNAMIC_FORM_COMPONENT: InjectionToken<Type<any> | null>;
|
|
359
|
+
|
|
262
360
|
type OpenGlobalConfigOptions = {
|
|
263
361
|
id?: string;
|
|
264
362
|
title?: string;
|
|
@@ -271,5 +369,24 @@ type OpenGlobalConfigOptions = {
|
|
|
271
369
|
*/
|
|
272
370
|
declare function openGlobalConfigEditor(settings: SettingsPanelService, opts?: OpenGlobalConfigOptions): void;
|
|
273
371
|
|
|
274
|
-
|
|
275
|
-
|
|
372
|
+
/**
|
|
373
|
+
* Capabilities catalog for SettingsPanelConfig.
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
declare module '@praxisui/core' {
|
|
377
|
+
interface AiCapabilityCategoryMap {
|
|
378
|
+
content: true;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
type CapabilityCategory = AiCapabilityCategory;
|
|
382
|
+
type ValueKind = AiValueKind;
|
|
383
|
+
interface Capability extends AiCapability {
|
|
384
|
+
category: CapabilityCategory;
|
|
385
|
+
}
|
|
386
|
+
interface CapabilityCatalog extends AiCapabilityCatalog {
|
|
387
|
+
capabilities: Capability[];
|
|
388
|
+
}
|
|
389
|
+
declare const SETTINGS_PANEL_AI_CAPABILITIES: CapabilityCatalog;
|
|
390
|
+
|
|
391
|
+
export { GLOBAL_CONFIG_DYNAMIC_FORM_COMPONENT, GlobalConfigAdminService, GlobalConfigEditorComponent, SETTINGS_PANEL_AI_CAPABILITIES, SETTINGS_PANEL_DATA, SETTINGS_PANEL_REF, SettingsPanelComponent, SettingsPanelRef, SettingsPanelService, buildGlobalConfigFormConfig, openGlobalConfigEditor };
|
|
392
|
+
export type { Capability, CapabilityCatalog, CapabilityCategory, GlobalConfigEditorFieldSpec, GlobalConfigEditorGroup, GlobalConfigEditorOption, GlobalConfigEditorState, OpenGlobalConfigOptions, SettingsPanelAction, SettingsPanelCloseReason, SettingsPanelConfig, SettingsValueProvider, ValueKind };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/settings-panel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
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": "^20.0.0",
|
|
7
7
|
"@angular/core": "^20.0.0",
|
|
8
8
|
"@angular/cdk": "^20.0.0",
|
|
9
9
|
"@angular/material": "^20.0.0",
|
|
10
|
-
"@praxisui/dynamic-fields": "^
|
|
10
|
+
"@praxisui/dynamic-fields": "^3.0.0-beta.0"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"tslib": "^2.3.0"
|
|
@@ -18,18 +18,19 @@
|
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/codexrodrigues/praxis"
|
|
21
|
+
"url": "https://github.com/codexrodrigues/praxis-ui-angular"
|
|
22
22
|
},
|
|
23
|
-
"homepage": "https://
|
|
23
|
+
"homepage": "https://praxisui.dev",
|
|
24
24
|
"bugs": {
|
|
25
|
-
"url": "https://github.com/codexrodrigues/praxis/issues"
|
|
25
|
+
"url": "https://github.com/codexrodrigues/praxis-ui-angular/issues"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"angular",
|
|
29
29
|
"praxisui",
|
|
30
30
|
"settings",
|
|
31
31
|
"panel",
|
|
32
|
-
"
|
|
32
|
+
"drawer",
|
|
33
|
+
"runtime-config"
|
|
33
34
|
],
|
|
34
35
|
"sideEffects": false,
|
|
35
36
|
"module": "fesm2022/praxisui-settings-panel.mjs",
|