defuss-desktop 0.0.4 → 0.0.6
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 +12 -12
- package/dist/index.cjs +628 -119
- package/dist/index.d.cts +75 -4
- package/dist/index.d.mts +75 -4
- package/dist/index.mjs +627 -122
- package/dist/internet-explorer-CAgm9-7A.mjs +35 -0
- package/dist/internet-explorer-CajUFG-6.cjs +37 -0
- package/dist/notepad-Cwg2fv8c.mjs +20 -0
- package/dist/notepad-D2pcJRhu.cjs +22 -0
- package/dist/scss/_apps.scss +75 -0
- package/dist/scss/_desktop-icons.scss +89 -0
- package/dist/scss/_taskbar.scss +32 -4
- package/dist/scss/_window.scss +75 -2
- package/dist/scss/index.scss +2 -0
- package/package.json +5 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import * as defuss from 'defuss';
|
|
2
|
-
import { Props, CallChainImpl, Dequery
|
|
2
|
+
import { Props, Ref, CallChainImpl, Dequery } from 'defuss';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface DesktopProps extends Props<HTMLDivElement> {
|
|
5
|
+
ref: Ref<HTMLDivElement>;
|
|
6
|
+
}
|
|
7
|
+
declare function Desktop({ ref }: DesktopProps): JSX.Element;
|
|
5
8
|
|
|
6
9
|
interface ButtonProps extends Props<HTMLButtonElement> {
|
|
7
10
|
onClick?: () => void;
|
|
8
11
|
disabled?: boolean;
|
|
12
|
+
ref?: Ref<HTMLButtonElement>;
|
|
9
13
|
}
|
|
10
14
|
declare function Button({ onClick, disabled, children, ref, }: ButtonProps): JSX.Element;
|
|
11
15
|
|
|
12
16
|
interface LogonScreenProps extends Props<HTMLDivElement> {
|
|
17
|
+
ref: Ref<HTMLDivElement>;
|
|
13
18
|
cDriveBasePath?: string;
|
|
14
19
|
showGuestUser?: boolean;
|
|
15
20
|
onTurnOffComputer?: () => void;
|
|
@@ -28,9 +33,28 @@ interface DefussAppConfig {
|
|
|
28
33
|
main: (app: DefussApp, ...args: any[]) => void;
|
|
29
34
|
argv?: any[];
|
|
30
35
|
}
|
|
36
|
+
type AppMainFn = (params: {
|
|
37
|
+
app: DefussApp;
|
|
38
|
+
container: HTMLElement;
|
|
39
|
+
}) => void | Promise<void>;
|
|
40
|
+
interface AppBundleModule {
|
|
41
|
+
main: AppMainFn;
|
|
42
|
+
}
|
|
43
|
+
interface AppBundle {
|
|
44
|
+
executable: string;
|
|
45
|
+
displayName: string;
|
|
46
|
+
icon: string;
|
|
47
|
+
width?: number;
|
|
48
|
+
height?: number;
|
|
49
|
+
entry?: string;
|
|
50
|
+
load?: () => Promise<AppBundleModule>;
|
|
51
|
+
main?: AppMainFn;
|
|
52
|
+
}
|
|
31
53
|
declare class DefussApp {
|
|
32
54
|
config: DefussAppConfig;
|
|
55
|
+
bundle?: AppBundle;
|
|
33
56
|
constructor(config: DefussAppConfig);
|
|
57
|
+
static fromBundle(bundle: AppBundle): DefussApp;
|
|
34
58
|
run(): void;
|
|
35
59
|
}
|
|
36
60
|
|
|
@@ -86,6 +110,7 @@ declare class DesktopManager {
|
|
|
86
110
|
declare const desktopManager: DesktopManager;
|
|
87
111
|
|
|
88
112
|
interface ShellProps extends Props<HTMLDivElement> {
|
|
113
|
+
ref: Ref<HTMLDivElement>;
|
|
89
114
|
desktopConfig: CreateDesktopOptions;
|
|
90
115
|
}
|
|
91
116
|
declare function Shell({ ref, desktopConfig, }: ShellProps): JSX.Element;
|
|
@@ -96,6 +121,11 @@ declare const StartButton: () => JSX.Element;
|
|
|
96
121
|
|
|
97
122
|
declare const StartMenu: () => JSX.Element;
|
|
98
123
|
|
|
124
|
+
interface DesktopIconProps extends Props {
|
|
125
|
+
app: DefussApp;
|
|
126
|
+
}
|
|
127
|
+
declare function DesktopIcon({ app }: DesktopIconProps): JSX.Element;
|
|
128
|
+
|
|
99
129
|
declare class DequeryWithWindowManager<NT> extends CallChainImpl<NT, DequeryWithWindowManager<NT> & Dequery<NT>> {
|
|
100
130
|
createDesktopApp(options: DefussAppConfig): this & Dequery<NT>;
|
|
101
131
|
createDesktopAppIcon(options: DesktopIconConfig): this & Dequery<NT>;
|
|
@@ -165,6 +195,9 @@ interface WindowState {
|
|
|
165
195
|
declare const defaultWindowOptions: CreateWindowOptions;
|
|
166
196
|
declare class WindowManager {
|
|
167
197
|
windows: Array<WindowState>;
|
|
198
|
+
private listeners;
|
|
199
|
+
subscribe(listener: () => void): () => void;
|
|
200
|
+
private emitChanged;
|
|
168
201
|
constructor();
|
|
169
202
|
onDesktopResized(dimensions: Dimensions2D): void;
|
|
170
203
|
getActiveWindow(): WindowState | undefined;
|
|
@@ -211,6 +244,13 @@ declare class DesktopShellManager {
|
|
|
211
244
|
apps: DefussApp[];
|
|
212
245
|
constructor(apps?: DefussApp[]);
|
|
213
246
|
addApp(app: DefussApp): void;
|
|
247
|
+
registerAppBundle(bundle: AppBundle): Promise<DefussApp>;
|
|
248
|
+
/** Find a registered app by executable name (e.g. "notepad.exe") */
|
|
249
|
+
findApp(executable: string): DefussApp | undefined;
|
|
250
|
+
/** Run an app by executable name */
|
|
251
|
+
runApp(executable: string): void;
|
|
252
|
+
/** Launch a bundled app by creating a window and passing the container */
|
|
253
|
+
launchApp(app: DefussApp): void;
|
|
214
254
|
}
|
|
215
255
|
declare const desktopShell: DesktopShellManager;
|
|
216
256
|
|
|
@@ -230,5 +270,36 @@ declare class SoundManager {
|
|
|
230
270
|
}
|
|
231
271
|
declare const soundManager: SoundManager;
|
|
232
272
|
|
|
233
|
-
|
|
234
|
-
|
|
273
|
+
interface SelectionModelOptions {
|
|
274
|
+
desktopElement: HTMLElement;
|
|
275
|
+
iconsContainer: HTMLElement;
|
|
276
|
+
}
|
|
277
|
+
declare class SelectionModel {
|
|
278
|
+
options: SelectionModelOptions;
|
|
279
|
+
selectionDiv: HTMLDivElement | null;
|
|
280
|
+
startX: number;
|
|
281
|
+
startY: number;
|
|
282
|
+
debounceTimer: number | null;
|
|
283
|
+
isSelecting: boolean;
|
|
284
|
+
debounceDelay: number;
|
|
285
|
+
constructor(options: SelectionModelOptions);
|
|
286
|
+
init(): void;
|
|
287
|
+
destroy(): void;
|
|
288
|
+
onMouseDown: (e: MouseEvent) => void;
|
|
289
|
+
onMouseMove: (e: MouseEvent) => void;
|
|
290
|
+
onMouseUp: () => void;
|
|
291
|
+
onMouseLeave: () => void;
|
|
292
|
+
endSelection: () => void;
|
|
293
|
+
createSelectionDiv(): void;
|
|
294
|
+
updateSelectionDiv(endX: number, endY: number): void;
|
|
295
|
+
selectIcons(): void;
|
|
296
|
+
removeSelectionDiv(): void;
|
|
297
|
+
clearDebounce(): void;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
declare const notepadAppBundle: AppBundle;
|
|
301
|
+
|
|
302
|
+
declare const internetExplorerAppBundle: AppBundle;
|
|
303
|
+
|
|
304
|
+
export { $, Button, DefussApp, DefussDesktopAppIcon, DequeryWithWindowManager, Desktop, DesktopIcon, DesktopManager, DesktopShellManager, LogonScreen, SelectionModel, Shell, SoundManager, StartButton, StartMenu, Taskbar, TaskbarManager, WindowManager, defaultDesktopOptions, defaultSystemSoundFilePaths, defaultTaskbarOptions, defaultWindowOptions, desktopManager, desktopShell, internetExplorerAppBundle, notepadAppBundle, soundManager, taskbarManager, windowManager };
|
|
305
|
+
export type { AppBundle, AppBundleModule, AppMainFn, ButtonProps, CreateDesktopOptions, CreateTaskbarOptions, CreateWindowOptions, DefussAppConfig, DesktopIconConfig, DesktopIconProps, DesktopProps, DesktopResizeCallback, DesktopShellState, DesktopShellTheme, DesktopState, LoginForm, LogonScreenProps, SelectionModelOptions, ShellProps, TaskbarState, WindowState };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import * as defuss from 'defuss';
|
|
2
|
-
import { Props, CallChainImpl, Dequery
|
|
2
|
+
import { Props, Ref, CallChainImpl, Dequery } from 'defuss';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface DesktopProps extends Props<HTMLDivElement> {
|
|
5
|
+
ref: Ref<HTMLDivElement>;
|
|
6
|
+
}
|
|
7
|
+
declare function Desktop({ ref }: DesktopProps): JSX.Element;
|
|
5
8
|
|
|
6
9
|
interface ButtonProps extends Props<HTMLButtonElement> {
|
|
7
10
|
onClick?: () => void;
|
|
8
11
|
disabled?: boolean;
|
|
12
|
+
ref?: Ref<HTMLButtonElement>;
|
|
9
13
|
}
|
|
10
14
|
declare function Button({ onClick, disabled, children, ref, }: ButtonProps): JSX.Element;
|
|
11
15
|
|
|
12
16
|
interface LogonScreenProps extends Props<HTMLDivElement> {
|
|
17
|
+
ref: Ref<HTMLDivElement>;
|
|
13
18
|
cDriveBasePath?: string;
|
|
14
19
|
showGuestUser?: boolean;
|
|
15
20
|
onTurnOffComputer?: () => void;
|
|
@@ -28,9 +33,28 @@ interface DefussAppConfig {
|
|
|
28
33
|
main: (app: DefussApp, ...args: any[]) => void;
|
|
29
34
|
argv?: any[];
|
|
30
35
|
}
|
|
36
|
+
type AppMainFn = (params: {
|
|
37
|
+
app: DefussApp;
|
|
38
|
+
container: HTMLElement;
|
|
39
|
+
}) => void | Promise<void>;
|
|
40
|
+
interface AppBundleModule {
|
|
41
|
+
main: AppMainFn;
|
|
42
|
+
}
|
|
43
|
+
interface AppBundle {
|
|
44
|
+
executable: string;
|
|
45
|
+
displayName: string;
|
|
46
|
+
icon: string;
|
|
47
|
+
width?: number;
|
|
48
|
+
height?: number;
|
|
49
|
+
entry?: string;
|
|
50
|
+
load?: () => Promise<AppBundleModule>;
|
|
51
|
+
main?: AppMainFn;
|
|
52
|
+
}
|
|
31
53
|
declare class DefussApp {
|
|
32
54
|
config: DefussAppConfig;
|
|
55
|
+
bundle?: AppBundle;
|
|
33
56
|
constructor(config: DefussAppConfig);
|
|
57
|
+
static fromBundle(bundle: AppBundle): DefussApp;
|
|
34
58
|
run(): void;
|
|
35
59
|
}
|
|
36
60
|
|
|
@@ -86,6 +110,7 @@ declare class DesktopManager {
|
|
|
86
110
|
declare const desktopManager: DesktopManager;
|
|
87
111
|
|
|
88
112
|
interface ShellProps extends Props<HTMLDivElement> {
|
|
113
|
+
ref: Ref<HTMLDivElement>;
|
|
89
114
|
desktopConfig: CreateDesktopOptions;
|
|
90
115
|
}
|
|
91
116
|
declare function Shell({ ref, desktopConfig, }: ShellProps): JSX.Element;
|
|
@@ -96,6 +121,11 @@ declare const StartButton: () => JSX.Element;
|
|
|
96
121
|
|
|
97
122
|
declare const StartMenu: () => JSX.Element;
|
|
98
123
|
|
|
124
|
+
interface DesktopIconProps extends Props {
|
|
125
|
+
app: DefussApp;
|
|
126
|
+
}
|
|
127
|
+
declare function DesktopIcon({ app }: DesktopIconProps): JSX.Element;
|
|
128
|
+
|
|
99
129
|
declare class DequeryWithWindowManager<NT> extends CallChainImpl<NT, DequeryWithWindowManager<NT> & Dequery<NT>> {
|
|
100
130
|
createDesktopApp(options: DefussAppConfig): this & Dequery<NT>;
|
|
101
131
|
createDesktopAppIcon(options: DesktopIconConfig): this & Dequery<NT>;
|
|
@@ -165,6 +195,9 @@ interface WindowState {
|
|
|
165
195
|
declare const defaultWindowOptions: CreateWindowOptions;
|
|
166
196
|
declare class WindowManager {
|
|
167
197
|
windows: Array<WindowState>;
|
|
198
|
+
private listeners;
|
|
199
|
+
subscribe(listener: () => void): () => void;
|
|
200
|
+
private emitChanged;
|
|
168
201
|
constructor();
|
|
169
202
|
onDesktopResized(dimensions: Dimensions2D): void;
|
|
170
203
|
getActiveWindow(): WindowState | undefined;
|
|
@@ -211,6 +244,13 @@ declare class DesktopShellManager {
|
|
|
211
244
|
apps: DefussApp[];
|
|
212
245
|
constructor(apps?: DefussApp[]);
|
|
213
246
|
addApp(app: DefussApp): void;
|
|
247
|
+
registerAppBundle(bundle: AppBundle): Promise<DefussApp>;
|
|
248
|
+
/** Find a registered app by executable name (e.g. "notepad.exe") */
|
|
249
|
+
findApp(executable: string): DefussApp | undefined;
|
|
250
|
+
/** Run an app by executable name */
|
|
251
|
+
runApp(executable: string): void;
|
|
252
|
+
/** Launch a bundled app by creating a window and passing the container */
|
|
253
|
+
launchApp(app: DefussApp): void;
|
|
214
254
|
}
|
|
215
255
|
declare const desktopShell: DesktopShellManager;
|
|
216
256
|
|
|
@@ -230,5 +270,36 @@ declare class SoundManager {
|
|
|
230
270
|
}
|
|
231
271
|
declare const soundManager: SoundManager;
|
|
232
272
|
|
|
233
|
-
|
|
234
|
-
|
|
273
|
+
interface SelectionModelOptions {
|
|
274
|
+
desktopElement: HTMLElement;
|
|
275
|
+
iconsContainer: HTMLElement;
|
|
276
|
+
}
|
|
277
|
+
declare class SelectionModel {
|
|
278
|
+
options: SelectionModelOptions;
|
|
279
|
+
selectionDiv: HTMLDivElement | null;
|
|
280
|
+
startX: number;
|
|
281
|
+
startY: number;
|
|
282
|
+
debounceTimer: number | null;
|
|
283
|
+
isSelecting: boolean;
|
|
284
|
+
debounceDelay: number;
|
|
285
|
+
constructor(options: SelectionModelOptions);
|
|
286
|
+
init(): void;
|
|
287
|
+
destroy(): void;
|
|
288
|
+
onMouseDown: (e: MouseEvent) => void;
|
|
289
|
+
onMouseMove: (e: MouseEvent) => void;
|
|
290
|
+
onMouseUp: () => void;
|
|
291
|
+
onMouseLeave: () => void;
|
|
292
|
+
endSelection: () => void;
|
|
293
|
+
createSelectionDiv(): void;
|
|
294
|
+
updateSelectionDiv(endX: number, endY: number): void;
|
|
295
|
+
selectIcons(): void;
|
|
296
|
+
removeSelectionDiv(): void;
|
|
297
|
+
clearDebounce(): void;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
declare const notepadAppBundle: AppBundle;
|
|
301
|
+
|
|
302
|
+
declare const internetExplorerAppBundle: AppBundle;
|
|
303
|
+
|
|
304
|
+
export { $, Button, DefussApp, DefussDesktopAppIcon, DequeryWithWindowManager, Desktop, DesktopIcon, DesktopManager, DesktopShellManager, LogonScreen, SelectionModel, Shell, SoundManager, StartButton, StartMenu, Taskbar, TaskbarManager, WindowManager, defaultDesktopOptions, defaultSystemSoundFilePaths, defaultTaskbarOptions, defaultWindowOptions, desktopManager, desktopShell, internetExplorerAppBundle, notepadAppBundle, soundManager, taskbarManager, windowManager };
|
|
305
|
+
export type { AppBundle, AppBundleModule, AppMainFn, ButtonProps, CreateDesktopOptions, CreateTaskbarOptions, CreateWindowOptions, DefussAppConfig, DesktopIconConfig, DesktopIconProps, DesktopProps, DesktopResizeCallback, DesktopShellState, DesktopShellTheme, DesktopState, LoginForm, LogonScreenProps, SelectionModelOptions, ShellProps, TaskbarState, WindowState };
|