@yuuvis/client-shell-core 0.6.5
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/esm2022/index.mjs +10 -0
- package/esm2022/lib/client-shell.assets.mjs +10 -0
- package/esm2022/lib/client-shell.interface.mjs +5 -0
- package/esm2022/lib/services/command-palette/command-palette/command-palette.component.mjs +175 -0
- package/esm2022/lib/services/command-palette/command-palette.interface.mjs +2 -0
- package/esm2022/lib/services/command-palette/command-palette.service.mjs +128 -0
- package/esm2022/lib/services/shell/shell.extentions.service.mjs +9 -0
- package/esm2022/lib/services/shell/shell.service.mjs +295 -0
- package/esm2022/lib/services/shell-notifications/shell-notifications.interface.mjs +2 -0
- package/esm2022/lib/services/shell-notifications/shell-notifications.service.mjs +89 -0
- package/esm2022/lib/tile-extension.interface.mjs +2 -0
- package/esm2022/yuuvis-client-shell-core.mjs +5 -0
- package/index.d.ts +9 -0
- package/lib/client-shell.assets.d.ts +8 -0
- package/lib/client-shell.interface.d.ts +55 -0
- package/lib/services/command-palette/command-palette/command-palette.component.d.ts +31 -0
- package/lib/services/command-palette/command-palette.interface.d.ts +16 -0
- package/lib/services/command-palette/command-palette.service.d.ts +41 -0
- package/lib/services/shell/shell.extentions.service.d.ts +2 -0
- package/lib/services/shell/shell.service.d.ts +124 -0
- package/lib/services/shell-notifications/shell-notifications.interface.d.ts +10 -0
- package/lib/services/shell-notifications/shell-notifications.service.d.ts +34 -0
- package/lib/tile-extension.interface.d.ts +12 -0
- package/package.json +27 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { DmsObject, ObjectCreateFlavor } from '@yuuvis/client-core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { App, AppSchema, AppSchemaFlavor, ClientShellConfig, GlobalShortcut, ObjectFlavor, ShellAppSettings } from '../../client-shell.interface';
|
|
4
|
+
import { TileExtension } from '../../tile-extension.interface';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class ShellService {
|
|
7
|
+
#private;
|
|
8
|
+
private translate;
|
|
9
|
+
private _busyCount;
|
|
10
|
+
private isBusySubject;
|
|
11
|
+
isBusy$: Observable<boolean>;
|
|
12
|
+
appSettings$: Observable<ShellAppSettings[]>;
|
|
13
|
+
appBaseRoutes: Record<string, string>;
|
|
14
|
+
shellConfig: import("@angular/core").WritableSignal<ClientShellConfig>;
|
|
15
|
+
/** TODO: implement this feature ????
|
|
16
|
+
* Global shortcuts are captured by the shell to provide a consistent experience
|
|
17
|
+
* accross all apps. Search is one example. Apps should not define their own shourtcuts
|
|
18
|
+
* for search. Instead they should subscribe to the global shortcuts and initialize their
|
|
19
|
+
* search based on the global search shortcut.
|
|
20
|
+
*/
|
|
21
|
+
globalShortcuts$: Observable<GlobalShortcut>;
|
|
22
|
+
private _extensions;
|
|
23
|
+
private _objectFlavors;
|
|
24
|
+
private _objectCreateFlavors;
|
|
25
|
+
setShellConfig(csc: ClientShellConfig): void;
|
|
26
|
+
setAppBaseRoutes(apps: App[]): void;
|
|
27
|
+
registerApp(schema: AppSchema): void;
|
|
28
|
+
getRegisteredApp(id: string): AppSchema | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Register settings for apps to hook into shell settings page.
|
|
31
|
+
* These exposed settings will be saved in the users settings on the backend.
|
|
32
|
+
* @param appID ID of the app that exposes the settings
|
|
33
|
+
* @param cfg ShellAppSettings object containing the settings
|
|
34
|
+
*/
|
|
35
|
+
registerAppSettings(appID: string, cfg: ShellAppSettings): void;
|
|
36
|
+
/**
|
|
37
|
+
* Load persisted settings for a specific app
|
|
38
|
+
* @param appID ID of the app to load the settings for
|
|
39
|
+
*/
|
|
40
|
+
usersAppSettings$(appID: string): Observable<ShellAppSettings | undefined>;
|
|
41
|
+
saveUsersAppSettings(appID: string, settings: ShellAppSettings): Observable<any>;
|
|
42
|
+
addBusy(): void;
|
|
43
|
+
removeBusy(): void;
|
|
44
|
+
exposeObjectCreateFlavors(flavors: ObjectCreateFlavor[]): void;
|
|
45
|
+
concealObjectCreateFlavors(flavors: ObjectCreateFlavor[]): void;
|
|
46
|
+
getObjectCreateFlavors(): ObjectCreateFlavor[];
|
|
47
|
+
/**
|
|
48
|
+
* Exposes a list of object flavors to the shell.
|
|
49
|
+
* Flavors are able to be applied to objects and add new metadata properties to them.
|
|
50
|
+
* @param flavors Array of flavors to be exposed
|
|
51
|
+
* @param app Optional ID of the app that exposes the flavors (defaults to 'global' if not provided)
|
|
52
|
+
*/
|
|
53
|
+
exposeObjectFlavors(flavors: AppSchemaFlavor[], app?: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Removes exposed object flavors from the shell.
|
|
56
|
+
* @param flavors Array of flavors to be concealed
|
|
57
|
+
*/
|
|
58
|
+
concealObjectFlavors(flavors: AppSchemaFlavor[], app?: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* Exposes an object flavor to the shell. Flavors are able to be applied to objects
|
|
61
|
+
* in order to add a new aspect to them. An object containing an image for example could
|
|
62
|
+
* be added a flavor of 'EXIF Data' that will add the corresponding SOT to it. This way the
|
|
63
|
+
* object gets new metadata properties. If supported, these metadata could even be extracted
|
|
64
|
+
* from the file and filled out automatically.
|
|
65
|
+
* @param flavor The flavor object to be exposed
|
|
66
|
+
* @param app Optional ID of the app that exposes the flavor (defaults to 'global' if not provided)
|
|
67
|
+
*/
|
|
68
|
+
exposeObjectFlavor(flavor: AppSchemaFlavor, app?: string): void;
|
|
69
|
+
/**
|
|
70
|
+
* Removes an exposed object flavor from the shell.
|
|
71
|
+
* @param flavor Flavor to be concealed
|
|
72
|
+
* @param app Optional ID of the app that exposes the flavor (defaults to 'global' if not provided)
|
|
73
|
+
*/
|
|
74
|
+
concealObjectFlavor(flavor: AppSchemaFlavor, app?: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* Get registered object flavors
|
|
77
|
+
* @param app Optional app ID that restricts the returned flavors to the ones
|
|
78
|
+
* provided by a particular app. If not provided all flavors are returned
|
|
79
|
+
* @returns Array of matching object flavors
|
|
80
|
+
*/
|
|
81
|
+
getObjectFlavors(app?: string): ObjectFlavor[];
|
|
82
|
+
/**
|
|
83
|
+
* Triggers the application of an object flavor. If the flavor has an applyComponent
|
|
84
|
+
* defined, the overlay will be opened with the component. Otherwise the flavor will
|
|
85
|
+
* be applied directly to the object.
|
|
86
|
+
* @param dmsObject The object to apply the flavor to
|
|
87
|
+
* @param flavor The flavor to apply
|
|
88
|
+
* @param data Optional data to be passed to the flavor component
|
|
89
|
+
* @returns Observable that emits true if the flavor was applied successfully
|
|
90
|
+
*/
|
|
91
|
+
triggerApplyObjectFlavor(dmsObject: DmsObject, flavor: ObjectFlavor, data?: any): Observable<boolean>;
|
|
92
|
+
removeObjectFlavor(dmsObject: DmsObject, flavor: ObjectFlavor): Observable<any>;
|
|
93
|
+
/**
|
|
94
|
+
* Get object flavors applicable for a certain mimetype
|
|
95
|
+
* @param mimeType Mime type or mime type pattern like 'image/*'
|
|
96
|
+
* @param app Optional app ID that restricts the returned flavors to the ones
|
|
97
|
+
* provided by a particular app
|
|
98
|
+
* @param customFlavors Optional array of custom flavors to also take into account.
|
|
99
|
+
* This could be flavors managed by an app itself that are not supposed to be
|
|
100
|
+
* exposed to other apps
|
|
101
|
+
* @returns Array of matching object flavors
|
|
102
|
+
*/
|
|
103
|
+
getApplicableObjectFlavors(mimeType: string, app?: string, customFlavors?: ObjectFlavor[]): ObjectFlavor[];
|
|
104
|
+
/**
|
|
105
|
+
* Get applied and applicable object flavors for a certain object
|
|
106
|
+
* @param dmsObject DmsObject to get flavors for
|
|
107
|
+
* @returns Object containing two arrays: applied and applicable flavors
|
|
108
|
+
*/
|
|
109
|
+
getAppliedObjectFlavors(dmsObject: DmsObject): {
|
|
110
|
+
applied: ObjectFlavor[];
|
|
111
|
+
applicable: ObjectFlavor[];
|
|
112
|
+
};
|
|
113
|
+
applyObjectFlavor(dmsObject: DmsObject, flavor: ObjectFlavor, data?: Record<string, unknown>): Observable<DmsObject>;
|
|
114
|
+
registerTileExtension(ext: TileExtension): void;
|
|
115
|
+
/**
|
|
116
|
+
* Get tile extensions for a certain type
|
|
117
|
+
* @param typeId ID of the type to fetch extesion for (objectTypeID or secondaryObjectTypeID)
|
|
118
|
+
* @returns
|
|
119
|
+
*/
|
|
120
|
+
getRegisteredTileExtensions(): Record<string, TileExtension>;
|
|
121
|
+
_init(): void;
|
|
122
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShellService, never>;
|
|
123
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ShellService>;
|
|
124
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ShellNotification {
|
|
2
|
+
title: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
app?: string;
|
|
6
|
+
level?: ShellNotificationLevel;
|
|
7
|
+
targetRoute?: string;
|
|
8
|
+
removeOnTargetRouteNavigated?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type ShellNotificationLevel = 'alert' | 'info' | 'warning' | 'success';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ShellNotification } from './shell-notifications.interface';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Service managing shell notifications.
|
|
6
|
+
* Every app could propagate shell notifications. They will be published
|
|
7
|
+
* in the notifications section of the shell. Incoming new messahes will
|
|
8
|
+
* also add an indicator to the icon in the shell bar.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare class ShellNotificationsService {
|
|
12
|
+
#private;
|
|
13
|
+
private LOCAL_STORAGE_KEY;
|
|
14
|
+
private appCache;
|
|
15
|
+
private translate;
|
|
16
|
+
private _notifications;
|
|
17
|
+
private _notificationsSource;
|
|
18
|
+
shellNotifications$: Observable<ShellNotificationItem[]>;
|
|
19
|
+
constructor();
|
|
20
|
+
add(notification: ShellNotification, nativeNotification?: boolean): void;
|
|
21
|
+
remove(id: string): void;
|
|
22
|
+
removeAll(): void;
|
|
23
|
+
markAllAsSeen(): void;
|
|
24
|
+
getNotificationById(id: string): ShellNotificationItem | undefined;
|
|
25
|
+
private _updateNotifications;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShellNotificationsService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ShellNotificationsService>;
|
|
28
|
+
}
|
|
29
|
+
type ShellNotificationItem = ShellNotification & {
|
|
30
|
+
id: string;
|
|
31
|
+
timestamp: number;
|
|
32
|
+
seen: boolean;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Type } from "@angular/core";
|
|
2
|
+
export interface TileExtension {
|
|
3
|
+
typeId: string;
|
|
4
|
+
cmp: Type<TileExtensionComponent>;
|
|
5
|
+
}
|
|
6
|
+
export interface TileExtensionComponent {
|
|
7
|
+
data: any;
|
|
8
|
+
}
|
|
9
|
+
export interface TileExtensionDirectiveInput {
|
|
10
|
+
typeId: string;
|
|
11
|
+
data: any;
|
|
12
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yuuvis/client-shell-core",
|
|
3
|
+
"version": "0.6.5",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^18.2.0",
|
|
6
|
+
"@angular/core": "^18.2.0",
|
|
7
|
+
"@angular/forms": "^18.2.0"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@yuuvis/client-core": "0.6.5",
|
|
11
|
+
"tslib": "^2.3.0"
|
|
12
|
+
},
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"module": "esm2022/yuuvis-client-shell-core.mjs",
|
|
15
|
+
"typings": "index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
"./package.json": {
|
|
18
|
+
"default": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"esm2022": "./esm2022/yuuvis-client-shell-core.mjs",
|
|
23
|
+
"esm": "./esm2022/yuuvis-client-shell-core.mjs",
|
|
24
|
+
"default": "./esm2022/yuuvis-client-shell-core.mjs"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|