cloud-ide-layout 0.0.1 → 1.0.1
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 +466 -13
- package/esm2022/lib/cloud-ide-layout.routes.mjs +24 -10
- package/esm2022/lib/layout/console/console-wrapper/console-wrapper.component.mjs +6 -6
- package/esm2022/lib/layout/console/console.service.mjs +28 -0
- package/esm2022/lib/layout/footer/footer-wrapper/footer-wrapper.component.mjs +16 -8
- package/esm2022/lib/layout/footer/footer.service.mjs +28 -0
- package/esm2022/lib/layout/header/header-wrapper/header-wrapper.component.mjs +69 -18
- package/esm2022/lib/layout/header/header.service.mjs +17 -6
- package/esm2022/lib/layout/home/home-wrapper/home-wrapper.component.mjs +194 -7
- package/esm2022/lib/layout/layout/layout-wrapper/layout-wrapper.component.mjs +18 -9
- package/esm2022/lib/layout/request/request-wrapper/request-wrapper.component.mjs +54 -6
- package/esm2022/lib/layout/request/request.service.mjs +235 -0
- package/esm2022/lib/layout/request/tab-content/tab-content.component.mjs +84 -0
- package/esm2022/lib/layout/shared/shared-wrapper/shared-wrapper.component.mjs +32 -20
- package/esm2022/lib/layout/shared/shared.service.mjs +490 -14
- package/esm2022/lib/layout/sidebar/sidebar-wrapper/sidebar-wrapper.component.mjs +480 -15
- package/esm2022/lib/layout/sidebar/sidebar.service.mjs +20 -7
- package/esm2022/lib/layout/sidedrawer/cide-lyt-drawer-base.class.mjs +40 -0
- package/esm2022/lib/layout/sidedrawer/drawer-theme/drawer-theme.component.mjs +296 -0
- package/esm2022/lib/layout/sidedrawer/sidedrawer-notes/sidedrawer-notes.component.mjs +175 -0
- package/esm2022/lib/layout/sidedrawer/sidedrawer-notes/sidedrawer-notes.service.mjs +51 -0
- package/esm2022/lib/layout/sidedrawer/sidedrawer-wrapper/sidedrawer-wrapper.component.mjs +254 -9
- package/esm2022/lib/layout/sidedrawer/sidedrawer.service.mjs +70 -0
- package/esm2022/lib/services/app-state/app-state-helper.service.mjs +222 -0
- package/esm2022/lib/services/app-state/app-state.service.mjs +256 -0
- package/esm2022/lib/services/app-state/index.mjs +3 -0
- package/esm2022/lib/services/cache-manager/cache-manager.service.mjs +112 -0
- package/esm2022/lib/services/file-manager/file-manager.service.mjs +7 -7
- package/esm2022/lib/services/tab-state.service.mjs +128 -0
- package/esm2022/lib/services/theme/theme.service.mjs +151 -0
- package/esm2022/lib/services/user-status/user-status.service.mjs +135 -0
- package/esm2022/lib/utils/custom-route-reuse-strategy.mjs +61 -0
- package/esm2022/lib/utils/index.mjs +2 -0
- package/esm2022/public-api.mjs +7 -1
- package/fesm2022/cloud-ide-layout-cloud-ide-layout-DqL3A73V.mjs +2914 -0
- package/fesm2022/cloud-ide-layout-cloud-ide-layout-DqL3A73V.mjs.map +1 -0
- package/fesm2022/cloud-ide-layout-drawer-theme.component-xd8IG3WP.mjs +443 -0
- package/fesm2022/cloud-ide-layout-drawer-theme.component-xd8IG3WP.mjs.map +1 -0
- package/fesm2022/cloud-ide-layout-home-wrapper.component-DEdsEiaq.mjs +197 -0
- package/fesm2022/cloud-ide-layout-home-wrapper.component-DEdsEiaq.mjs.map +1 -0
- package/fesm2022/cloud-ide-layout-sidedrawer-notes.component-ds12wZbh.mjs +260 -0
- package/fesm2022/cloud-ide-layout-sidedrawer-notes.component-ds12wZbh.mjs.map +1 -0
- package/fesm2022/cloud-ide-layout.mjs +1 -261
- package/fesm2022/cloud-ide-layout.mjs.map +1 -1
- package/lib/cloud-ide-layout.routes.d.ts +1 -0
- package/lib/layout/console/console-wrapper/console-wrapper.component.d.ts +3 -3
- package/lib/layout/console/console.service.d.ts +9 -0
- package/lib/layout/footer/footer-wrapper/footer-wrapper.component.d.ts +7 -3
- package/lib/layout/footer/footer.service.d.ts +9 -0
- package/lib/layout/header/header-wrapper/header-wrapper.component.d.ts +17 -9
- package/lib/layout/header/header.service.d.ts +4 -3
- package/lib/layout/home/home-wrapper/home-wrapper.component.d.ts +90 -1
- package/lib/layout/request/request-wrapper/request-wrapper.component.d.ts +10 -1
- package/lib/layout/request/request.service.d.ts +60 -0
- package/lib/layout/request/tab-content/tab-content.component.d.ts +19 -0
- package/lib/layout/shared/shared-wrapper/shared-wrapper.component.d.ts +4 -5
- package/lib/layout/shared/shared.service.d.ts +104 -6
- package/lib/layout/sidebar/sidebar-wrapper/sidebar-wrapper.component.d.ts +135 -6
- package/lib/layout/sidebar/sidebar.service.d.ts +3 -2
- package/lib/layout/sidedrawer/cide-lyt-drawer-base.class.d.ts +16 -0
- package/lib/layout/sidedrawer/drawer-theme/drawer-theme.component.d.ts +71 -0
- package/lib/layout/sidedrawer/sidedrawer-notes/sidedrawer-notes.component.d.ts +48 -0
- package/lib/layout/sidedrawer/sidedrawer-notes/sidedrawer-notes.service.d.ts +13 -0
- package/lib/layout/sidedrawer/sidedrawer-wrapper/sidedrawer-wrapper.component.d.ts +28 -3
- package/lib/layout/sidedrawer/sidedrawer.service.d.ts +30 -0
- package/lib/services/app-state/app-state-helper.service.d.ts +150 -0
- package/lib/services/app-state/app-state.service.d.ts +85 -0
- package/lib/services/app-state/index.d.ts +3 -0
- package/lib/services/cache-manager/cache-manager.service.d.ts +64 -0
- package/lib/services/file-manager/file-manager.service.d.ts +0 -2
- package/lib/services/tab-state.service.d.ts +79 -0
- package/lib/services/theme/theme.service.d.ts +71 -0
- package/lib/services/user-status/user-status.service.d.ts +57 -0
- package/lib/utils/custom-route-reuse-strategy.d.ts +15 -0
- package/lib/utils/index.d.ts +1 -0
- package/package.json +2 -2
- package/public-api.d.ts +4 -0
- package/src/lib/assets/css/cide-lyt-style.scss +182 -0
- package/src/lib/assets/css/cide-lyt-variable.scss +119 -0
- package/fesm2022/cloud-ide-layout-home-wrapper.component-BV7ptL0Y.mjs +0 -14
- package/fesm2022/cloud-ide-layout-home-wrapper.component-BV7ptL0Y.mjs.map +0 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { IUser, menuResponseData, ICoreSyen } from 'cloud-ide-lms-model';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class AppStateHelperService {
|
|
5
|
+
private appStateService;
|
|
6
|
+
private sidebarService;
|
|
7
|
+
readonly currentUser: import("@angular/core").Signal<IUser | null>;
|
|
8
|
+
readonly isAuthenticated: import("@angular/core").Signal<boolean>;
|
|
9
|
+
readonly userInfo: import("@angular/core").Signal<{
|
|
10
|
+
id: string | undefined;
|
|
11
|
+
name: string;
|
|
12
|
+
email: string | undefined;
|
|
13
|
+
role: string | undefined;
|
|
14
|
+
} | null>;
|
|
15
|
+
readonly activeModule: import("@angular/core").Signal<menuResponseData | null>;
|
|
16
|
+
readonly activeModuleInfo: import("@angular/core").Signal<{
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
icon: string;
|
|
20
|
+
path: string;
|
|
21
|
+
type: string;
|
|
22
|
+
} | null>;
|
|
23
|
+
readonly activeEntity: import("@angular/core").Signal<ICoreSyen | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Get current user value (non-reactive)
|
|
26
|
+
*/
|
|
27
|
+
getCurrentUser(): IUser | null;
|
|
28
|
+
/**
|
|
29
|
+
* Set user data
|
|
30
|
+
*/
|
|
31
|
+
setUser(user: IUser | null): void;
|
|
32
|
+
/**
|
|
33
|
+
* Update user data (partial update)
|
|
34
|
+
*/
|
|
35
|
+
updateUser(updates: Partial<IUser>): void;
|
|
36
|
+
/**
|
|
37
|
+
* Clear user data
|
|
38
|
+
*/
|
|
39
|
+
clearUser(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Check if user is authenticated
|
|
42
|
+
*/
|
|
43
|
+
isUserAuthenticated(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Get user info object
|
|
46
|
+
*/
|
|
47
|
+
getUserInfo(): {
|
|
48
|
+
id: string | undefined;
|
|
49
|
+
name: string;
|
|
50
|
+
email: string | undefined;
|
|
51
|
+
role: string | undefined;
|
|
52
|
+
} | null;
|
|
53
|
+
/**
|
|
54
|
+
* Get user ID
|
|
55
|
+
*/
|
|
56
|
+
getUserId(): string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Get user name
|
|
59
|
+
*/
|
|
60
|
+
getUserName(): string | null;
|
|
61
|
+
/**
|
|
62
|
+
* Get user email
|
|
63
|
+
*/
|
|
64
|
+
getUserEmail(): string | null;
|
|
65
|
+
/**
|
|
66
|
+
* Get user username
|
|
67
|
+
*/
|
|
68
|
+
getUserUsername(): string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Get user full name
|
|
71
|
+
*/
|
|
72
|
+
getUserFullName(): string | null;
|
|
73
|
+
/**
|
|
74
|
+
* Get user first name
|
|
75
|
+
*/
|
|
76
|
+
getUserFirstName(): string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Get user last name
|
|
79
|
+
*/
|
|
80
|
+
getUserLastName(): string | null;
|
|
81
|
+
/**
|
|
82
|
+
* Get user mobile number
|
|
83
|
+
*/
|
|
84
|
+
getUserMobile(): number | null;
|
|
85
|
+
/**
|
|
86
|
+
* Set the active module
|
|
87
|
+
*/
|
|
88
|
+
setActiveModule(module: menuResponseData | null): void;
|
|
89
|
+
/**
|
|
90
|
+
* Get active module value (non-reactive)
|
|
91
|
+
*/
|
|
92
|
+
getActiveModule(): menuResponseData | null;
|
|
93
|
+
/**
|
|
94
|
+
* Get active module info
|
|
95
|
+
*/
|
|
96
|
+
getActiveModuleInfo(): {
|
|
97
|
+
id: string;
|
|
98
|
+
title: string;
|
|
99
|
+
icon: string;
|
|
100
|
+
path: string;
|
|
101
|
+
type: string;
|
|
102
|
+
} | null;
|
|
103
|
+
/**
|
|
104
|
+
* Get active module ID
|
|
105
|
+
*/
|
|
106
|
+
getActiveModuleId(): string | null;
|
|
107
|
+
/**
|
|
108
|
+
* Get active module title
|
|
109
|
+
*/
|
|
110
|
+
getActiveModuleTitle(): string | null;
|
|
111
|
+
/**
|
|
112
|
+
* Get active module icon
|
|
113
|
+
*/
|
|
114
|
+
getActiveModuleIcon(): string | null;
|
|
115
|
+
/**
|
|
116
|
+
* Set a module as active by its ID
|
|
117
|
+
* This replaces the previous isModuleActive method to use setActiveModule instead of getActiveModuleId
|
|
118
|
+
*/
|
|
119
|
+
setActiveModuleById(moduleId: string): Observable<boolean>;
|
|
120
|
+
/**
|
|
121
|
+
* Check if a module is active (keeping the original functionality for backward compatibility)
|
|
122
|
+
*/
|
|
123
|
+
isModuleActive(moduleId: string): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Set the active entity
|
|
126
|
+
*/
|
|
127
|
+
setActiveEntity(entity: ICoreSyen | null): void;
|
|
128
|
+
/**
|
|
129
|
+
* Get active entity value (non-reactive)
|
|
130
|
+
*/
|
|
131
|
+
getActiveEntity(): ICoreSyen | null;
|
|
132
|
+
/**
|
|
133
|
+
* Get active entity ID
|
|
134
|
+
*/
|
|
135
|
+
getActiveEntityId(): string;
|
|
136
|
+
/**
|
|
137
|
+
* Get active entity name
|
|
138
|
+
*/
|
|
139
|
+
getActiveEntityName(): string | null;
|
|
140
|
+
/**
|
|
141
|
+
* Get active entity code
|
|
142
|
+
*/
|
|
143
|
+
getActiveEntityCode(): string | null;
|
|
144
|
+
/**
|
|
145
|
+
* Manually refresh state from localStorage
|
|
146
|
+
*/
|
|
147
|
+
refreshFromLocalStorage(): void;
|
|
148
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppStateHelperService, never>;
|
|
149
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AppStateHelperService>;
|
|
150
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { IUser, menuResponseData, ICoreSyen } from 'cloud-ide-lms-model';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export interface AppState {
|
|
4
|
+
currentUser: IUser | null;
|
|
5
|
+
activeModule: menuResponseData | null;
|
|
6
|
+
activeEntity: ICoreSyen | null;
|
|
7
|
+
}
|
|
8
|
+
export declare class AppStateService {
|
|
9
|
+
private currentUserSignal;
|
|
10
|
+
private activeModuleSignal;
|
|
11
|
+
private activeEntitySignal;
|
|
12
|
+
readonly currentUser: import("@angular/core").Signal<IUser | null>;
|
|
13
|
+
readonly activeModule: import("@angular/core").Signal<menuResponseData | null>;
|
|
14
|
+
readonly activeEntity: import("@angular/core").Signal<ICoreSyen | null>;
|
|
15
|
+
readonly isAuthenticated: import("@angular/core").Signal<boolean>;
|
|
16
|
+
readonly userInfo: import("@angular/core").Signal<{
|
|
17
|
+
id: string | undefined;
|
|
18
|
+
name: string;
|
|
19
|
+
email: string | undefined;
|
|
20
|
+
role: string | undefined;
|
|
21
|
+
} | null>;
|
|
22
|
+
readonly activeModuleInfo: import("@angular/core").Signal<{
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
path: string;
|
|
27
|
+
type: string;
|
|
28
|
+
} | null>;
|
|
29
|
+
constructor();
|
|
30
|
+
/**
|
|
31
|
+
* Set the current user
|
|
32
|
+
*/
|
|
33
|
+
setUser(user: IUser | null): void;
|
|
34
|
+
/**
|
|
35
|
+
* Update user data (partial update)
|
|
36
|
+
*/
|
|
37
|
+
updateUser(updates: Partial<IUser>): void;
|
|
38
|
+
/**
|
|
39
|
+
* Clear user data
|
|
40
|
+
*/
|
|
41
|
+
clearUser(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Get current user value (non-reactive)
|
|
44
|
+
*/
|
|
45
|
+
getUserValue(): IUser | null;
|
|
46
|
+
/**
|
|
47
|
+
* Set the active module
|
|
48
|
+
*/
|
|
49
|
+
setActiveModule(module: menuResponseData | null): void;
|
|
50
|
+
/**
|
|
51
|
+
* Get active module value (non-reactive)
|
|
52
|
+
*/
|
|
53
|
+
getActiveModuleValue(): menuResponseData | null;
|
|
54
|
+
/**
|
|
55
|
+
* Set the active entity
|
|
56
|
+
*/
|
|
57
|
+
setActiveEntity(entity: ICoreSyen | null): void;
|
|
58
|
+
/**
|
|
59
|
+
* Get active entity value (non-reactive)
|
|
60
|
+
*/
|
|
61
|
+
getActiveEntityValue(): ICoreSyen | null;
|
|
62
|
+
/**
|
|
63
|
+
* Manually refresh state from localStorage
|
|
64
|
+
* Call this method when you need to sync with external localStorage changes
|
|
65
|
+
*/
|
|
66
|
+
refreshFromLocalStorage(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Check if localStorage is available (browser environment)
|
|
69
|
+
*/
|
|
70
|
+
private isLocalStorageAvailable;
|
|
71
|
+
/**
|
|
72
|
+
* Save state to localStorage
|
|
73
|
+
*/
|
|
74
|
+
private saveToLocalStorage;
|
|
75
|
+
/**
|
|
76
|
+
* Load state from localStorage
|
|
77
|
+
*/
|
|
78
|
+
private loadFromLocalStorage;
|
|
79
|
+
/**
|
|
80
|
+
* Setup storage event listener to handle external localStorage changes
|
|
81
|
+
*/
|
|
82
|
+
private setupStorageListener;
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppStateService, never>;
|
|
84
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AppStateService>;
|
|
85
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { designConfigControllerResponse } from 'cloud-ide-lms-model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CacheManagerService {
|
|
5
|
+
private sharedService;
|
|
6
|
+
readonly cacheStats: import("@angular/core").Signal<{
|
|
7
|
+
hitRatio: number;
|
|
8
|
+
memoryEstimate: string;
|
|
9
|
+
totalCached: number;
|
|
10
|
+
validCached: number;
|
|
11
|
+
expiredCached: number;
|
|
12
|
+
}>;
|
|
13
|
+
readonly isLoading: (pageCode: string) => boolean;
|
|
14
|
+
readonly getCachedData: (pageCode: string) => designConfigControllerResponse | null;
|
|
15
|
+
/**
|
|
16
|
+
* Get page data with caching - this is the main method components should use
|
|
17
|
+
*/
|
|
18
|
+
getPageData(pageCode: string, forceRefresh?: boolean): Observable<designConfigControllerResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Preload multiple pages for better performance
|
|
21
|
+
*/
|
|
22
|
+
preloadPages(pageCodes: string[]): void;
|
|
23
|
+
/**
|
|
24
|
+
* Invalidate specific page cache
|
|
25
|
+
*/
|
|
26
|
+
invalidatePage(pageCode: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Clear all cache
|
|
29
|
+
*/
|
|
30
|
+
clearCache(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Get cache status for debugging
|
|
33
|
+
*/
|
|
34
|
+
getCacheStatus(): {
|
|
35
|
+
pageCode: string;
|
|
36
|
+
cached: boolean;
|
|
37
|
+
expired: boolean;
|
|
38
|
+
loading: boolean;
|
|
39
|
+
}[];
|
|
40
|
+
/**
|
|
41
|
+
* Estimate memory usage of cache (rough estimate)
|
|
42
|
+
*/
|
|
43
|
+
private estimateCacheMemoryUsage;
|
|
44
|
+
/**
|
|
45
|
+
* Check if cache entry is valid
|
|
46
|
+
*/
|
|
47
|
+
private isCacheValid;
|
|
48
|
+
/**
|
|
49
|
+
* Export cache data for debugging or backup
|
|
50
|
+
*/
|
|
51
|
+
exportCacheData(): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get performance metrics
|
|
54
|
+
*/
|
|
55
|
+
getPerformanceMetrics(): {
|
|
56
|
+
totalPages: number;
|
|
57
|
+
cachedPages: number;
|
|
58
|
+
loadingPages: number;
|
|
59
|
+
cacheHitRatio: number;
|
|
60
|
+
averageResponseTime?: number;
|
|
61
|
+
};
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CacheManagerService, never>;
|
|
63
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CacheManagerService>;
|
|
64
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
1
|
import { MFileManager, fileManagerControllerResponse } from 'cloud-ide-lms-model';
|
|
3
2
|
import { Observable } from 'rxjs';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
export declare class CideLytFileManagerService {
|
|
6
5
|
private http;
|
|
7
|
-
constructor(http: HttpClient);
|
|
8
6
|
getFileDetails(body: MFileManager): Observable<fileManagerControllerResponse>;
|
|
9
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<CideLytFileManagerService, never>;
|
|
10
8
|
static ɵprov: i0.ɵɵInjectableDeclaration<CideLytFileManagerService>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Defines the shape of the state for components that need to persist
|
|
5
|
+
* data on a per-tab basis. Using Partial<> for flexibility.
|
|
6
|
+
*/
|
|
7
|
+
export interface PerTabState {
|
|
8
|
+
sideDrawer?: {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
activeComponent: string | null;
|
|
11
|
+
componentState?: {
|
|
12
|
+
[componentKey: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
footer?: {
|
|
16
|
+
someData?: string;
|
|
17
|
+
};
|
|
18
|
+
console?: {
|
|
19
|
+
history: string[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Represents the entire state for a single tab, including its metadata
|
|
24
|
+
* and the state of various components.
|
|
25
|
+
*/
|
|
26
|
+
export interface TabState {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
componentState: PerTabState;
|
|
30
|
+
}
|
|
31
|
+
export declare class TabStateService {
|
|
32
|
+
private readonly _tabsState;
|
|
33
|
+
private readonly _activeTabId;
|
|
34
|
+
/** An observable of all open tabs. */
|
|
35
|
+
readonly tabs$: Observable<TabState[]>;
|
|
36
|
+
/** An observable of the currently active tab's ID. */
|
|
37
|
+
readonly activeTabId$: Observable<string | null>;
|
|
38
|
+
/** An observable of the state of the currently active tab. */
|
|
39
|
+
readonly activeTabState$: Observable<TabState | null>;
|
|
40
|
+
/** An observable of just the component-specific state for the active tab. */
|
|
41
|
+
readonly activeComponentState$: Observable<PerTabState | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Adds a new tab to the state.
|
|
44
|
+
* @param title The title for the new tab.
|
|
45
|
+
* @param id An optional unique ID. If not provided, one will be generated.
|
|
46
|
+
* @returns The ID of the newly created tab.
|
|
47
|
+
*/
|
|
48
|
+
addTab(title: string, id?: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Removes a tab from the state.
|
|
51
|
+
* @param tabIdToRemove The ID of the tab to remove.
|
|
52
|
+
*/
|
|
53
|
+
removeTab(tabIdToRemove: string): void;
|
|
54
|
+
constructor();
|
|
55
|
+
/**
|
|
56
|
+
* Sets the currently active tab.
|
|
57
|
+
* @param tabId The unique identifier of the tab to activate.
|
|
58
|
+
*/
|
|
59
|
+
setActiveTab(tabId: string | null): void;
|
|
60
|
+
/**
|
|
61
|
+
* Updates the state for the currently active tab.
|
|
62
|
+
* This performs a deep merge to avoid overwriting nested state.
|
|
63
|
+
* @param partialState The partial state to update for the active tab.
|
|
64
|
+
*/
|
|
65
|
+
updateActiveTabState(partialState: Partial<PerTabState>): void;
|
|
66
|
+
/**
|
|
67
|
+
* Gets an observable for a specific tab's state.
|
|
68
|
+
* @param tabId The ID of the tab to observe.
|
|
69
|
+
*/
|
|
70
|
+
getTabState(tabId: string): Observable<TabState | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* Determines the ID of the next tab to activate when a tab is closed.
|
|
73
|
+
* @param idToRemove The ID of the tab being removed.
|
|
74
|
+
* @returns The ID of the next tab to activate, or null if no tabs are left.
|
|
75
|
+
*/
|
|
76
|
+
private getNextActiveTabId;
|
|
77
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabStateService, never>;
|
|
78
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TabStateService>;
|
|
79
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { SystemThemeControllerRespoonse, SystemThemesListControllerRespoonse, IEnvironmentConfig, SystemThemeUserPreferencesControllerRespoonse, MSystemThemeUserPreferencesRequest } from 'cloud-ide-lms-model';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare const ENVIRONMENT_CONFIG: InjectionToken<IEnvironmentConfig>;
|
|
6
|
+
export interface Theme {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Utility function to convert database format keys to CSS format and handle units
|
|
11
|
+
* @param key - The database format key (e.g., 'font_size_xxxl')
|
|
12
|
+
* @param value - The value to be set
|
|
13
|
+
* @returns Object with cssVarName and processed value
|
|
14
|
+
*/
|
|
15
|
+
export declare function processThemeVariable(key: string, value: string): {
|
|
16
|
+
cssVarName: string;
|
|
17
|
+
processedValue: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Sets a single CSS variable on the document root element
|
|
21
|
+
* @param key - The database format key (e.g., 'font_size_xxxl')
|
|
22
|
+
* @param value - The value to be set
|
|
23
|
+
* @param platformId - Platform ID for browser check
|
|
24
|
+
*/
|
|
25
|
+
export declare function setCSSVariable(key: string, value: string, platformId: object): void;
|
|
26
|
+
export declare class CideLytThemeService {
|
|
27
|
+
private selectedThemeSignal;
|
|
28
|
+
selectedTheme: import("@angular/core").Signal<string>;
|
|
29
|
+
private http;
|
|
30
|
+
private platformId;
|
|
31
|
+
private environment;
|
|
32
|
+
/**
|
|
33
|
+
* Fetches the theme from the API and applies it to the document.
|
|
34
|
+
* This method is intended to be called when the theme should actually be applied.
|
|
35
|
+
*/
|
|
36
|
+
fetchAndApplyTheme(): Observable<SystemThemeControllerRespoonse>;
|
|
37
|
+
/**
|
|
38
|
+
* Fetches the list of system themes from the API.
|
|
39
|
+
*/
|
|
40
|
+
fetchSystemThemesList(): Observable<SystemThemesListControllerRespoonse>;
|
|
41
|
+
/**
|
|
42
|
+
* Internal method to fetch the theme from the API and apply it.
|
|
43
|
+
*/
|
|
44
|
+
loadTheme(): Observable<SystemThemeControllerRespoonse>;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the CSS variables on the root element.
|
|
47
|
+
* @param theme - An object where keys are CSS variable names (e.g., '--color-text-body')
|
|
48
|
+
* and values are the color strings (e.g., '#ffffff').
|
|
49
|
+
*/
|
|
50
|
+
private applyTheme;
|
|
51
|
+
/**
|
|
52
|
+
* Saves the system theme user preferences.
|
|
53
|
+
* @param themeVars - The theme variables to save.
|
|
54
|
+
* @returns An observable of the system theme user preferences.
|
|
55
|
+
*/
|
|
56
|
+
saveSystemThemeUserPreferences(themeVars: MSystemThemeUserPreferencesRequest): Observable<SystemThemeUserPreferencesControllerRespoonse>;
|
|
57
|
+
/**
|
|
58
|
+
* Updates a single CSS variable using the utility function
|
|
59
|
+
* @param key - The database format key (e.g., 'font_size_xxxl')
|
|
60
|
+
* @param value - The value to be set
|
|
61
|
+
*/
|
|
62
|
+
updateCSSVariable(key: string, value: string): void;
|
|
63
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CideLytThemeService, never>;
|
|
64
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CideLytThemeService>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Factory function for APP_INITIALIZER.
|
|
68
|
+
* This function is used in your app.config.ts.
|
|
69
|
+
* It conditionally triggers theme loading based on the environment setting.
|
|
70
|
+
*/
|
|
71
|
+
export declare function themeFactory(themeService: CideLytThemeService, environmentConfig: IEnvironmentConfig): () => Observable<SystemThemeControllerRespoonse | undefined>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export type UserStatus = 'online' | 'offline' | 'away' | 'busy' | 'do-not-disturb';
|
|
3
|
+
export interface UserStatusData {
|
|
4
|
+
status: UserStatus;
|
|
5
|
+
lastActive: Date;
|
|
6
|
+
message?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class CideLytUserStatusService {
|
|
9
|
+
private _userStatus;
|
|
10
|
+
readonly userStatus: import("@angular/core").Signal<UserStatusData>;
|
|
11
|
+
readonly isOnline: import("@angular/core").Signal<boolean>;
|
|
12
|
+
readonly statusColor: import("@angular/core").Signal<string>;
|
|
13
|
+
readonly statusText: import("@angular/core").Signal<string>;
|
|
14
|
+
private statusSubject;
|
|
15
|
+
readonly status$: import("rxjs").Observable<UserStatusData>;
|
|
16
|
+
private lastActivityTime;
|
|
17
|
+
private autoAwayTimeout;
|
|
18
|
+
private autoAwayEnabled;
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Sets the user status
|
|
22
|
+
* @param status The new status to set
|
|
23
|
+
* @param message Optional custom status message
|
|
24
|
+
*/
|
|
25
|
+
setStatus(status: UserStatus, message?: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Marks user as active (resets away timer)
|
|
28
|
+
*/
|
|
29
|
+
markUserActive(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Gets CSS class for status color
|
|
32
|
+
*/
|
|
33
|
+
private getStatusColor;
|
|
34
|
+
/**
|
|
35
|
+
* Gets human-readable status text
|
|
36
|
+
*/
|
|
37
|
+
private getStatusText;
|
|
38
|
+
private getBaseStatusText;
|
|
39
|
+
/**
|
|
40
|
+
* Initialize activity tracking for auto-away
|
|
41
|
+
*/
|
|
42
|
+
private initializeActivityTracking;
|
|
43
|
+
/**
|
|
44
|
+
* Start the auto-away timer
|
|
45
|
+
*/
|
|
46
|
+
private startAutoAwayTimer;
|
|
47
|
+
/**
|
|
48
|
+
* Enable or disable auto-away functionality
|
|
49
|
+
*/
|
|
50
|
+
setAutoAwayEnabled(enabled: boolean): void;
|
|
51
|
+
/**
|
|
52
|
+
* Set the auto-away timeout (in milliseconds)
|
|
53
|
+
*/
|
|
54
|
+
setAutoAwayTimeout(timeout: number): void;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CideLytUserStatusService, never>;
|
|
56
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CideLytUserStatusService>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router';
|
|
2
|
+
/**
|
|
3
|
+
* A custom route reuse strategy that allows storing and retrieving routes
|
|
4
|
+
* to persist component state, especially for tabbed navigation.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CustomRouteReuseStrategy implements RouteReuseStrategy {
|
|
7
|
+
private storedRoutes;
|
|
8
|
+
private getPathKey;
|
|
9
|
+
shouldDetach(route: ActivatedRouteSnapshot): boolean;
|
|
10
|
+
store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle | null): void;
|
|
11
|
+
shouldAttach(route: ActivatedRouteSnapshot): boolean;
|
|
12
|
+
retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
|
|
13
|
+
shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
|
|
14
|
+
clearStoredRoute(pathKey: string): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './custom-route-reuse-strategy';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloud-ide-layout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^18.0.0",
|
|
6
6
|
"@angular/core": "^18.0.0"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": false,
|
|
12
12
|
"exports": {
|
|
13
|
-
"style": {
|
|
13
|
+
"./style": {
|
|
14
14
|
"sass": "./lib/assets/css/cide-lyt-variable.scss"
|
|
15
15
|
},
|
|
16
16
|
"./package.json": {
|
package/public-api.d.ts
CHANGED
|
@@ -3,3 +3,7 @@ export * from './lib/cloud-ide-layout.component';
|
|
|
3
3
|
export * from './lib/layout/shared/shared-wrapper/shared-wrapper.component';
|
|
4
4
|
export * from './lib/layout/shared/shared.service';
|
|
5
5
|
export * from './lib/cloud-ide-layout.routes';
|
|
6
|
+
export * from './lib/utils';
|
|
7
|
+
export * from './lib/services/app-state';
|
|
8
|
+
export * from './lib/services/user-status/user-status.service';
|
|
9
|
+
export * from './lib/services/cache-manager/cache-manager.service';
|