@seelen-ui/lib 2.1.3 → 2.1.8
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/esm/handlers/commands.d.ts +2 -4
- package/esm/handlers/commands.d.ts.map +1 -1
- package/esm/handlers/commands.js +2 -4
- package/esm/handlers/events.d.ts +0 -2
- package/esm/handlers/events.d.ts.map +1 -1
- package/esm/handlers/events.js +0 -2
- package/esm/state/icon_pack.d.ts +88 -16
- package/esm/state/icon_pack.d.ts.map +1 -1
- package/esm/state/icon_pack.js +148 -36
- package/esm/state/widget.d.ts +3 -0
- package/esm/state/widget.d.ts.map +1 -1
- package/esm/state/widget.js +1 -1
- package/esm/system_state/mod.d.ts +0 -1
- package/esm/system_state/mod.d.ts.map +1 -1
- package/esm/system_state/mod.js +0 -1
- package/esm/types/IconPack.d.ts +9 -0
- package/esm/types/IconPack.d.ts.map +1 -1
- package/esm/types/PinnedWegItemData.d.ts +10 -5
- package/esm/types/PinnedWegItemData.d.ts.map +1 -1
- package/esm/types/WegItemSubtype.d.ts +2 -0
- package/esm/types/WegItemSubtype.d.ts.map +1 -0
- package/esm/types/mod.d.ts +77 -78
- package/esm/types/mod.d.ts.map +1 -1
- package/esm/types/mod.js +77 -78
- package/package.json +1 -1
- package/script/handlers/commands.d.ts +2 -4
- package/script/handlers/commands.d.ts.map +1 -1
- package/script/handlers/commands.js +2 -4
- package/script/handlers/events.d.ts +0 -2
- package/script/handlers/events.d.ts.map +1 -1
- package/script/handlers/events.js +0 -2
- package/script/state/icon_pack.d.ts +88 -16
- package/script/state/icon_pack.d.ts.map +1 -1
- package/script/state/icon_pack.js +148 -36
- package/script/state/widget.d.ts +3 -0
- package/script/state/widget.d.ts.map +1 -1
- package/script/state/widget.js +1 -1
- package/script/system_state/mod.d.ts +0 -1
- package/script/system_state/mod.d.ts.map +1 -1
- package/script/system_state/mod.js +0 -1
- package/script/types/IconPack.d.ts +9 -0
- package/script/types/IconPack.d.ts.map +1 -1
- package/script/types/PinnedWegItemData.d.ts +10 -5
- package/script/types/PinnedWegItemData.d.ts.map +1 -1
- package/script/types/WegItemSubtype.d.ts +2 -0
- package/script/types/WegItemSubtype.d.ts.map +1 -0
- package/script/types/mod.d.ts +77 -78
- package/script/types/mod.d.ts.map +1 -1
- package/script/types/mod.js +77 -78
- package/esm/system_state/application_history.d.ts +0 -32
- package/esm/system_state/application_history.d.ts.map +0 -1
- package/esm/system_state/application_history.js +0 -15
- package/esm/types/ApplicationHistoryEntry.d.ts +0 -8
- package/esm/types/ApplicationHistoryEntry.d.ts.map +0 -1
- package/esm/types/ApplicationHistoryEntry.js +0 -1
- package/esm/types/FocusedApp.d.ts +0 -8
- package/esm/types/FocusedApp.d.ts.map +0 -1
- package/script/system_state/application_history.d.ts +0 -32
- package/script/system_state/application_history.d.ts.map +0 -1
- package/script/system_state/application_history.js +0 -19
- package/script/types/ApplicationHistoryEntry.d.ts +0 -8
- package/script/types/ApplicationHistoryEntry.d.ts.map +0 -1
- package/script/types/ApplicationHistoryEntry.js +0 -2
- package/script/types/FocusedApp.d.ts +0 -8
- package/script/types/FocusedApp.d.ts.map +0 -1
- /package/esm/types/{FocusedApp.js → WegItemSubtype.js} +0 -0
- /package/script/types/{FocusedApp.js → WegItemSubtype.js} +0 -0
|
@@ -21,8 +21,8 @@ export declare enum SeelenCommand {
|
|
|
21
21
|
GetAutoStartStatus = "get_auto_start_status",
|
|
22
22
|
StateGetThemes = "state_get_themes",
|
|
23
23
|
StateGetWegItems = "state_get_weg_items",
|
|
24
|
-
StateGetToolbarItems = "state_get_toolbar_items",
|
|
25
24
|
StateWriteWegItems = "state_write_weg_items",
|
|
25
|
+
StateGetToolbarItems = "state_get_toolbar_items",
|
|
26
26
|
StateGetSettings = "state_get_settings",
|
|
27
27
|
StateWriteSettings = "state_write_settings",
|
|
28
28
|
StateGetDefaultSettings = "state_get_default_settings",
|
|
@@ -35,9 +35,7 @@ export declare enum SeelenCommand {
|
|
|
35
35
|
StateGetWidgets = "state_get_widgets",
|
|
36
36
|
StateGetIconPacks = "state_get_icon_packs",
|
|
37
37
|
StateGetProfiles = "state_get_profiles",
|
|
38
|
-
|
|
39
|
-
GetApplicationHistory = "get_application_history",
|
|
40
|
-
SetApplicationHistoryLimit = "set_application_history_limit",
|
|
38
|
+
StateDeleteCachedIcons = "state_delete_cached_icons",
|
|
41
39
|
GetUser = "get_user",
|
|
42
40
|
GetUserFolderContent = "get_user_folder_content",
|
|
43
41
|
SetUserFolderLimit = "set_user_folder_limit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/handlers/commands.ts"],"names":[],"mappings":"AACA,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,SAAS,gBAAgB;IACzB,aAAa,oBAAoB;IACjC,QAAQ,cAAc;IACtB,UAAU,iBAAiB;IAC3B,oBAAoB,4BAA4B;IAChD,yBAAyB,iCAAiC;IAC1D,WAAW,kBAAkB;IAC7B,eAAe,sBAAsB;IACrC,eAAe,qBAAqB;IACpC,QAAQ,cAAc;IACtB,OAAO,aAAa;IACpB,kBAAkB,wBAAwB;IAC1C,eAAe,sBAAsB;IACrC,0BAA0B,kCAAkC;IAC5D,iBAAiB,2BAA2B;IAC5C,eAAe,sBAAsB;IACrC,kBAAkB,yBAAyB;IAC3C,YAAY,mBAAmB;IAC/B,kBAAkB,0BAA0B;IAC5C,cAAc,qBAAqB;IACnC,gBAAgB,wBAAwB;IACxC,oBAAoB,4BAA4B;IAChD,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/handlers/commands.ts"],"names":[],"mappings":"AACA,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,SAAS,gBAAgB;IACzB,aAAa,oBAAoB;IACjC,QAAQ,cAAc;IACtB,UAAU,iBAAiB;IAC3B,oBAAoB,4BAA4B;IAChD,yBAAyB,iCAAiC;IAC1D,WAAW,kBAAkB;IAC7B,eAAe,s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sBAAsB;IACrC,iBAAiB,wBAAwB;IACzC,gBAAgB,uBAAuB;IACvC,WAAW,iBAAiB;IAC5B,cAAc,oBAAoB;IAClC,kBAAkB,wBAAwB;IAC1C,qBAAqB,4BAA4B;CAClD"}
|
package/esm/handlers/commands.js
CHANGED
|
@@ -23,8 +23,8 @@ export var SeelenCommand;
|
|
|
23
23
|
SeelenCommand["GetAutoStartStatus"] = "get_auto_start_status";
|
|
24
24
|
SeelenCommand["StateGetThemes"] = "state_get_themes";
|
|
25
25
|
SeelenCommand["StateGetWegItems"] = "state_get_weg_items";
|
|
26
|
-
SeelenCommand["StateGetToolbarItems"] = "state_get_toolbar_items";
|
|
27
26
|
SeelenCommand["StateWriteWegItems"] = "state_write_weg_items";
|
|
27
|
+
SeelenCommand["StateGetToolbarItems"] = "state_get_toolbar_items";
|
|
28
28
|
SeelenCommand["StateGetSettings"] = "state_get_settings";
|
|
29
29
|
SeelenCommand["StateWriteSettings"] = "state_write_settings";
|
|
30
30
|
SeelenCommand["StateGetDefaultSettings"] = "state_get_default_settings";
|
|
@@ -37,9 +37,7 @@ export var SeelenCommand;
|
|
|
37
37
|
SeelenCommand["StateGetWidgets"] = "state_get_widgets";
|
|
38
38
|
SeelenCommand["StateGetIconPacks"] = "state_get_icon_packs";
|
|
39
39
|
SeelenCommand["StateGetProfiles"] = "state_get_profiles";
|
|
40
|
-
SeelenCommand["
|
|
41
|
-
SeelenCommand["GetApplicationHistory"] = "get_application_history";
|
|
42
|
-
SeelenCommand["SetApplicationHistoryLimit"] = "set_application_history_limit";
|
|
40
|
+
SeelenCommand["StateDeleteCachedIcons"] = "state_delete_cached_icons";
|
|
43
41
|
SeelenCommand["GetUser"] = "get_user";
|
|
44
42
|
SeelenCommand["GetUserFolderContent"] = "get_user_folder_content";
|
|
45
43
|
SeelenCommand["SetUserFolderLimit"] = "set_user_folder_limit";
|
package/esm/handlers/events.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ export declare enum SeelenEvent {
|
|
|
2
2
|
WorkspacesChanged = "workspaces-changed",
|
|
3
3
|
ActiveWorkspaceChanged = "active-workspace-changed",
|
|
4
4
|
GlobalFocusChanged = "global-focus-changed",
|
|
5
|
-
GlobalHistoryChanged = "global-history-changed",
|
|
6
|
-
HistoryChangedOnMonitor = "global-history-changed-on-monitor",
|
|
7
5
|
GlobalMouseMove = "global-mouse-move",
|
|
8
6
|
HandleLayeredHitboxes = "handle-layered",
|
|
9
7
|
SystemMonitorsChanged = "system::monitors-changed",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/handlers/events.ts"],"names":[],"mappings":"AACA,oBAAY,WAAW;IACrB,iBAAiB,uBAAuB;IACxC,sBAAsB,6BAA6B;IACnD,kBAAkB,yBAAyB;IAC3C,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/handlers/events.ts"],"names":[],"mappings":"AACA,oBAAY,WAAW;IACrB,iBAAiB,uBAAuB;IACxC,sBAAsB,6BAA6B;IACnD,kBAAkB,yBAAyB;IAC3C,eAAe,sBAAsB;IACrC,qBAAqB,mBAAmB;IACxC,qBAAqB,6BAA6B;IAClD,sBAAsB,8BAA8B;IACpD,WAAW,iBAAiB;IAC5B,iBAAiB,wBAAwB;IACzC,aAAa,mBAAmB;IAChC,WAAW,iBAAiB;IAC5B,YAAY,kBAAkB;IAC9B,qBAAqB,6BAA6B;IAClD,eAAe,qBAAqB;IACpC,yBAAyB,gCAAgC;IACzD,kBAAkB,iBAAiB;IACnC,aAAa,kBAAkB;IAC/B,WAAW,iBAAiB;IAC5B,eAAe,qBAAqB;IACpC,aAAa,mBAAmB;IAChC,QAAQ,cAAc;IACtB,gBAAgB,kBAAkB;IAClC,YAAY,kBAAkB;IAC9B,kBAAkB,0BAA0B;IAC5C,gBAAgB,oBAAoB;IACpC,cAAc,kBAAkB;IAChC,aAAa,iBAAiB;IAC9B,oBAAoB,yBAAyB;IAC7C,OAAO,UAAU;IACjB,oBAAoB,yBAAyB;IAC7C,WAAW,eAAe;IAC1B,cAAc,kBAAkB;IAChC,cAAc,kBAAkB;IAChC,eAAe,sBAAsB;IACrC,WAAW,kBAAkB;IAC7B,sBAAsB,8BAA8B;IACpD,iBAAiB,yBAAyB;IAC1C,QAAQ,cAAc;IACtB,oBAAoB,qBAAqB;IACzC,oBAAoB,cAAc;IAClC,wBAAwB,kBAAkB;IAC1C,kBAAkB,WAAW;IAC7B,yBAAyB,oBAAoB;IAC7C,mBAAmB,YAAY;IAC/B,qBAAqB,eAAe;IACpC,mBAAmB,oBAAoB;IACvC,mBAAmB,oBAAoB;IACvC,oBAAoB,qBAAqB;CAC1C"}
|
package/esm/handlers/events.js
CHANGED
|
@@ -4,8 +4,6 @@ export var SeelenEvent;
|
|
|
4
4
|
SeelenEvent["WorkspacesChanged"] = "workspaces-changed";
|
|
5
5
|
SeelenEvent["ActiveWorkspaceChanged"] = "active-workspace-changed";
|
|
6
6
|
SeelenEvent["GlobalFocusChanged"] = "global-focus-changed";
|
|
7
|
-
SeelenEvent["GlobalHistoryChanged"] = "global-history-changed";
|
|
8
|
-
SeelenEvent["HistoryChangedOnMonitor"] = "global-history-changed-on-monitor";
|
|
9
7
|
SeelenEvent["GlobalMouseMove"] = "global-mouse-move";
|
|
10
8
|
SeelenEvent["HandleLayeredHitboxes"] = "handle-layered";
|
|
11
9
|
SeelenEvent["SystemMonitorsChanged"] = "system::monitors-changed";
|
package/esm/state/icon_pack.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IconPack } from '../types/mod.js';
|
|
2
2
|
import { List } from '../utils/List.js';
|
|
3
3
|
import { SeelenCommand, SeelenEvent } from '../handlers/mod.js';
|
|
4
|
+
import type { UnlistenFn } from '@tauri-apps/api/event';
|
|
4
5
|
export interface GetIconArgs {
|
|
5
6
|
path?: string | null;
|
|
6
7
|
umid?: string | null;
|
|
@@ -9,10 +10,12 @@ declare global {
|
|
|
9
10
|
interface ArgsByCommand {
|
|
10
11
|
[SeelenCommand.StateGetIconPacks]: null;
|
|
11
12
|
[SeelenCommand.GetIcon]: GetIconArgs;
|
|
13
|
+
[SeelenCommand.StateDeleteCachedIcons]: null;
|
|
12
14
|
}
|
|
13
15
|
interface ReturnByCommand {
|
|
14
16
|
[SeelenCommand.StateGetIconPacks]: IconPack[];
|
|
15
17
|
[SeelenCommand.GetIcon]: string | null;
|
|
18
|
+
[SeelenCommand.StateDeleteCachedIcons]: void;
|
|
16
19
|
}
|
|
17
20
|
interface PayloadByEvent {
|
|
18
21
|
[SeelenEvent.StateIconPacksChanged]: IconPack[];
|
|
@@ -20,21 +23,21 @@ declare global {
|
|
|
20
23
|
}
|
|
21
24
|
export declare class IconPackList extends List<IconPack> {
|
|
22
25
|
static readonly getAsync: () => Promise<InstanceType<typeof IconPackList>>;
|
|
23
|
-
static readonly onChange: (cb: (instance: IconPackList) => void) => Promise<
|
|
26
|
+
static readonly onChange: (cb: (instance: IconPackList) => void) => Promise<UnlistenFn>;
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
26
29
|
* Class helper to allow easy use of icon packs
|
|
27
30
|
*/
|
|
28
31
|
export declare class IconPackManager {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
protected iconPackPath: string;
|
|
33
|
+
protected _iconPacks: IconPackList;
|
|
34
|
+
protected _actives: string[];
|
|
32
35
|
private callbacks;
|
|
33
|
-
private
|
|
36
|
+
private unlistenerSettings;
|
|
37
|
+
private unlistenerIcons;
|
|
38
|
+
protected constructor(iconPackPath: string, _iconPacks: IconPackList, _actives: string[]);
|
|
34
39
|
get iconPacks(): IconPackList;
|
|
35
|
-
private set iconPacks(value);
|
|
36
40
|
get actives(): string[];
|
|
37
|
-
private set actives(value);
|
|
38
41
|
/**
|
|
39
42
|
* Creates an instance of IconPackManager. This intance will be updated when
|
|
40
43
|
* the list of icon packs or the settings changes, so just having one global instance is enough.
|
|
@@ -43,31 +46,95 @@ export declare class IconPackManager {
|
|
|
43
46
|
*/
|
|
44
47
|
static create(): Promise<IconPackManager>;
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* Registers a callback to be invoked when the list of active icon packs changes.
|
|
50
|
+
* This method also sets up listeners to detect changes in the icon pack list and
|
|
51
|
+
* the active icon packs settings. If no callbacks are registered beforehand, the
|
|
52
|
+
* listeners are initialized. When no callbacks remain registered, the listeners are stopped.
|
|
53
|
+
*
|
|
54
|
+
* @param {() => void} cb - The callback to be invoked when the list of active icon packs changes.
|
|
55
|
+
* This callback takes no arguments and returns no value.
|
|
56
|
+
* @returns {Promise<UnlistenFn>} A promise that resolves to an `UnlistenFn` function. When invoked,
|
|
57
|
+
* this function unregisters the callback and stops listening for changes
|
|
58
|
+
* if no other callbacks are registered.
|
|
47
59
|
*
|
|
48
|
-
* @param cb The callback to be called when the list of icon packs changes
|
|
49
60
|
* @example
|
|
50
61
|
* const manager = await IconPackManager.create();
|
|
51
|
-
* manager.onChange(() => {
|
|
62
|
+
* const unlisten = await manager.onChange(() => {
|
|
52
63
|
* console.log("Icon packs changed: ", manager.actives);
|
|
53
64
|
* });
|
|
65
|
+
*
|
|
66
|
+
* // Later, to stop listening for changes:
|
|
67
|
+
* unlisten();
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* - The `this` context inside the callback refers to the `IconPackManager` instance, provided the callback
|
|
71
|
+
* is not rebound to another context (e.g., using `bind`, `call`, or `apply`).
|
|
72
|
+
* - If the callback is defined as an arrow function, `this` will be lexically bound to the surrounding context.
|
|
73
|
+
* - If the callback is a regular function, ensure it is bound correctly to avoid `this` being `undefined` (in strict mode)
|
|
74
|
+
* or the global object (in non-strict mode).
|
|
75
|
+
*
|
|
76
|
+
* @see {@link IconPackManager} for the class this method belongs to.
|
|
77
|
+
* @see {@link UnlistenFn} for the type of the function returned by this method.
|
|
78
|
+
*/
|
|
79
|
+
onChange(cb: () => void): Promise<UnlistenFn>;
|
|
80
|
+
/**
|
|
81
|
+
* Returns the icon path for an app or file. If no icon is available, returns `null`.
|
|
82
|
+
*
|
|
83
|
+
* The search for icons follows this priority order:
|
|
84
|
+
* 1. UMID (App User Model Id)
|
|
85
|
+
* 2. Full path or filename (for executable files like .exe or .lnk)
|
|
86
|
+
* 3. File extension (for non-executable files like .png, .jpg, .txt)
|
|
87
|
+
*
|
|
88
|
+
* Icon packs are searched in the order of their priority. An icon from a higher-priority pack
|
|
89
|
+
* will override an icon from a lower-priority pack, even if the latter matches the search criteria.
|
|
90
|
+
*
|
|
91
|
+
* @param {Object} args - Arguments for retrieving the icon path.
|
|
92
|
+
* @param {string} [args.path] - The full path to the app or file.
|
|
93
|
+
* @param {string} [args.umid] - The UMID of the app.
|
|
94
|
+
* @returns {string | null} - The path to the icon, or `null` if no icon is found.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* // Example 1: Get icon by full path
|
|
98
|
+
* const iconPath = instance.getIconPath({
|
|
99
|
+
* path: "C:\\Program Files\\Steam\\steam.exe"
|
|
100
|
+
* });
|
|
101
|
+
*
|
|
102
|
+
* // Example 2: Get icon by UMID
|
|
103
|
+
* const iconPath = instance.getIconPath({
|
|
104
|
+
* umid: "Seelen.SeelenUI_p6yyn03m1894e!App"
|
|
105
|
+
* });
|
|
54
106
|
*/
|
|
55
|
-
|
|
107
|
+
getIconPath({ path, umid }: GetIconArgs): string | null;
|
|
56
108
|
/**
|
|
57
|
-
*
|
|
109
|
+
* Returns the icon Url/Src for an app or file. If no icon is available, returns `null`.
|
|
110
|
+
*
|
|
111
|
+
* The search for icons follows this priority order:
|
|
112
|
+
* 1. UMID (App User Model Id)
|
|
113
|
+
* 2. Full path or filename (for executable files like .exe or .lnk)
|
|
114
|
+
* 3. File extension (for non-executable files like .png, .jpg, .txt)
|
|
115
|
+
*
|
|
116
|
+
* Icon packs are searched in the order of their priority. An icon from a higher-priority pack
|
|
117
|
+
* will override an icon from a lower-priority pack, even if the latter matches the search criteria.
|
|
118
|
+
*
|
|
119
|
+
* @param {Object} args - Arguments for retrieving the icon path.
|
|
120
|
+
* @param {string} [args.path] - The full path to the app or file.
|
|
121
|
+
* @param {string} [args.umid] - The UMID of the app.
|
|
122
|
+
* @returns {string | null} - The path to the icon, or `null` if no icon is found.
|
|
58
123
|
*
|
|
59
|
-
* @param filePath The path to the app could be umid, full path.
|
|
60
124
|
* @example
|
|
61
|
-
*
|
|
125
|
+
* // Example 1: Get icon by full path
|
|
126
|
+
* const iconSrc = instance.getIconPath({
|
|
62
127
|
* path: "C:\\Program Files\\Steam\\steam.exe"
|
|
63
128
|
* });
|
|
64
|
-
*
|
|
129
|
+
*
|
|
130
|
+
* // Example 2: Get icon by UMID
|
|
131
|
+
* const iconSrc = instance.getIconPath({
|
|
65
132
|
* umid: "Seelen.SeelenUI_p6yyn03m1894e!App"
|
|
66
133
|
* });
|
|
67
134
|
*/
|
|
68
135
|
getIcon({ path, umid }: GetIconArgs): string | null;
|
|
69
136
|
/**
|
|
70
|
-
* Return the icon Path for an app or file, in case of no icon available will return `null
|
|
137
|
+
* Return the icon Path for an app or file, in case of no icon available will return `null`.\
|
|
71
138
|
* This method doesn't take in care icon packs, just extracts the inherited icon into system's icon pack.
|
|
72
139
|
*
|
|
73
140
|
* @param filePath The path to the app could be umid o full path
|
|
@@ -80,5 +147,10 @@ export declare class IconPackManager {
|
|
|
80
147
|
* });
|
|
81
148
|
*/
|
|
82
149
|
static extractIcon(obj: GetIconArgs): Promise<string | null>;
|
|
150
|
+
/**
|
|
151
|
+
* This will delete all stored icons on the system icon pack.\
|
|
152
|
+
* All icons should be regenerated after calling this method.
|
|
153
|
+
*/
|
|
154
|
+
static clearCachedIcons(): Promise<void>;
|
|
83
155
|
}
|
|
84
156
|
//# sourceMappingURL=icon_pack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_pack.d.ts","sourceRoot":"","sources":["../../src/state/icon_pack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ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AAC,QAAQ,gEAAkE;CAC3F;AAED;;GAEG;AACH,qBAAa,eAAe;IAMxB,SAAS,CAAC,YAAY,EAAE,MAAM;IAC9B,SAAS,CAAC,UAAU,EAAE,YAAY;IAClC,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE;IAP9B,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,kBAAkB,CAA2B;IACrD,OAAO,CAAC,eAAe,CAA2B;IAElD,SAAS,aACG,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,MAAM,EAAE;IAG9B,IAAW,SAAS,IAAI,YAAY,CAEnC;IAED,IAAW,OAAO,IAAI,MAAM,EAAE,CAE7B;IAED;;;;;OAKG;WACiB,MAAM,IAAI,OAAO,CAAC,eAAe,CAAC;IAUtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACU,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC;IAqB1D;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACI,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI;IAkE9D;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACI,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI;IAK1D;;;;;;;;;;;;OAYG;WACW,WAAW,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAInE;;;OAGG;WACW,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhD"}
|
package/esm/state/icon_pack.js
CHANGED
|
@@ -16,6 +16,8 @@ export class IconPackManager {
|
|
|
16
16
|
_iconPacks;
|
|
17
17
|
_actives;
|
|
18
18
|
callbacks = new Set();
|
|
19
|
+
unlistenerSettings = null;
|
|
20
|
+
unlistenerIcons = null;
|
|
19
21
|
constructor(iconPackPath, _iconPacks, _actives) {
|
|
20
22
|
this.iconPackPath = iconPackPath;
|
|
21
23
|
this._iconPacks = _iconPacks;
|
|
@@ -24,17 +26,9 @@ export class IconPackManager {
|
|
|
24
26
|
get iconPacks() {
|
|
25
27
|
return this._iconPacks;
|
|
26
28
|
}
|
|
27
|
-
set iconPacks(packs) {
|
|
28
|
-
this._iconPacks = packs;
|
|
29
|
-
this.callbacks.forEach((cb) => cb());
|
|
30
|
-
}
|
|
31
29
|
get actives() {
|
|
32
30
|
return this._actives;
|
|
33
31
|
}
|
|
34
|
-
set actives(actives) {
|
|
35
|
-
this._actives = actives;
|
|
36
|
-
this.callbacks.forEach((cb) => cb());
|
|
37
|
-
}
|
|
38
32
|
/**
|
|
39
33
|
* Creates an instance of IconPackManager. This intance will be updated when
|
|
40
34
|
* the list of icon packs or the settings changes, so just having one global instance is enough.
|
|
@@ -42,65 +36,176 @@ export class IconPackManager {
|
|
|
42
36
|
* @returns A new instance of IconPackManager
|
|
43
37
|
*/
|
|
44
38
|
static async create() {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
manager.iconPacks = list;
|
|
48
|
-
});
|
|
49
|
-
Settings.onChange((settings) => {
|
|
50
|
-
manager.actives = settings.inner.iconPacks;
|
|
51
|
-
});
|
|
52
|
-
return manager;
|
|
39
|
+
const instance = new IconPackManager(await path.resolve(await path.appDataDir(), 'icons'), await IconPackList.getAsync(), (await Settings.getAsync()).inner.iconPacks);
|
|
40
|
+
return instance;
|
|
53
41
|
}
|
|
54
42
|
/**
|
|
55
|
-
*
|
|
43
|
+
* Registers a callback to be invoked when the list of active icon packs changes.
|
|
44
|
+
* This method also sets up listeners to detect changes in the icon pack list and
|
|
45
|
+
* the active icon packs settings. If no callbacks are registered beforehand, the
|
|
46
|
+
* listeners are initialized. When no callbacks remain registered, the listeners are stopped.
|
|
47
|
+
*
|
|
48
|
+
* @param {() => void} cb - The callback to be invoked when the list of active icon packs changes.
|
|
49
|
+
* This callback takes no arguments and returns no value.
|
|
50
|
+
* @returns {Promise<UnlistenFn>} A promise that resolves to an `UnlistenFn` function. When invoked,
|
|
51
|
+
* this function unregisters the callback and stops listening for changes
|
|
52
|
+
* if no other callbacks are registered.
|
|
56
53
|
*
|
|
57
|
-
* @param cb The callback to be called when the list of icon packs changes
|
|
58
54
|
* @example
|
|
59
55
|
* const manager = await IconPackManager.create();
|
|
60
|
-
* manager.onChange(() => {
|
|
56
|
+
* const unlisten = await manager.onChange(() => {
|
|
61
57
|
* console.log("Icon packs changed: ", manager.actives);
|
|
62
58
|
* });
|
|
59
|
+
*
|
|
60
|
+
* // Later, to stop listening for changes:
|
|
61
|
+
* unlisten();
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* - The `this` context inside the callback refers to the `IconPackManager` instance, provided the callback
|
|
65
|
+
* is not rebound to another context (e.g., using `bind`, `call`, or `apply`).
|
|
66
|
+
* - If the callback is defined as an arrow function, `this` will be lexically bound to the surrounding context.
|
|
67
|
+
* - If the callback is a regular function, ensure it is bound correctly to avoid `this` being `undefined` (in strict mode)
|
|
68
|
+
* or the global object (in non-strict mode).
|
|
69
|
+
*
|
|
70
|
+
* @see {@link IconPackManager} for the class this method belongs to.
|
|
71
|
+
* @see {@link UnlistenFn} for the type of the function returned by this method.
|
|
63
72
|
*/
|
|
64
|
-
onChange(cb) {
|
|
73
|
+
async onChange(cb) {
|
|
65
74
|
this.callbacks.add(cb);
|
|
75
|
+
if (!this.unlistenerIcons && !this.unlistenerSettings) {
|
|
76
|
+
this.unlistenerIcons = await IconPackList.onChange((list) => {
|
|
77
|
+
this._iconPacks = list;
|
|
78
|
+
this.callbacks.forEach((cb) => cb());
|
|
79
|
+
});
|
|
80
|
+
this.unlistenerSettings = await Settings.onChange((settings) => {
|
|
81
|
+
this._actives = settings.inner.iconPacks;
|
|
82
|
+
this.callbacks.forEach((cb) => cb());
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return () => {
|
|
86
|
+
this.callbacks.delete(cb);
|
|
87
|
+
if (this.callbacks.size === 0) {
|
|
88
|
+
this.unlistenerIcons?.();
|
|
89
|
+
this.unlistenerSettings?.();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
66
92
|
}
|
|
67
93
|
/**
|
|
68
|
-
*
|
|
94
|
+
* Returns the icon path for an app or file. If no icon is available, returns `null`.
|
|
95
|
+
*
|
|
96
|
+
* The search for icons follows this priority order:
|
|
97
|
+
* 1. UMID (App User Model Id)
|
|
98
|
+
* 2. Full path or filename (for executable files like .exe or .lnk)
|
|
99
|
+
* 3. File extension (for non-executable files like .png, .jpg, .txt)
|
|
100
|
+
*
|
|
101
|
+
* Icon packs are searched in the order of their priority. An icon from a higher-priority pack
|
|
102
|
+
* will override an icon from a lower-priority pack, even if the latter matches the search criteria.
|
|
103
|
+
*
|
|
104
|
+
* @param {Object} args - Arguments for retrieving the icon path.
|
|
105
|
+
* @param {string} [args.path] - The full path to the app or file.
|
|
106
|
+
* @param {string} [args.umid] - The UMID of the app.
|
|
107
|
+
* @returns {string | null} - The path to the icon, or `null` if no icon is found.
|
|
69
108
|
*
|
|
70
|
-
* @param filePath The path to the app could be umid, full path.
|
|
71
109
|
* @example
|
|
72
|
-
*
|
|
110
|
+
* // Example 1: Get icon by full path
|
|
111
|
+
* const iconPath = instance.getIconPath({
|
|
73
112
|
* path: "C:\\Program Files\\Steam\\steam.exe"
|
|
74
113
|
* });
|
|
75
|
-
*
|
|
114
|
+
*
|
|
115
|
+
* // Example 2: Get icon by UMID
|
|
116
|
+
* const iconPath = instance.getIconPath({
|
|
76
117
|
* umid: "Seelen.SeelenUI_p6yyn03m1894e!App"
|
|
77
118
|
* });
|
|
78
119
|
*/
|
|
79
|
-
|
|
120
|
+
getIconPath({ path, umid }) {
|
|
121
|
+
// If neither path nor UMID is provided, return null
|
|
80
122
|
if (!path && !umid) {
|
|
81
123
|
return null;
|
|
82
124
|
}
|
|
125
|
+
// Create an ordered list of icon packs based on their priority
|
|
126
|
+
const orderedPacks = [];
|
|
83
127
|
for (const active of this.actives.toReversed()) {
|
|
84
128
|
const pack = this._iconPacks.asArray().find((p) => p.metadata.filename === active);
|
|
85
|
-
if (
|
|
86
|
-
|
|
129
|
+
if (pack) {
|
|
130
|
+
orderedPacks.push(pack);
|
|
87
131
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
132
|
+
}
|
|
133
|
+
// Search by UMID first (highest priority)
|
|
134
|
+
if (umid) {
|
|
135
|
+
for (const pack of orderedPacks) {
|
|
136
|
+
const subPath = pack.apps[umid];
|
|
137
|
+
if (subPath) {
|
|
138
|
+
return `${this.iconPackPath}\\${pack.metadata.filename}\\${subPath}`;
|
|
139
|
+
}
|
|
91
140
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
141
|
+
}
|
|
142
|
+
// If no UMID is provided, search by path
|
|
143
|
+
if (!path) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
const lowercasedPath = path.toLowerCase();
|
|
147
|
+
const isExecutable = lowercasedPath.endsWith('.exe') || lowercasedPath.endsWith('.lnk');
|
|
148
|
+
// For non-executable files, search by file extension
|
|
149
|
+
if (!isExecutable) {
|
|
150
|
+
const extension = lowercasedPath.split('.').pop();
|
|
151
|
+
if (!extension) {
|
|
152
|
+
return null;
|
|
95
153
|
}
|
|
96
|
-
|
|
97
|
-
|
|
154
|
+
for (const pack of orderedPacks) {
|
|
155
|
+
const subPath = pack.files[extension];
|
|
156
|
+
if (subPath) {
|
|
157
|
+
return `${this.iconPackPath}\\${pack.metadata.filename}\\${subPath}`;
|
|
158
|
+
}
|
|
98
159
|
}
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
// For executable files, search by full path or filename
|
|
163
|
+
const filename = path.split(/[/\\]/g).pop();
|
|
164
|
+
if (!filename) {
|
|
165
|
+
return null;
|
|
99
166
|
}
|
|
167
|
+
for (const pack of orderedPacks) {
|
|
168
|
+
const subPath = pack.apps[path] || pack.apps[filename];
|
|
169
|
+
if (subPath) {
|
|
170
|
+
return `${this.iconPackPath}\\${pack.metadata.filename}\\${subPath}`;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// If no icon is found in any icon pack, return null
|
|
100
174
|
return null;
|
|
101
175
|
}
|
|
102
176
|
/**
|
|
103
|
-
*
|
|
177
|
+
* Returns the icon Url/Src for an app or file. If no icon is available, returns `null`.
|
|
178
|
+
*
|
|
179
|
+
* The search for icons follows this priority order:
|
|
180
|
+
* 1. UMID (App User Model Id)
|
|
181
|
+
* 2. Full path or filename (for executable files like .exe or .lnk)
|
|
182
|
+
* 3. File extension (for non-executable files like .png, .jpg, .txt)
|
|
183
|
+
*
|
|
184
|
+
* Icon packs are searched in the order of their priority. An icon from a higher-priority pack
|
|
185
|
+
* will override an icon from a lower-priority pack, even if the latter matches the search criteria.
|
|
186
|
+
*
|
|
187
|
+
* @param {Object} args - Arguments for retrieving the icon path.
|
|
188
|
+
* @param {string} [args.path] - The full path to the app or file.
|
|
189
|
+
* @param {string} [args.umid] - The UMID of the app.
|
|
190
|
+
* @returns {string | null} - The path to the icon, or `null` if no icon is found.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* // Example 1: Get icon by full path
|
|
194
|
+
* const iconSrc = instance.getIconPath({
|
|
195
|
+
* path: "C:\\Program Files\\Steam\\steam.exe"
|
|
196
|
+
* });
|
|
197
|
+
*
|
|
198
|
+
* // Example 2: Get icon by UMID
|
|
199
|
+
* const iconSrc = instance.getIconPath({
|
|
200
|
+
* umid: "Seelen.SeelenUI_p6yyn03m1894e!App"
|
|
201
|
+
* });
|
|
202
|
+
*/
|
|
203
|
+
getIcon({ path, umid }) {
|
|
204
|
+
const iconPath = this.getIconPath({ path, umid });
|
|
205
|
+
return iconPath ? convertFileSrc(iconPath) : null;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Return the icon Path for an app or file, in case of no icon available will return `null`.\
|
|
104
209
|
* This method doesn't take in care icon packs, just extracts the inherited icon into system's icon pack.
|
|
105
210
|
*
|
|
106
211
|
* @param filePath The path to the app could be umid o full path
|
|
@@ -115,4 +220,11 @@ export class IconPackManager {
|
|
|
115
220
|
static extractIcon(obj) {
|
|
116
221
|
return invoke(SeelenCommand.GetIcon, obj);
|
|
117
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* This will delete all stored icons on the system icon pack.\
|
|
225
|
+
* All icons should be regenerated after calling this method.
|
|
226
|
+
*/
|
|
227
|
+
static clearCachedIcons() {
|
|
228
|
+
return invoke(SeelenCommand.StateDeleteCachedIcons);
|
|
229
|
+
}
|
|
118
230
|
}
|
package/esm/state/widget.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import type { Widget, WidgetId } from '../types/mod.js';
|
|
|
2
2
|
import { SeelenCommand, SeelenEvent } from '../handlers/mod.js';
|
|
3
3
|
import { List } from '../utils/List.js';
|
|
4
4
|
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
__TAURI_INTERNALS__?: unknown;
|
|
7
|
+
}
|
|
5
8
|
interface ArgsByCommand {
|
|
6
9
|
[SeelenCommand.StateGetWidgets]: null;
|
|
7
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../src/state/widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAKxC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,aAAa;QACrB,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC;KACvC;IACD,UAAU,eAAe;QACvB,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;KAC3C;IACD,UAAU,cAAc;QACtB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Ae,CAAC,EAAE,MAAM,EAAE,CAAC;KAC3C;IACD,UAAU,cAAc;QACtB,CAAC,WAAW,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC7C;CACF;AAED,eAAO,MAAM,iBAAiB,EAAE,QAAwB,CAAC;AACzD,eAAO,MAAM,qBAAqB,EAAE,QAAkC,CAAC;AACvE,eAAO,MAAM,2BAA2B,EAAE,QAAmC,CAAC;AAC9E,eAAO,MAAM,sBAAsB,EAAE,QAA6B,CAAC;AACnE,eAAO,MAAM,kBAAkB,EAAE,QAAsC,CAAC;AAExE,qBAAa,UAAW,SAAQ,IAAI,CAAC,MAAM,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,QAAQ,iDAA8D;IACtF,MAAM,CAAC,QAAQ,CAAC,QAAQ,8FAAgE;CACzF;AAED,UAAU,iBAAiB;IACzB,EAAE,EAAE,QAAQ,CAAC;IACb,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC1C;AAmBD,mEAAmE;AACnE,wBAAgB,gBAAgB,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAa9D"}
|
package/esm/state/widget.js
CHANGED
|
@@ -29,7 +29,7 @@ function _getCurrentWidget() {
|
|
|
29
29
|
}
|
|
30
30
|
/** If called on backend context, will return an empty structure */
|
|
31
31
|
export function getCurrentWidget() {
|
|
32
|
-
if (!globalThis.window) {
|
|
32
|
+
if (!globalThis.window || !globalThis.window.__TAURI_INTERNALS__) {
|
|
33
33
|
return {
|
|
34
34
|
id: '',
|
|
35
35
|
label: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/system_state/mod.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/system_state/mod.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
package/esm/system_state/mod.js
CHANGED
package/esm/types/IconPack.d.ts
CHANGED
|
@@ -5,11 +5,20 @@ export type IconPack = {
|
|
|
5
5
|
metadata: ResourceMetadata;
|
|
6
6
|
/**
|
|
7
7
|
* Key can be user model id, filename or a full path.
|
|
8
|
+
* In case of path this should be an executable or a lnk file, otherwise use `files`.
|
|
8
9
|
*
|
|
9
10
|
* Value is the path to the icon relative to the icon pack folder.
|
|
10
11
|
*/
|
|
11
12
|
apps: {
|
|
12
13
|
[key in string]?: string;
|
|
13
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Intended to store file icons by extension
|
|
17
|
+
*
|
|
18
|
+
* Key is the extension, value is the relative path to the icon
|
|
19
|
+
*/
|
|
20
|
+
files: {
|
|
21
|
+
[key in string]?: string;
|
|
22
|
+
};
|
|
14
23
|
};
|
|
15
24
|
//# sourceMappingURL=IconPack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconPack.d.ts","sourceRoot":"","sources":["../../src/types/IconPack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpE;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"IconPack.d.ts","sourceRoot":"","sources":["../../src/types/IconPack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpE;;;;;OAKG;IACH,IAAI,EAAE;SAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM;KAAE,CAAC;IACnC;;;;OAIG;IACH,KAAK,EAAE;SAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM;KAAE,CAAC;CAAE,CAAC"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import type { WegAppGroupItem } from "./WegAppGroupItem.js";
|
|
2
|
+
import type { WegItemSubtype } from "./WegItemSubtype.js";
|
|
2
3
|
export type PinnedWegItemData = {
|
|
3
4
|
/**
|
|
4
5
|
* internal UUID to differentiate items
|
|
5
6
|
*/
|
|
6
7
|
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* Subtype of the item (mandatory, but is optional for backward compatibility)
|
|
10
|
+
*/
|
|
11
|
+
subtype: WegItemSubtype;
|
|
7
12
|
/**
|
|
8
13
|
* Application user model id.
|
|
9
14
|
*/
|
|
10
15
|
umid: string | null;
|
|
11
16
|
/**
|
|
12
|
-
*
|
|
17
|
+
* path to file, forder or program.
|
|
13
18
|
*/
|
|
14
19
|
path: string;
|
|
15
20
|
/**
|
|
@@ -17,13 +22,13 @@ export type PinnedWegItemData = {
|
|
|
17
22
|
*/
|
|
18
23
|
relaunchCommand: string;
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
25
|
+
* path where ejecute the relaunch command
|
|
21
26
|
*/
|
|
22
|
-
|
|
27
|
+
relaunchIn: string | null;
|
|
23
28
|
/**
|
|
24
|
-
*
|
|
29
|
+
* display name of the item
|
|
25
30
|
*/
|
|
26
|
-
|
|
31
|
+
displayName: string;
|
|
27
32
|
/**
|
|
28
33
|
* Window handles in the app group, in case of pinned file/dir always will be empty
|
|
29
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinnedWegItemData.d.ts","sourceRoot":"","sources":["../../src/types/PinnedWegItemData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"PinnedWegItemData.d.ts","sourceRoot":"","sources":["../../src/types/PinnedWegItemData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IAChC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WegItemSubtype.d.ts","sourceRoot":"","sources":["../../src/types/WegItemSubtype.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,eAAe,CAAC"}
|