@interopio/iocd-cli 0.0.39 → 0.0.40
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 +780 -779
- package/dist/services/installer/electronForge.js +5 -3
- package/dist/services/installer/electronForge.js.map +1 -1
- package/dist/services/installer/macOS.helper.js +0 -1
- package/dist/services/installer/macOS.helper.js.map +1 -1
- package/dist/services/license.service.js +14 -14
- package/dist/templates/groups/apps/groups/.gitignore.template +23 -23
- package/dist/templates/groups/apps/groups/README.md +15 -15
- package/dist/templates/groups/apps/groups/config/web-group-dev.json +12 -12
- package/dist/templates/groups/apps/groups/index.html +17 -17
- package/dist/templates/groups/apps/groups/iocd.app.json +19 -19
- package/dist/templates/groups/apps/groups/package.json +25 -25
- package/dist/templates/groups/apps/groups/public/manifest.json +24 -24
- package/dist/templates/groups/apps/groups/public/robots.txt +3 -3
- package/dist/templates/groups/apps/groups/src/App.css +38 -38
- package/dist/templates/groups/apps/groups/src/App.tsx +11 -11
- package/dist/templates/groups/apps/groups/src/index.css +13 -13
- package/dist/templates/groups/apps/groups/src/index.tsx +19 -19
- package/dist/templates/groups/apps/groups/vite.config.ts +8 -8
- package/dist/templates/groups/template.json +12 -12
- package/dist/templates/ioconnect-desktop/.github/actions/setup-smctl/action.yml +121 -121
- package/dist/templates/ioconnect-desktop/.github/workflows/build.yml +395 -395
- package/dist/templates/ioconnect-desktop/.gitignore.template +15 -15
- package/dist/templates/ioconnect-desktop/README.md +780 -779
- package/dist/templates/ioconnect-desktop/config/forge.config.js +59 -59
- package/dist/templates/ioconnect-desktop/config/iocd.cli.config.json +16 -16
- package/dist/templates/ioconnect-desktop/config/mac-build/entitlements.mac.plist +44 -44
- package/dist/templates/ioconnect-desktop/config/win-build/template.nuspectemplate +32 -32
- package/dist/templates/ioconnect-desktop/modifications/base/iocd/config/system.json.merge +2 -2
- package/dist/templates/ioconnect-desktop/modifications/base/iocd/config/system.json.merge-autoUpdate +9 -9
- package/dist/templates/ioconnect-desktop/package.json +33 -33
- package/dist/templates/ioconnect-desktop/template.json +6 -6
- package/dist/templates/launchpad/apps/launchpad/.eslintrc.json +3 -3
- package/dist/templates/launchpad/apps/launchpad/.gitignore.template +1 -1
- package/dist/templates/launchpad/apps/launchpad/config/iocd.app.def.dev.json +56 -56
- package/dist/templates/launchpad/apps/launchpad/config/iocd.system.build.json +2 -2
- package/dist/templates/launchpad/apps/launchpad/config/iocd.system.dev.json +2 -2
- package/dist/templates/launchpad/apps/launchpad/index.html +16 -16
- package/dist/templates/launchpad/apps/launchpad/iocd.app.json +27 -27
- package/dist/templates/launchpad/apps/launchpad/package-lock.json +2778 -2778
- package/dist/templates/launchpad/apps/launchpad/package.json +21 -21
- package/dist/templates/launchpad/apps/launchpad/src/app/app.tsx +41 -41
- package/dist/templates/launchpad/apps/launchpad/src/app/constants.ts +27 -27
- package/dist/templates/launchpad/apps/launchpad/src/components/logo.tsx +11 -11
- package/dist/templates/launchpad/apps/launchpad/src/components/main-context-menu.tsx +161 -161
- package/dist/templates/launchpad/apps/launchpad/src/components/notifications-button.tsx +44 -44
- package/dist/templates/launchpad/apps/launchpad/src/main.tsx +6 -6
- package/dist/templates/launchpad/apps/launchpad/src/styles.css +16 -16
- package/dist/templates/launchpad/apps/launchpad/tsconfig.json +10 -10
- package/dist/templates/launchpad/apps/launchpad/vite.config.ts +13 -13
- package/dist/templates/launchpad/template.json +12 -12
- package/dist/templates/splash/apps/splash/assets/styles/style.css +39 -39
- package/dist/templates/splash/apps/splash/iocd.app.json +7 -7
- package/dist/templates/splash/apps/splash/script.js +53 -53
- package/dist/templates/splash/apps/splash/splash.html +25 -25
- package/dist/templates/splash/template.json +12 -12
- package/dist/templates/tests/template.json +8 -8
- package/dist/templates/tests/tests/package-lock.json +7289 -7289
- package/dist/templates/tests/tests/package.json +22 -22
- package/dist/templates/tests/tests/tests/sample.spec.ts +30 -30
- package/dist/templates/tests/tests/tsconfig.json +10 -10
- package/dist/templates/tests/tests/wdio.config.ts +32 -32
- package/dist/templates/workspaces/apps/workspaces/README.md +15 -15
- package/dist/templates/workspaces/apps/workspaces/config/workspaces-dev.json +20 -20
- package/dist/templates/workspaces/apps/workspaces/index.html +17 -17
- package/dist/templates/workspaces/apps/workspaces/iocd.app.json +19 -19
- package/dist/templates/workspaces/apps/workspaces/package.json +29 -29
- package/dist/templates/workspaces/apps/workspaces/public/manifest.json +25 -25
- package/dist/templates/workspaces/apps/workspaces/public/robots.txt +3 -3
- package/dist/templates/workspaces/apps/workspaces/src/App.css +38 -38
- package/dist/templates/workspaces/apps/workspaces/src/App.tsx +102 -102
- package/dist/templates/workspaces/apps/workspaces/src/index.css +3 -3
- package/dist/templates/workspaces/apps/workspaces/src/index.tsx +28 -28
- package/dist/templates/workspaces/apps/workspaces/src/logo.svg +7 -7
- package/dist/templates/workspaces/apps/workspaces/src/reportWebVitals.ts +15 -15
- package/dist/templates/workspaces/apps/workspaces/src/setupTests.ts +5 -5
- package/dist/templates/workspaces/apps/workspaces/vite.config.ts +8 -8
- package/dist/templates/workspaces/template.json +12 -12
- package/package.json +83 -83
- package/scripts/copy-assets.js +19 -19
- package/scripts/delete-dist.js +12 -12
- package/scripts/generate-schema.js +50 -50
- package/scripts/handle-gitignore-templates.js +157 -157
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dev-launchpad",
|
|
3
|
-
"version": "1.0.5",
|
|
4
|
-
"homepage": "./",
|
|
5
|
-
"private": true,
|
|
6
|
-
"scripts": {
|
|
7
|
-
"start": "vite",
|
|
8
|
-
"build": "vite build"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"@interopio/components-react": "^0.8.0",
|
|
12
|
-
"@interopio/home-ui-react": "^2.1.1",
|
|
13
|
-
"@interopio/react-hooks": "^4.1.1",
|
|
14
|
-
"@interopio/workspaces-ui-react": "^4.1.1"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@vitejs/plugin-react": "^5.0.2",
|
|
18
|
-
"vite": "^7.1.5",
|
|
19
|
-
"vite-plugin-environment": "^1.1.3"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dev-launchpad",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"homepage": "./",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "vite",
|
|
8
|
+
"build": "vite build"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@interopio/components-react": "^0.8.0",
|
|
12
|
+
"@interopio/home-ui-react": "^2.1.1",
|
|
13
|
+
"@interopio/react-hooks": "^4.1.1",
|
|
14
|
+
"@interopio/workspaces-ui-react": "^4.1.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@vitejs/plugin-react": "^5.0.2",
|
|
18
|
+
"vite": "^7.1.5",
|
|
19
|
+
"vite-plugin-environment": "^1.1.3"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { IOConnectProvider } from "@interopio/react-hooks";
|
|
2
|
-
import { LaunchpadBody, LaunchpadHeader, LaunchpadContentsContainer, PlatformPrefsProvider } from "@interopio/home-ui-react";
|
|
3
|
-
import { ioConfig } from "./constants";
|
|
4
|
-
import { ThemeProvider, IONotifications } from "@interopio/components-react";
|
|
5
|
-
import Logo from "../components/logo";
|
|
6
|
-
import NotificationsButton from "../components/notifications-button";
|
|
7
|
-
import MainContextMenu from "../components/main-context-menu";
|
|
8
|
-
import "@interopio/workspaces-ui-react/dist/styles/workspaces.css";
|
|
9
|
-
import "@interopio/home-ui-react/index.css";
|
|
10
|
-
|
|
11
|
-
export function App() {
|
|
12
|
-
const { NotificationsProvider } = IONotifications;
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<IOConnectProvider settings={ioConfig}>
|
|
16
|
-
<PlatformPrefsProvider>
|
|
17
|
-
<ThemeProvider>
|
|
18
|
-
<NotificationsProvider>
|
|
19
|
-
<LaunchpadContentsContainer
|
|
20
|
-
components={{
|
|
21
|
-
header: {
|
|
22
|
-
BeforeSearch: () => <Logo />,
|
|
23
|
-
AfterSearch: () => (
|
|
24
|
-
<>
|
|
25
|
-
<NotificationsButton />
|
|
26
|
-
<MainContextMenu />
|
|
27
|
-
</>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
<LaunchpadHeader />
|
|
33
|
-
<LaunchpadBody />
|
|
34
|
-
</LaunchpadContentsContainer>
|
|
35
|
-
</NotificationsProvider>
|
|
36
|
-
</ThemeProvider>
|
|
37
|
-
</PlatformPrefsProvider>
|
|
38
|
-
</IOConnectProvider>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
1
|
+
import { IOConnectProvider } from "@interopio/react-hooks";
|
|
2
|
+
import { LaunchpadBody, LaunchpadHeader, LaunchpadContentsContainer, PlatformPrefsProvider } from "@interopio/home-ui-react";
|
|
3
|
+
import { ioConfig } from "./constants";
|
|
4
|
+
import { ThemeProvider, IONotifications } from "@interopio/components-react";
|
|
5
|
+
import Logo from "../components/logo";
|
|
6
|
+
import NotificationsButton from "../components/notifications-button";
|
|
7
|
+
import MainContextMenu from "../components/main-context-menu";
|
|
8
|
+
import "@interopio/workspaces-ui-react/dist/styles/workspaces.css";
|
|
9
|
+
import "@interopio/home-ui-react/index.css";
|
|
10
|
+
|
|
11
|
+
export function App() {
|
|
12
|
+
const { NotificationsProvider } = IONotifications;
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<IOConnectProvider settings={ioConfig}>
|
|
16
|
+
<PlatformPrefsProvider>
|
|
17
|
+
<ThemeProvider>
|
|
18
|
+
<NotificationsProvider>
|
|
19
|
+
<LaunchpadContentsContainer
|
|
20
|
+
components={{
|
|
21
|
+
header: {
|
|
22
|
+
BeforeSearch: () => <Logo />,
|
|
23
|
+
AfterSearch: () => (
|
|
24
|
+
<>
|
|
25
|
+
<NotificationsButton />
|
|
26
|
+
<MainContextMenu />
|
|
27
|
+
</>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<LaunchpadHeader />
|
|
33
|
+
<LaunchpadBody />
|
|
34
|
+
</LaunchpadContentsContainer>
|
|
35
|
+
</NotificationsProvider>
|
|
36
|
+
</ThemeProvider>
|
|
37
|
+
</PlatformPrefsProvider>
|
|
38
|
+
</IOConnectProvider>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
42
|
export default App;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import IODesktop from "@interopio/desktop";
|
|
2
|
-
import IOSearch from "@interopio/search-api";
|
|
3
|
-
import IOWorkspaces from "@interopio/workspaces-api";
|
|
4
|
-
import { IOConnectInitSettings } from "@interopio/react-hooks";
|
|
5
|
-
|
|
6
|
-
export const ioConfig = {
|
|
7
|
-
desktop: {
|
|
8
|
-
factory: IODesktop,
|
|
9
|
-
config: {
|
|
10
|
-
gateway: {
|
|
11
|
-
logging: {
|
|
12
|
-
level: "warn"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
libraries: [IOWorkspaces, IOSearch],
|
|
16
|
-
appManager: "full",
|
|
17
|
-
layouts: "full",
|
|
18
|
-
activities: "trackAll",
|
|
19
|
-
channels: false,
|
|
20
|
-
metrics: false,
|
|
21
|
-
contexts: true,
|
|
22
|
-
systemLogger: {
|
|
23
|
-
level: "warn"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
} as IOConnectInitSettings;
|
|
1
|
+
import IODesktop from "@interopio/desktop";
|
|
2
|
+
import IOSearch from "@interopio/search-api";
|
|
3
|
+
import IOWorkspaces from "@interopio/workspaces-api";
|
|
4
|
+
import { IOConnectInitSettings } from "@interopio/react-hooks";
|
|
5
|
+
|
|
6
|
+
export const ioConfig = {
|
|
7
|
+
desktop: {
|
|
8
|
+
factory: IODesktop,
|
|
9
|
+
config: {
|
|
10
|
+
gateway: {
|
|
11
|
+
logging: {
|
|
12
|
+
level: "warn"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
libraries: [IOWorkspaces, IOSearch],
|
|
16
|
+
appManager: "full",
|
|
17
|
+
layouts: "full",
|
|
18
|
+
activities: "trackAll",
|
|
19
|
+
channels: false,
|
|
20
|
+
metrics: false,
|
|
21
|
+
contexts: true,
|
|
22
|
+
systemLogger: {
|
|
23
|
+
level: "warn"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} as IOConnectInitSettings;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ButtonIcon } from "@interopio/components-react";
|
|
2
|
-
|
|
3
|
-
function Logo() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="logo draggable">
|
|
6
|
-
<ButtonIcon variant="circle" icon="logo" size='32' />
|
|
7
|
-
</div>
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default Logo;
|
|
1
|
+
import { ButtonIcon } from "@interopio/components-react";
|
|
2
|
+
|
|
3
|
+
function Logo() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="logo draggable">
|
|
6
|
+
<ButtonIcon variant="circle" icon="logo" size='32' />
|
|
7
|
+
</div>
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default Logo;
|
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
import { useCallback, useContext, useMemo } from "react";
|
|
2
|
-
import { IOConnectDesktop } from "@interopio/desktop";
|
|
3
|
-
import { IOConnectContext } from "@interopio/react-hooks";
|
|
4
|
-
import { Dropdown, Icon, IconProps, Separator } from "@interopio/components-react";
|
|
5
|
-
|
|
6
|
-
const PLATFORM_UTILITY_PAGES = {
|
|
7
|
-
ABOUT: "about",
|
|
8
|
-
HOTKEYS: "hotkeys",
|
|
9
|
-
FEEDBACK: "feedback",
|
|
10
|
-
} as const;
|
|
11
|
-
|
|
12
|
-
const PLATFORM_APPS = {
|
|
13
|
-
DOWNLOAD_MANAGER: "io-connect-download-manager",
|
|
14
|
-
} as const;
|
|
15
|
-
|
|
16
|
-
type PageKey = keyof typeof PLATFORM_UTILITY_PAGES;
|
|
17
|
-
type PageName = typeof PLATFORM_UTILITY_PAGES[PageKey];
|
|
18
|
-
type AppKey = keyof typeof PLATFORM_APPS;
|
|
19
|
-
type AppName = typeof PLATFORM_APPS[AppKey];
|
|
20
|
-
|
|
21
|
-
function MainContextMenu() {
|
|
22
|
-
const io = useContext(IOConnectContext) as IOConnectDesktop.API;
|
|
23
|
-
|
|
24
|
-
const startPage = useCallback(async (pageName: PageName) => {
|
|
25
|
-
if (!io) {
|
|
26
|
-
console.warn("IOConnectContext not available");
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
await io.interop.invoke("T42.GD.Execute", {
|
|
32
|
-
command: "open-utility-page",
|
|
33
|
-
args: { name: pageName },
|
|
34
|
-
});
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.warn("Failed to open utility page", pageName, error);
|
|
37
|
-
}
|
|
38
|
-
}, [io]);
|
|
39
|
-
|
|
40
|
-
const startApp = useCallback(async (appName: AppName) => {
|
|
41
|
-
if (!io) {
|
|
42
|
-
console.warn("IOConnectContext not available");
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
const app = io.appManager.application(appName);
|
|
48
|
-
if (!app) {
|
|
49
|
-
throw new Error(`Cannot find app with name "${appName}"`);
|
|
50
|
-
}
|
|
51
|
-
await app.start();
|
|
52
|
-
} catch (error) {
|
|
53
|
-
console.warn("Failed to start app", appName, error);
|
|
54
|
-
}
|
|
55
|
-
}, [io]);
|
|
56
|
-
|
|
57
|
-
const openDownloads = useCallback(() => {
|
|
58
|
-
startApp(PLATFORM_APPS.DOWNLOAD_MANAGER);
|
|
59
|
-
}, [startApp]);
|
|
60
|
-
|
|
61
|
-
const openFeedback = useCallback(() => {
|
|
62
|
-
startPage(PLATFORM_UTILITY_PAGES.FEEDBACK);
|
|
63
|
-
}, [startPage]);
|
|
64
|
-
|
|
65
|
-
const openHotkeys = useCallback(() => {
|
|
66
|
-
startPage(PLATFORM_UTILITY_PAGES.HOTKEYS);
|
|
67
|
-
}, [startPage]);
|
|
68
|
-
|
|
69
|
-
const handleMinimize = useCallback(async () => {
|
|
70
|
-
if (!io) {
|
|
71
|
-
console.warn("IOConnectContext not available");
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const myWindow = io.windows.my();
|
|
76
|
-
|
|
77
|
-
if (!myWindow) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
try {
|
|
82
|
-
await myWindow.minimize();
|
|
83
|
-
} catch (error) {
|
|
84
|
-
console.error("Failed to minimize window", error);
|
|
85
|
-
}
|
|
86
|
-
}, [io]);
|
|
87
|
-
|
|
88
|
-
const handleRestart = useCallback(async () => {
|
|
89
|
-
if (!io) {
|
|
90
|
-
console.warn("IOConnectContext not available");
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
await io.appManager.restart({
|
|
96
|
-
autoSave: true,
|
|
97
|
-
showDialog: true,
|
|
98
|
-
});
|
|
99
|
-
} catch (error) {
|
|
100
|
-
console.error("Failed to restart io.Connect Desktop", error);
|
|
101
|
-
}
|
|
102
|
-
}, [io]);
|
|
103
|
-
|
|
104
|
-
const handleShutdown = useCallback(async () => {
|
|
105
|
-
if (!io) {
|
|
106
|
-
console.warn("IOConnectContext not available");
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
try {
|
|
111
|
-
await io.appManager.exit({
|
|
112
|
-
autoSave: true,
|
|
113
|
-
showDialog: true,
|
|
114
|
-
});
|
|
115
|
-
} catch (error) {
|
|
116
|
-
console.error("Failed to shutdown io.Connect Desktop", error);
|
|
117
|
-
}
|
|
118
|
-
}, [io]);
|
|
119
|
-
|
|
120
|
-
const menuItems = useMemo(() => [
|
|
121
|
-
{ label: "Pin Launchpad", icon: "pin", onClick: () => null, disabled: true },
|
|
122
|
-
{ label: "Dock Launchpad", onClick: () => null, disabled: true },
|
|
123
|
-
{ separator: true },
|
|
124
|
-
{ label: "Platform Preferences", icon: "cog", onClick: () => null, disabled: true },
|
|
125
|
-
{ label: "Notification Settings", icon: "bell", onClick: () => null, disabled: true },
|
|
126
|
-
{ label: "Intent Resolver Settings", icon: "list-ul", onClick: () => null, disabled: true },
|
|
127
|
-
{ separator: true },
|
|
128
|
-
{ label: "Profile", icon: "user", onClick: () => null, disabled: true },
|
|
129
|
-
{ separator: true },
|
|
130
|
-
{ label: "Downloads", onClick: openDownloads },
|
|
131
|
-
{ separator: true },
|
|
132
|
-
{ label: "Feedback", icon: "feedback", onClick: openFeedback },
|
|
133
|
-
{ label: "Keyboard Shortcuts", icon: "keyboard", onClick: openHotkeys },
|
|
134
|
-
{ separator: true },
|
|
135
|
-
{ label: "Minimize", icon: "minimize-down", onClick: handleMinimize },
|
|
136
|
-
{ label: "Restart", icon: "rotate-right", onClick: handleRestart },
|
|
137
|
-
{ label: "Shut Down", icon: "power-off", onClick: handleShutdown },
|
|
138
|
-
], [openDownloads, openFeedback, openHotkeys, handleMinimize, handleRestart, handleShutdown]);
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<div className="launchpad-header-actions">
|
|
142
|
-
<Dropdown>
|
|
143
|
-
<Dropdown.ButtonIcon variant='circle' icon="ellipsis-vertical" title='More' />
|
|
144
|
-
<Dropdown.Content>
|
|
145
|
-
<Dropdown.List>
|
|
146
|
-
{ menuItems.map((item, idx) =>
|
|
147
|
-
item.separator ? (
|
|
148
|
-
<Separator key={`sep-${idx}`} />
|
|
149
|
-
) : (
|
|
150
|
-
<Dropdown.Item key={item.label} prepend={<Icon variant={item.icon as IconProps["variant"]} />} onClick={item.onClick} disabled={item.disabled}>
|
|
151
|
-
{item.label}
|
|
152
|
-
</Dropdown.Item>
|
|
153
|
-
)
|
|
154
|
-
)}
|
|
155
|
-
</Dropdown.List>
|
|
156
|
-
</Dropdown.Content>
|
|
157
|
-
</Dropdown>
|
|
158
|
-
</div>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
1
|
+
import { useCallback, useContext, useMemo } from "react";
|
|
2
|
+
import { IOConnectDesktop } from "@interopio/desktop";
|
|
3
|
+
import { IOConnectContext } from "@interopio/react-hooks";
|
|
4
|
+
import { Dropdown, Icon, IconProps, Separator } from "@interopio/components-react";
|
|
5
|
+
|
|
6
|
+
const PLATFORM_UTILITY_PAGES = {
|
|
7
|
+
ABOUT: "about",
|
|
8
|
+
HOTKEYS: "hotkeys",
|
|
9
|
+
FEEDBACK: "feedback",
|
|
10
|
+
} as const;
|
|
11
|
+
|
|
12
|
+
const PLATFORM_APPS = {
|
|
13
|
+
DOWNLOAD_MANAGER: "io-connect-download-manager",
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
type PageKey = keyof typeof PLATFORM_UTILITY_PAGES;
|
|
17
|
+
type PageName = typeof PLATFORM_UTILITY_PAGES[PageKey];
|
|
18
|
+
type AppKey = keyof typeof PLATFORM_APPS;
|
|
19
|
+
type AppName = typeof PLATFORM_APPS[AppKey];
|
|
20
|
+
|
|
21
|
+
function MainContextMenu() {
|
|
22
|
+
const io = useContext(IOConnectContext) as IOConnectDesktop.API;
|
|
23
|
+
|
|
24
|
+
const startPage = useCallback(async (pageName: PageName) => {
|
|
25
|
+
if (!io) {
|
|
26
|
+
console.warn("IOConnectContext not available");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
await io.interop.invoke("T42.GD.Execute", {
|
|
32
|
+
command: "open-utility-page",
|
|
33
|
+
args: { name: pageName },
|
|
34
|
+
});
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.warn("Failed to open utility page", pageName, error);
|
|
37
|
+
}
|
|
38
|
+
}, [io]);
|
|
39
|
+
|
|
40
|
+
const startApp = useCallback(async (appName: AppName) => {
|
|
41
|
+
if (!io) {
|
|
42
|
+
console.warn("IOConnectContext not available");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
const app = io.appManager.application(appName);
|
|
48
|
+
if (!app) {
|
|
49
|
+
throw new Error(`Cannot find app with name "${appName}"`);
|
|
50
|
+
}
|
|
51
|
+
await app.start();
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.warn("Failed to start app", appName, error);
|
|
54
|
+
}
|
|
55
|
+
}, [io]);
|
|
56
|
+
|
|
57
|
+
const openDownloads = useCallback(() => {
|
|
58
|
+
startApp(PLATFORM_APPS.DOWNLOAD_MANAGER);
|
|
59
|
+
}, [startApp]);
|
|
60
|
+
|
|
61
|
+
const openFeedback = useCallback(() => {
|
|
62
|
+
startPage(PLATFORM_UTILITY_PAGES.FEEDBACK);
|
|
63
|
+
}, [startPage]);
|
|
64
|
+
|
|
65
|
+
const openHotkeys = useCallback(() => {
|
|
66
|
+
startPage(PLATFORM_UTILITY_PAGES.HOTKEYS);
|
|
67
|
+
}, [startPage]);
|
|
68
|
+
|
|
69
|
+
const handleMinimize = useCallback(async () => {
|
|
70
|
+
if (!io) {
|
|
71
|
+
console.warn("IOConnectContext not available");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const myWindow = io.windows.my();
|
|
76
|
+
|
|
77
|
+
if (!myWindow) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
await myWindow.minimize();
|
|
83
|
+
} catch (error) {
|
|
84
|
+
console.error("Failed to minimize window", error);
|
|
85
|
+
}
|
|
86
|
+
}, [io]);
|
|
87
|
+
|
|
88
|
+
const handleRestart = useCallback(async () => {
|
|
89
|
+
if (!io) {
|
|
90
|
+
console.warn("IOConnectContext not available");
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
await io.appManager.restart({
|
|
96
|
+
autoSave: true,
|
|
97
|
+
showDialog: true,
|
|
98
|
+
});
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.error("Failed to restart io.Connect Desktop", error);
|
|
101
|
+
}
|
|
102
|
+
}, [io]);
|
|
103
|
+
|
|
104
|
+
const handleShutdown = useCallback(async () => {
|
|
105
|
+
if (!io) {
|
|
106
|
+
console.warn("IOConnectContext not available");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
await io.appManager.exit({
|
|
112
|
+
autoSave: true,
|
|
113
|
+
showDialog: true,
|
|
114
|
+
});
|
|
115
|
+
} catch (error) {
|
|
116
|
+
console.error("Failed to shutdown io.Connect Desktop", error);
|
|
117
|
+
}
|
|
118
|
+
}, [io]);
|
|
119
|
+
|
|
120
|
+
const menuItems = useMemo(() => [
|
|
121
|
+
{ label: "Pin Launchpad", icon: "pin", onClick: () => null, disabled: true },
|
|
122
|
+
{ label: "Dock Launchpad", onClick: () => null, disabled: true },
|
|
123
|
+
{ separator: true },
|
|
124
|
+
{ label: "Platform Preferences", icon: "cog", onClick: () => null, disabled: true },
|
|
125
|
+
{ label: "Notification Settings", icon: "bell", onClick: () => null, disabled: true },
|
|
126
|
+
{ label: "Intent Resolver Settings", icon: "list-ul", onClick: () => null, disabled: true },
|
|
127
|
+
{ separator: true },
|
|
128
|
+
{ label: "Profile", icon: "user", onClick: () => null, disabled: true },
|
|
129
|
+
{ separator: true },
|
|
130
|
+
{ label: "Downloads", onClick: openDownloads },
|
|
131
|
+
{ separator: true },
|
|
132
|
+
{ label: "Feedback", icon: "feedback", onClick: openFeedback },
|
|
133
|
+
{ label: "Keyboard Shortcuts", icon: "keyboard", onClick: openHotkeys },
|
|
134
|
+
{ separator: true },
|
|
135
|
+
{ label: "Minimize", icon: "minimize-down", onClick: handleMinimize },
|
|
136
|
+
{ label: "Restart", icon: "rotate-right", onClick: handleRestart },
|
|
137
|
+
{ label: "Shut Down", icon: "power-off", onClick: handleShutdown },
|
|
138
|
+
], [openDownloads, openFeedback, openHotkeys, handleMinimize, handleRestart, handleShutdown]);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<div className="launchpad-header-actions">
|
|
142
|
+
<Dropdown>
|
|
143
|
+
<Dropdown.ButtonIcon variant='circle' icon="ellipsis-vertical" title='More' />
|
|
144
|
+
<Dropdown.Content>
|
|
145
|
+
<Dropdown.List>
|
|
146
|
+
{ menuItems.map((item, idx) =>
|
|
147
|
+
item.separator ? (
|
|
148
|
+
<Separator key={`sep-${idx}`} />
|
|
149
|
+
) : (
|
|
150
|
+
<Dropdown.Item key={item.label} prepend={<Icon variant={item.icon as IconProps["variant"]} />} onClick={item.onClick} disabled={item.disabled}>
|
|
151
|
+
{item.label}
|
|
152
|
+
</Dropdown.Item>
|
|
153
|
+
)
|
|
154
|
+
)}
|
|
155
|
+
</Dropdown.List>
|
|
156
|
+
</Dropdown.Content>
|
|
157
|
+
</Dropdown>
|
|
158
|
+
</div>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
162
|
export default MainContextMenu;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { useEffect, useContext, useCallback, useState } from "react";
|
|
2
|
-
import { IOConnectDesktop } from "@interopio/desktop";
|
|
3
|
-
import { IOConnectContext } from "@interopio/react-hooks";
|
|
4
|
-
import { Badge, ButtonIcon } from "@interopio/components-react";
|
|
5
|
-
|
|
6
|
-
function NotificationsButton() {
|
|
7
|
-
const io = useContext(IOConnectContext) as IOConnectDesktop.API;
|
|
8
|
-
const [notificationsCount, setNotificationsCount] = useState(0);
|
|
9
|
-
|
|
10
|
-
const openNotificationPanel = useCallback(async () => {
|
|
11
|
-
const isPanelVisible = await io.notifications.panel.isVisible();
|
|
12
|
-
|
|
13
|
-
if (isPanelVisible) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
await io.notifications.panel.show();
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.error("Failed to open notifications panel.", error);
|
|
21
|
-
}
|
|
22
|
-
}, []);
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const unCounterChanged = io.notifications.onCounterChanged(info => setNotificationsCount(info.count));
|
|
26
|
-
|
|
27
|
-
return () => {
|
|
28
|
-
unCounterChanged();
|
|
29
|
-
};
|
|
30
|
-
}, [io]);
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div className="launchpad-header-notifications-button">
|
|
34
|
-
{notificationsCount > 0 && (
|
|
35
|
-
<Badge variant="primary">
|
|
36
|
-
{notificationsCount > 99 ? "99+" : notificationsCount}
|
|
37
|
-
</Badge>
|
|
38
|
-
)}
|
|
39
|
-
<ButtonIcon variant="circle" icon="bell" size='32' onClick={openNotificationPanel} />
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default NotificationsButton;
|
|
1
|
+
import { useEffect, useContext, useCallback, useState } from "react";
|
|
2
|
+
import { IOConnectDesktop } from "@interopio/desktop";
|
|
3
|
+
import { IOConnectContext } from "@interopio/react-hooks";
|
|
4
|
+
import { Badge, ButtonIcon } from "@interopio/components-react";
|
|
5
|
+
|
|
6
|
+
function NotificationsButton() {
|
|
7
|
+
const io = useContext(IOConnectContext) as IOConnectDesktop.API;
|
|
8
|
+
const [notificationsCount, setNotificationsCount] = useState(0);
|
|
9
|
+
|
|
10
|
+
const openNotificationPanel = useCallback(async () => {
|
|
11
|
+
const isPanelVisible = await io.notifications.panel.isVisible();
|
|
12
|
+
|
|
13
|
+
if (isPanelVisible) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
await io.notifications.panel.show();
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error("Failed to open notifications panel.", error);
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const unCounterChanged = io.notifications.onCounterChanged(info => setNotificationsCount(info.count));
|
|
26
|
+
|
|
27
|
+
return () => {
|
|
28
|
+
unCounterChanged();
|
|
29
|
+
};
|
|
30
|
+
}, [io]);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className="launchpad-header-notifications-button">
|
|
34
|
+
{notificationsCount > 0 && (
|
|
35
|
+
<Badge variant="primary">
|
|
36
|
+
{notificationsCount > 99 ? "99+" : notificationsCount}
|
|
37
|
+
</Badge>
|
|
38
|
+
)}
|
|
39
|
+
<ButtonIcon variant="circle" icon="bell" size='32' onClick={openNotificationPanel} />
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default NotificationsButton;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as ReactDOM from "react-dom/client";
|
|
2
|
-
import App from "./app/app";
|
|
3
|
-
|
|
4
|
-
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
|
|
5
|
-
|
|
6
|
-
root.render(<App />);
|
|
1
|
+
import * as ReactDOM from "react-dom/client";
|
|
2
|
+
import App from "./app/app";
|
|
3
|
+
|
|
4
|
+
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
|
|
5
|
+
|
|
6
|
+
root.render(<App />);
|