ngx-dev-toolbar 2.0.1 → 2.0.2

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,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-dev-toolbar",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "keywords": [
5
5
  "devtools",
6
6
  "development-toolbar",
@@ -39,7 +39,7 @@ export declare class DevToolbarAppFeaturesToolComponent {
39
39
  onFilterChange(value: string | undefined): void;
40
40
  /**
41
41
  * Handle feature value change from 3-state dropdown.
42
- * - 'not-forced' (empty string): Remove forced override
42
+ * - 'not-forced': Remove forced override
43
43
  * - 'on': Force feature to enabled
44
44
  * - 'off': Force feature to disabled
45
45
  */
@@ -29,7 +29,6 @@ export declare class DevToolbarHomeToolComponent {
29
29
  readonly url: "https://discord.com/invite/angular";
30
30
  readonly label: "Community";
31
31
  }];
32
- onToggleTheme(): void;
33
32
  onExportSettings(): void;
34
33
  onImportSettings(): void;
35
34
  onResetSettings(): void;
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { DevToolbarPreset } from './presets.models';
2
+ import { DevToolbarPreset, PresetCategoryOptions } from './presets.models';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Internal service for managing presets state.
@@ -19,7 +19,7 @@ export declare class DevToolbarInternalPresetsService {
19
19
  /**
20
20
  * Capture current toolbar state as a new preset
21
21
  */
22
- saveCurrentAsPreset(name: string, description?: string): DevToolbarPreset;
22
+ saveCurrentAsPreset(name: string, description?: string, categoryOptions?: PresetCategoryOptions): DevToolbarPreset;
23
23
  /**
24
24
  * Apply a preset to all tools (THIS IS THE KEY METHOD)
25
25
  */
@@ -1,4 +1,5 @@
1
1
  import { DevToolbarWindowOptions } from '../../components/toolbar-tool/toolbar-tool.models';
2
+ import { DevToolbarStateService } from '../../dev-toolbar-state.service';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class DevToolbarPresetsToolComponent {
4
5
  private readonly presetsService;
@@ -6,14 +7,29 @@ export declare class DevToolbarPresetsToolComponent {
6
7
  private readonly permissionsService;
7
8
  private readonly appFeaturesService;
8
9
  private readonly languageService;
10
+ protected readonly state: DevToolbarStateService;
9
11
  protected readonly viewMode: import("@angular/core").WritableSignal<"list" | "create">;
10
12
  protected readonly searchQuery: import("@angular/core").WritableSignal<string>;
11
13
  protected readonly presetName: import("@angular/core").WritableSignal<string>;
12
14
  protected readonly presetDescription: import("@angular/core").WritableSignal<string>;
15
+ protected readonly includeFeatureFlags: import("@angular/core").WritableSignal<boolean>;
16
+ protected readonly includePermissions: import("@angular/core").WritableSignal<boolean>;
17
+ protected readonly includeAppFeatures: import("@angular/core").WritableSignal<boolean>;
18
+ protected readonly includeLanguage: import("@angular/core").WritableSignal<boolean>;
19
+ protected readonly selectedFlagIds: import("@angular/core").WritableSignal<Set<string>>;
20
+ protected readonly selectedPermissionIds: import("@angular/core").WritableSignal<Set<string>>;
21
+ protected readonly selectedFeatureIds: import("@angular/core").WritableSignal<Set<string>>;
13
22
  protected readonly presets: import("@angular/core").Signal<import("ngx-dev-toolbar").DevToolbarPreset[]>;
14
23
  protected readonly filteredPresets: import("@angular/core").Signal<import("ngx-dev-toolbar").DevToolbarPreset[]>;
15
24
  protected readonly hasNoPresets: import("@angular/core").Signal<boolean>;
16
25
  protected readonly hasNoFilteredPresets: import("@angular/core").Signal<boolean>;
26
+ protected readonly isFeatureFlagsEnabled: import("@angular/core").Signal<boolean>;
27
+ protected readonly isPermissionsEnabled: import("@angular/core").Signal<boolean>;
28
+ protected readonly isAppFeaturesEnabled: import("@angular/core").Signal<boolean>;
29
+ protected readonly isLanguageEnabled: import("@angular/core").Signal<boolean>;
30
+ protected readonly forcedFlags: import("@angular/core").Signal<import("ngx-dev-toolbar").DevToolbarFlag[]>;
31
+ protected readonly forcedPermissions: import("@angular/core").Signal<import("ngx-dev-toolbar").DevToolbarPermission[]>;
32
+ protected readonly forcedAppFeatures: import("@angular/core").Signal<import("ngx-dev-toolbar").DevToolbarAppFeature[]>;
17
33
  protected readonly options: DevToolbarWindowOptions;
18
34
  onSearchChange(query: string): void;
19
35
  onSwitchToCreateMode(): void;
@@ -28,6 +44,14 @@ export declare class DevToolbarPresetsToolComponent {
28
44
  protected getCurrentAppFeaturesCount(): number;
29
45
  protected getCurrentLanguage(): string;
30
46
  protected formatDate(isoString: string): string;
47
+ /**
48
+ * Toggle selection of an individual item
49
+ */
50
+ protected toggleItemSelection(signal: typeof this.selectedFlagIds, itemId: string): void;
51
+ /**
52
+ * Check if an item is selected
53
+ */
54
+ protected isItemSelected(selectedSet: Set<string>, itemId: string): boolean;
31
55
  static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarPresetsToolComponent, never>;
32
56
  static ɵcmp: i0.ɵɵComponentDeclaration<DevToolbarPresetsToolComponent, "ndt-presets-tool", never, {}, {}, never, never, true, never>;
33
57
  }
@@ -22,3 +22,12 @@ export interface DevToolbarPresetConfig {
22
22
  };
23
23
  }
24
24
  export type PresetFilter = 'all' | 'recent' | 'favorites';
25
+ export interface PresetCategoryOptions {
26
+ includeFeatureFlags?: boolean;
27
+ includePermissions?: boolean;
28
+ includeAppFeatures?: boolean;
29
+ includeLanguage?: boolean;
30
+ selectedFlagIds?: string[];
31
+ selectedPermissionIds?: string[];
32
+ selectedFeatureIds?: string[];
33
+ }
@@ -1,6 +1,14 @@
1
1
  import { Observable } from 'rxjs';
2
- import { DevToolbarPreset } from './presets.models';
2
+ import { DevToolbarPreset, DevToolbarPresetConfig } from './presets.models';
3
3
  import * as i0 from "@angular/core";
4
+ /**
5
+ * Partial preset for initialization (without generated fields)
6
+ */
7
+ export interface InitialPreset {
8
+ name: string;
9
+ description?: string;
10
+ config: DevToolbarPresetConfig;
11
+ }
4
12
  /**
5
13
  * Public service for managing dev toolbar presets.
6
14
  * Allows developers to programmatically save, load, and manage presets.
@@ -46,6 +54,68 @@ export declare class DevToolbarPresetsService {
46
54
  * @throws Error if JSON is invalid
47
55
  */
48
56
  importPreset(json: string): DevToolbarPreset;
57
+ /**
58
+ * Initialize presets with predefined configurations.
59
+ * Useful for setting up default presets that all developers can use.
60
+ *
61
+ * @param presets - Array of preset configurations to initialize
62
+ * @returns Array of created presets
63
+ *
64
+ * @example
65
+ * ```typescript
66
+ * const presetsService = inject(DevToolbarPresetsService);
67
+ *
68
+ * presetsService.initializePresets([
69
+ * {
70
+ * name: 'Admin User',
71
+ * description: 'Full access admin configuration',
72
+ * config: {
73
+ * featureFlags: {
74
+ * enabled: ['admin-panel', 'advanced-features'],
75
+ * disabled: []
76
+ * },
77
+ * permissions: {
78
+ * granted: ['admin', 'write', 'delete'],
79
+ * denied: []
80
+ * },
81
+ * appFeatures: {
82
+ * enabled: ['analytics', 'reporting'],
83
+ * disabled: []
84
+ * },
85
+ * language: 'en'
86
+ * }
87
+ * },
88
+ * {
89
+ * name: 'Read-Only User',
90
+ * description: 'Limited access for viewing only',
91
+ * config: {
92
+ * featureFlags: {
93
+ * enabled: [],
94
+ * disabled: ['admin-panel', 'advanced-features']
95
+ * },
96
+ * permissions: {
97
+ * granted: ['read'],
98
+ * denied: ['write', 'delete']
99
+ * },
100
+ * appFeatures: {
101
+ * enabled: [],
102
+ * disabled: ['analytics', 'reporting']
103
+ * },
104
+ * language: null
105
+ * }
106
+ * }
107
+ * ]);
108
+ * ```
109
+ */
110
+ initializePresets(presets: InitialPreset[]): DevToolbarPreset[];
111
+ /**
112
+ * Clear all existing presets and set new initial presets.
113
+ * Use this to replace all presets with a fresh set of configurations.
114
+ *
115
+ * @param presets - Array of preset configurations to set as initial
116
+ * @returns Array of created presets
117
+ */
118
+ setInitialPresets(presets: InitialPreset[]): DevToolbarPreset[];
49
119
  static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarPresetsService, never>;
50
120
  static ɵprov: i0.ɵɵInjectableDeclaration<DevToolbarPresetsService>;
51
121
  }