@owdproject/core 3.0.0-alpha.2 → 3.0.0-alpha.4
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/LICENSE +3 -3
- package/README.md +4 -5
- package/index.ts +160 -1
- package/package.json +1 -1
- package/runtime/components/Core/Background/CoreBackground.vue +0 -1
- package/runtime/components/Core/Desktop/CoreDesktop.vue +2 -5
- package/runtime/components/Core/Window/CoreWindow.vue +0 -1
- package/runtime/composables/useAppEntries.ts +23 -8
- package/runtime/core/controllers/ApplicationController.ts +3 -4
- package/runtime/core/managers/ApplicationManager.ts +4 -19
- package/runtime/core/managers/DesktopManager.ts +0 -5
- package/runtime/stores/storeDesktopVolume.ts +2 -1
- package/runtime/utils/utilsApp.ts +21 -0
- package/runtime/utils/utilsDesktop.ts +1 -0
- package/types/owd.d.ts +37 -12
- package/module/index.ts +0 -144
package/LICENSE
CHANGED
|
@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
|
|
|
631
631
|
state the exclusion of warranty; and each file should have at least
|
|
632
632
|
the "copyright" line and a pointer to where the full notice is found.
|
|
633
633
|
|
|
634
|
-
Open Web Desktop -
|
|
635
|
-
Copyright (C) 2025
|
|
634
|
+
Open Web Desktop - Build Your Web OS
|
|
635
|
+
Copyright (C) 2025 github.com/owdproject
|
|
636
636
|
|
|
637
637
|
This program is free software: you can redistribute it and/or modify
|
|
638
638
|
it under the terms of the GNU General Public License as published by
|
|
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
|
|
|
652
652
|
If the program does terminal interaction, make it output a short
|
|
653
653
|
notice like this when it starts in an interactive mode:
|
|
654
654
|
|
|
655
|
-
Open Web Desktop Copyright (C) 2025 Open Web Desktop Team
|
|
655
|
+
Open Web Desktop ~ Copyright (C) 2025 ~ Open Web Desktop Team
|
|
656
656
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
657
657
|
This is free software, and you are welcome to redistribute it
|
|
658
658
|
under certain conditions; type `show c' for details.
|
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img width="160" height="160" alt="
|
|
2
|
+
<img width="160" height="160" alt="Open Web Desktop logo" src="https://avatars.githubusercontent.com/u/65117737?s=160&v=4" />
|
|
3
3
|
</p>
|
|
4
4
|
<h1 align="center">Open Web Desktop</h1>
|
|
5
5
|
<h3 align="center">
|
|
6
|
-
A framework for building web-based desktop experiences
|
|
6
|
+
A framework for building web-based desktop experiences
|
|
7
7
|
</h3>
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
@@ -106,8 +106,7 @@ If you'd like to contribute, here's how to set up your local development environ
|
|
|
106
106
|
|
|
107
107
|
**Cloning the Repository:**
|
|
108
108
|
|
|
109
|
-
To contribute, start by forking the Open Web Desktop client repository on GitHub.
|
|
110
|
-
|
|
109
|
+
To contribute, start by forking the Open Web Desktop client repository on GitHub.
|
|
111
110
|
Then, clone your fork using HTTPS or SSH:
|
|
112
111
|
|
|
113
112
|
```bash
|
|
@@ -137,4 +136,4 @@ Open Web Desktop is a vast project. The code has been totally rewritten and is n
|
|
|
137
136
|
|
|
138
137
|
### License
|
|
139
138
|
|
|
140
|
-
Open Web Desktop is
|
|
139
|
+
Open Web Desktop is released under the [GNU General Public License v3](LICENSE).
|
package/index.ts
CHANGED
|
@@ -1,8 +1,166 @@
|
|
|
1
|
+
import {defineNuxtModule, createResolver, addComponentsDir, addImportsDir, installModule} from '@nuxt/kit'
|
|
2
|
+
import {useDesktopManager} from './runtime/composables/useDesktopManager'
|
|
3
|
+
import pkg from './package.json'
|
|
4
|
+
|
|
5
|
+
export default defineNuxtModule({
|
|
6
|
+
meta: {
|
|
7
|
+
name: 'owd-core',
|
|
8
|
+
},
|
|
9
|
+
async setup(options, nuxt) {
|
|
10
|
+
const {resolve} = createResolver(import.meta.url)
|
|
11
|
+
const desktopManager = useDesktopManager()
|
|
12
|
+
|
|
13
|
+
await import(nuxt.options.rootDir + '/owd.config.ts')
|
|
14
|
+
|
|
15
|
+
// set core version to runtime variables
|
|
16
|
+
|
|
17
|
+
nuxt.options.runtimeConfig.public.coreVersion = pkg.version
|
|
18
|
+
|
|
19
|
+
// configure nuxt plugins
|
|
20
|
+
|
|
21
|
+
nuxt.options.primevue = nuxt.options.primevue || {};
|
|
22
|
+
nuxt.options.primevue.options = nuxt.options.primevue.options || {};
|
|
23
|
+
nuxt.options.primevue.options.theme = nuxt.options.primevue.options.theme || {};
|
|
24
|
+
|
|
25
|
+
{
|
|
26
|
+
|
|
27
|
+
// install open web desktop apps
|
|
28
|
+
|
|
29
|
+
if (desktopManager.config.apps) {
|
|
30
|
+
for (const appPath of desktopManager.config.apps) {
|
|
31
|
+
await installModule(appPath)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
|
|
39
|
+
// install tailwind
|
|
40
|
+
|
|
41
|
+
await installModule("@nuxtjs/tailwindcss", {
|
|
42
|
+
viewer: false,
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
{
|
|
48
|
+
|
|
49
|
+
// install primevue
|
|
50
|
+
|
|
51
|
+
nuxt.options.modules.push('@primevue/nuxt-module')
|
|
52
|
+
await installModule("@primevue/nuxt-module")
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
{
|
|
57
|
+
|
|
58
|
+
// install pinia
|
|
59
|
+
|
|
60
|
+
nuxt.options.modules.push('@pinia/nuxt')
|
|
61
|
+
await installModule("@pinia/nuxt")
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
{
|
|
66
|
+
|
|
67
|
+
// install @nuxt/fonts
|
|
68
|
+
|
|
69
|
+
nuxt.options.modules.push('@nuxt/fonts')
|
|
70
|
+
await installModule("@nuxt/fonts")
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
{
|
|
75
|
+
|
|
76
|
+
// install @nuxt/icon
|
|
77
|
+
|
|
78
|
+
nuxt.options.modules.push('@nuxt/icon')
|
|
79
|
+
await installModule("@nuxt/icon", {
|
|
80
|
+
clientBundle: {
|
|
81
|
+
scan: true,
|
|
82
|
+
sizeLimitKb: 256,
|
|
83
|
+
},
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
{
|
|
89
|
+
|
|
90
|
+
// install @vueuse/nuxt
|
|
91
|
+
|
|
92
|
+
nuxt.options.modules.push('@vueuse/nuxt')
|
|
93
|
+
await installModule("@vueuse/nuxt")
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
{
|
|
98
|
+
|
|
99
|
+
// install @nuxtjs/i18n
|
|
100
|
+
|
|
101
|
+
nuxt.options.modules.push('@nuxtjs/i18n')
|
|
102
|
+
await installModule("@nuxtjs/i18n")
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
{
|
|
107
|
+
|
|
108
|
+
// configure scss for vite
|
|
109
|
+
|
|
110
|
+
nuxt.hook('vite:extendConfig', (viteConfig) => {
|
|
111
|
+
viteConfig.css = viteConfig.css || {}
|
|
112
|
+
viteConfig.css.preprocessorOptions = viteConfig.css.preprocessorOptions || {}
|
|
113
|
+
viteConfig.css.preprocessorOptions.scss = {
|
|
114
|
+
api: 'modern-compiler',
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
{
|
|
121
|
+
|
|
122
|
+
// add css
|
|
123
|
+
|
|
124
|
+
nuxt.options.css.push('sanitize.css')
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
{
|
|
129
|
+
|
|
130
|
+
// add components
|
|
131
|
+
|
|
132
|
+
addComponentsDir({
|
|
133
|
+
path: resolve("./runtime/components"),
|
|
134
|
+
prefix: "",
|
|
135
|
+
global: true,
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
{
|
|
141
|
+
|
|
142
|
+
// install plugins
|
|
143
|
+
|
|
144
|
+
nuxt.options.plugins.push(
|
|
145
|
+
resolve('./runtime/plugins/resize.client.ts'),
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
addImportsDir(resolve('./runtime/composables'))
|
|
149
|
+
addImportsDir(resolve('./runtime/core'))
|
|
150
|
+
addImportsDir(resolve('./runtime/stores'))
|
|
151
|
+
addImportsDir(resolve('./runtime/utils'))
|
|
152
|
+
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
/*
|
|
1
158
|
export * from './runtime/composables/useAppEntries'
|
|
2
159
|
export * from './runtime/composables/useApplicationManager'
|
|
3
160
|
export * from './runtime/composables/useApplicationState'
|
|
4
161
|
export * from './runtime/composables/useDesktopManager'
|
|
5
162
|
export * from './runtime/composables/useTerminalManager'
|
|
163
|
+
export * from './runtime/utils/utilsApp'
|
|
6
164
|
export * from './runtime/utils/utilsCommon'
|
|
7
165
|
export * from './runtime/utils/utilsDebug'
|
|
8
166
|
export * from './runtime/utils/utilsDesktop'
|
|
@@ -11,4 +169,5 @@ export * from './runtime/utils/utilsWindow'
|
|
|
11
169
|
export * from './runtime/stores/storeDesktop'
|
|
12
170
|
export * from './runtime/stores/storeDesktopVolume'
|
|
13
171
|
export * from './runtime/stores/storeDesktopWindow'
|
|
14
|
-
export * from './runtime/stores/storeDesktopWorkspace'
|
|
172
|
+
export * from './runtime/stores/storeDesktopWorkspace'
|
|
173
|
+
*/
|
package/package.json
CHANGED
|
@@ -34,15 +34,12 @@ if (desktopStore.$persistedState) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// override desktop configurations
|
|
37
|
-
desktopManager.
|
|
37
|
+
desktopManager.setConfig({
|
|
38
38
|
windows: toRaw(props.windows),
|
|
39
|
-
systemBar: toRaw(props.systemBar),
|
|
39
|
+
systemBar: toRaw( props.systemBar),
|
|
40
40
|
dockBar: toRaw(props.dockBar),
|
|
41
41
|
})
|
|
42
42
|
|
|
43
|
-
// define apps and restore statuses
|
|
44
|
-
applicationManager.importApps()
|
|
45
|
-
|
|
46
43
|
// desktop resize
|
|
47
44
|
// todo move to composable
|
|
48
45
|
|
|
@@ -116,7 +116,6 @@ const classes = computed(() => {
|
|
|
116
116
|
:class="classes"
|
|
117
117
|
:width="windowController?.state.size?.width"
|
|
118
118
|
:height="windowController?.state.size?.height"
|
|
119
|
-
:min-width="windowController?.state.size?.minWidth"
|
|
120
119
|
:min-height="windowController?.state.size?.minHeight"
|
|
121
120
|
:max-width="windowController?.state.size?.maxWidth"
|
|
122
121
|
:max-height="windowController?.state.size?.maxHeight"
|
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
import {useApplicationManager} from './useApplicationManager'
|
|
2
2
|
import {computed} from "@vue/reactivity"
|
|
3
3
|
|
|
4
|
+
type SortBy = 'title' | 'category' | ((a: ApplicationEntryWithInherited, b: ApplicationEntryWithInherited) => number)
|
|
5
|
+
type Visibility = 'primary' | 'all' | ((entry: ApplicationEntryWithInherited) => boolean)
|
|
6
|
+
|
|
4
7
|
export function useAppEntries() {
|
|
5
8
|
const applicationManager = useApplicationManager()
|
|
6
9
|
|
|
7
|
-
const sortedAppEntries = function(
|
|
10
|
+
const sortedAppEntries = function(
|
|
11
|
+
sortBy: SortBy = 'title',
|
|
12
|
+
visibility: Visibility = 'primary'
|
|
13
|
+
): Ref<ApplicationEntryWithInherited[]> {
|
|
8
14
|
return computed(() => {
|
|
9
15
|
const currentEntries = [...applicationManager.appsEntries]
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
// filtering
|
|
18
|
+
const filtered = typeof visibility === 'function'
|
|
19
|
+
? currentEntries.filter(visibility)
|
|
20
|
+
: visibility === 'primary'
|
|
21
|
+
? currentEntries.filter(e => e.visibility !== 'secondary')
|
|
22
|
+
: currentEntries
|
|
23
|
+
|
|
24
|
+
// sorting
|
|
25
|
+
const sorted = typeof sortBy === 'function'
|
|
26
|
+
? filtered.sort(sortBy)
|
|
27
|
+
: sortBy === 'title'
|
|
28
|
+
? filtered.sort((a, b) => (a.title || '').localeCompare(b.title || ''))
|
|
29
|
+
: filtered.sort((a, b) => (a.category || '').localeCompare(b.category || ''))
|
|
30
|
+
|
|
31
|
+
return sorted
|
|
17
32
|
})
|
|
18
33
|
}
|
|
19
34
|
|
|
20
35
|
return { sortedAppEntries }
|
|
21
|
-
}
|
|
36
|
+
}
|
|
@@ -44,7 +44,7 @@ export class ApplicationController implements IApplicationController {
|
|
|
44
44
|
this.config.entries[this.config.provides.entry] as ApplicationEntry
|
|
45
45
|
)
|
|
46
46
|
|
|
47
|
-
debugLog(`${this.config.title} has been set as predefined app for "${this.config.provides}"`)
|
|
47
|
+
debugLog(`${this.config.title} has been set as predefined app for "${this.config.provides.name}"`)
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -189,7 +189,6 @@ export class ApplicationController implements IApplicationController {
|
|
|
189
189
|
// meta
|
|
190
190
|
|
|
191
191
|
get meta() {
|
|
192
|
-
console.log('META', this.id, this.store.meta)
|
|
193
192
|
return this.store.meta
|
|
194
193
|
}
|
|
195
194
|
|
|
@@ -203,7 +202,7 @@ export class ApplicationController implements IApplicationController {
|
|
|
203
202
|
|
|
204
203
|
// commands
|
|
205
204
|
|
|
206
|
-
async execCommand(
|
|
207
|
-
await this.applicationManager.execAppCommand(this.id,
|
|
205
|
+
async execCommand(command: string): Promise<CommandOutput | void> {
|
|
206
|
+
await this.applicationManager.execAppCommand(this.id, command)
|
|
208
207
|
}
|
|
209
208
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {Reactive} from "@vue/reactivity"
|
|
2
2
|
import {reactive, markRaw} from "@vue/reactivity"
|
|
3
3
|
import {ApplicationController} from "../controllers/ApplicationController";
|
|
4
|
+
import {normalizeApplicationConfig} from "../../utils/utilsApp"
|
|
4
5
|
import {debugLog} from "../../utils/utilsDebug"
|
|
5
6
|
|
|
6
7
|
export class ApplicationManager implements IApplicationManager {
|
|
@@ -11,17 +12,6 @@ export class ApplicationManager implements IApplicationManager {
|
|
|
11
12
|
constructor() {
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
/**
|
|
15
|
-
* Import applications on nuxt start
|
|
16
|
-
*/
|
|
17
|
-
public async importApps() {
|
|
18
|
-
const {owdConfig} = await import(`~~/owd.config`)
|
|
19
|
-
|
|
20
|
-
if (owdConfig && typeof owdConfig.loader === 'function') {
|
|
21
|
-
await owdConfig.loader()
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
15
|
/**
|
|
26
16
|
* Define new application
|
|
27
17
|
*
|
|
@@ -34,18 +24,12 @@ export class ApplicationManager implements IApplicationManager {
|
|
|
34
24
|
return this.apps.get(id)!;
|
|
35
25
|
}
|
|
36
26
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!config.category) config.category = 'other'
|
|
40
|
-
|
|
41
|
-
const applicationConfig = markRaw(config)
|
|
27
|
+
const normalizedConfig = normalizeApplicationConfig(config)
|
|
28
|
+
const applicationConfig = markRaw(normalizedConfig)
|
|
42
29
|
|
|
43
30
|
const applicationController: IApplicationController = new ApplicationController(id, applicationConfig)
|
|
44
|
-
|
|
45
|
-
// finalize application setup doing other async operations
|
|
46
31
|
await applicationController.initApplication()
|
|
47
32
|
|
|
48
|
-
// define application
|
|
49
33
|
this.apps.set(id, applicationController)
|
|
50
34
|
|
|
51
35
|
return applicationController
|
|
@@ -165,6 +149,7 @@ export class ApplicationManager implements IApplicationManager {
|
|
|
165
149
|
title: entry.title !== undefined ? entry.title : applicationController.config.title,
|
|
166
150
|
icon: entry.icon !== undefined ? entry.icon : applicationController.config.icon,
|
|
167
151
|
category: entry.category !== undefined ? entry.category : applicationController.config.category,
|
|
152
|
+
visibility: entry.visibility,
|
|
168
153
|
command: entry.command
|
|
169
154
|
})
|
|
170
155
|
}
|
|
@@ -13,11 +13,6 @@ export class DesktopManager {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
public setConfig(config: DesktopConfig) {
|
|
16
|
-
this.config = config
|
|
17
|
-
this.loadDefaultAppsFromConfig()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
public overrideConfig(config: Partial<DesktopConfig>) {
|
|
21
16
|
this.config = deepMerge(this.config, config) as DesktopConfig
|
|
22
17
|
this.loadDefaultAppsFromConfig()
|
|
23
18
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function normalizeApplicationConfig(config: ApplicationConfig): ApplicationConfig {
|
|
2
|
+
const normalizedEntries: Record<string, ApplicationEntry> = {}
|
|
3
|
+
|
|
4
|
+
for (const [key, entry] of Object.entries(config.entries)) {
|
|
5
|
+
normalizedEntries[key] = {
|
|
6
|
+
...entry,
|
|
7
|
+
title: entry.title ?? config.title,
|
|
8
|
+
icon: entry.icon ?? config.icon,
|
|
9
|
+
category: entry.category ?? config.category,
|
|
10
|
+
visibility: entry.visibility ?? 'primary',
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
...config,
|
|
16
|
+
version: config.version ?? 'unknown',
|
|
17
|
+
description: config.description ?? '',
|
|
18
|
+
category: config.category ?? 'other',
|
|
19
|
+
entries: normalizedEntries,
|
|
20
|
+
}
|
|
21
|
+
}
|
package/types/owd.d.ts
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
interface IApplicationManager {
|
|
2
2
|
apps: Map<string, IApplicationController>
|
|
3
|
-
appsRunning: Reactive<IApplicationController>
|
|
4
|
-
|
|
5
|
-
importApps()
|
|
6
3
|
|
|
7
4
|
get appsEntries(): Reactive<ApplicationEntry[]>
|
|
8
|
-
|
|
5
|
+
|
|
6
|
+
get appsRunning(): Reactive<IApplicationController[]>
|
|
7
|
+
|
|
8
|
+
get windowsOpened(): Reactive<IWindowController[]>
|
|
9
|
+
|
|
9
10
|
get appCategories(): string[]
|
|
11
|
+
|
|
10
12
|
get appsByCategory(): { [category: string]: IApplicationController[] }
|
|
11
13
|
|
|
12
14
|
defineApp(appId: string, config: ApplicationConfig): Promise<IApplicationController>
|
|
15
|
+
|
|
13
16
|
closeApp(id: string): void
|
|
14
17
|
|
|
18
|
+
launchAppEntry(appId: string, entry: string): Promise<IApplicationController | undefined>
|
|
15
19
|
execAppCommand(appId: string, command: string): Promise<IApplicationController | undefined>
|
|
16
20
|
|
|
17
21
|
isAppDefined(id: string): boolean
|
|
22
|
+
|
|
18
23
|
isAppRunning(id: string): boolean
|
|
19
24
|
}
|
|
20
25
|
|
|
@@ -36,8 +41,11 @@ interface ApplicationConfig {
|
|
|
36
41
|
commands?: { [key: string]: ApplicationCommand }
|
|
37
42
|
|
|
38
43
|
onReady?(app: IApplicationController): void | Promise<void>
|
|
44
|
+
|
|
39
45
|
onLaunch?(app: IApplicationController): void | Promise<void>
|
|
46
|
+
|
|
40
47
|
onRestore?(app: IApplicationController): void | Promise<void>
|
|
48
|
+
|
|
41
49
|
onClose?(app: IApplicationController): void | Promise<void>
|
|
42
50
|
}
|
|
43
51
|
|
|
@@ -48,17 +56,21 @@ interface ApplicationConfigProvide {
|
|
|
48
56
|
|
|
49
57
|
type IApplicationMeta = { [key: string]: any }
|
|
50
58
|
|
|
51
|
-
interface
|
|
59
|
+
interface sIApplicationController {
|
|
52
60
|
id: string
|
|
53
61
|
config: ApplicationConfig
|
|
62
|
+
|
|
54
63
|
get meta(): { [key: string]: any }
|
|
64
|
+
|
|
55
65
|
store: Pinia
|
|
56
66
|
windows: Reactive<Map<string, IWindowController>>
|
|
57
67
|
|
|
58
68
|
isRunning: boolean
|
|
69
|
+
|
|
59
70
|
setRunning(value: boolean): void
|
|
60
71
|
|
|
61
72
|
initApplication(): Promise<void>
|
|
73
|
+
|
|
62
74
|
restoreApplication(): Promise<boolean>
|
|
63
75
|
|
|
64
76
|
openWindow(model: string, windowStoredState?: WindowStoredState, meta?: {
|
|
@@ -66,8 +78,11 @@ interface IApplicationController {
|
|
|
66
78
|
})
|
|
67
79
|
|
|
68
80
|
closeWindow(windowId: string): void
|
|
81
|
+
|
|
69
82
|
closeAllWindows(): void
|
|
70
83
|
|
|
84
|
+
execCommand(command: string)
|
|
85
|
+
|
|
71
86
|
get windowsOpened(): Reactive<Map<string, IWindowController>>
|
|
72
87
|
}
|
|
73
88
|
|
|
@@ -78,11 +93,13 @@ interface IWindowController {
|
|
|
78
93
|
|
|
79
94
|
config: WindowConfig
|
|
80
95
|
override: WindowOverride
|
|
96
|
+
|
|
81
97
|
get state(): WindowState
|
|
82
98
|
|
|
83
99
|
// common
|
|
84
100
|
get title(): string
|
|
85
|
-
|
|
101
|
+
|
|
102
|
+
get icon(): string | undefined
|
|
86
103
|
|
|
87
104
|
// sizes
|
|
88
105
|
get width(): WindowSizeValue
|
|
@@ -139,7 +156,7 @@ interface IWindowController {
|
|
|
139
156
|
setWorkspace(workspaceId: string)
|
|
140
157
|
|
|
141
158
|
// override
|
|
142
|
-
setTitleOverride(title: string|undefined): void
|
|
159
|
+
setTitleOverride(title: string | undefined): void
|
|
143
160
|
resetTitleOverride(): void
|
|
144
161
|
}
|
|
145
162
|
}
|
|
@@ -186,8 +203,8 @@ interface WindowStoredState {
|
|
|
186
203
|
}
|
|
187
204
|
|
|
188
205
|
interface WindowOverride {
|
|
189
|
-
title?: undefined|string
|
|
190
|
-
icon?: undefined|string
|
|
206
|
+
title?: undefined | string
|
|
207
|
+
icon?: undefined | string
|
|
191
208
|
}
|
|
192
209
|
|
|
193
210
|
interface WindowState {
|
|
@@ -240,31 +257,38 @@ interface WindowPosition {
|
|
|
240
257
|
z?: number
|
|
241
258
|
}
|
|
242
259
|
|
|
243
|
-
type WindowSizeValue = number|string|undefined
|
|
260
|
+
type WindowSizeValue = number | string | undefined
|
|
244
261
|
|
|
245
262
|
interface ApplicationEntry {
|
|
246
263
|
title?: string
|
|
247
264
|
icon?: string
|
|
248
265
|
category?: string
|
|
266
|
+
visibility?: ApplicationEntryVisibility
|
|
249
267
|
command: string | any
|
|
250
268
|
}
|
|
251
269
|
|
|
270
|
+
|
|
252
271
|
interface ApplicationEntryWithInherited extends ApplicationEntry {
|
|
253
272
|
application: IApplicationController
|
|
273
|
+
visibility: ApplicationEntryVisibility
|
|
254
274
|
}
|
|
255
275
|
|
|
276
|
+
type ApplicationEntryVisibility = 'primary' | 'secondary' | 'hidden'
|
|
277
|
+
|
|
256
278
|
// DESKTOP
|
|
257
279
|
|
|
258
280
|
interface IDesktopManager {
|
|
259
281
|
defaultApps: DefaultAppsConfig
|
|
260
282
|
|
|
261
283
|
getDefaultApp(feature: string)
|
|
284
|
+
|
|
262
285
|
setDefaultApp(feature: string, application: IApplicationController, entry: ApplicationEntry)
|
|
263
286
|
}
|
|
264
287
|
|
|
265
288
|
interface DesktopConfig {
|
|
266
|
-
name
|
|
267
|
-
compatibility
|
|
289
|
+
name?: string
|
|
290
|
+
compatibility?: string
|
|
291
|
+
apps?: string[]
|
|
268
292
|
defaultApps?: DefaultAppsConfig
|
|
269
293
|
features?: string[]
|
|
270
294
|
systemBar?: DesktopSystemBarConfig
|
|
@@ -304,6 +328,7 @@ interface DefaultAppsConfig {
|
|
|
304
328
|
terminal?: DefaultAppConfig
|
|
305
329
|
browser?: DefaultAppConfig
|
|
306
330
|
editor?: DefaultAppConfig
|
|
331
|
+
|
|
307
332
|
[key: string]: DefaultAppConfig
|
|
308
333
|
}
|
|
309
334
|
|
package/module/index.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import {defineNuxtModule, createResolver, addComponentsDir, addImportsDir, installModule} from '@nuxt/kit'
|
|
2
|
-
import pkg from '../package.json'
|
|
3
|
-
import path from "path";
|
|
4
|
-
|
|
5
|
-
export default defineNuxtModule({
|
|
6
|
-
meta: {
|
|
7
|
-
name: 'owd-core',
|
|
8
|
-
},
|
|
9
|
-
async setup(options, nuxt) {
|
|
10
|
-
const {resolve} = createResolver(import.meta.url);
|
|
11
|
-
|
|
12
|
-
// set core version to runtime variables
|
|
13
|
-
|
|
14
|
-
nuxt.options.runtimeConfig.public.coreVersion = pkg.version
|
|
15
|
-
|
|
16
|
-
// configure nuxt plugins
|
|
17
|
-
|
|
18
|
-
nuxt.options.primevue = nuxt.options.primevue || {};
|
|
19
|
-
nuxt.options.primevue.options = nuxt.options.primevue.options || {};
|
|
20
|
-
nuxt.options.primevue.options.theme = nuxt.options.primevue.options.theme || {};
|
|
21
|
-
nuxt.options.primevue.options.theme.options = {
|
|
22
|
-
cssLayer: false
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
// install tailwind
|
|
28
|
-
|
|
29
|
-
nuxt.options.modules.push('@nuxtjs/tailwindcss')
|
|
30
|
-
await installModule("@nuxtjs/tailwindcss", {
|
|
31
|
-
viewer: false,
|
|
32
|
-
//configPath: resolve(runtimeDir, "tailwind.config"),
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
// install primevue
|
|
40
|
-
|
|
41
|
-
nuxt.options.modules.push('@primevue/nuxt-module')
|
|
42
|
-
await installModule("@primevue/nuxt-module")
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
// install pinia
|
|
49
|
-
|
|
50
|
-
nuxt.options.modules.push('@pinia/nuxt')
|
|
51
|
-
await installModule("@pinia/nuxt")
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
// install @nuxt/fonts
|
|
58
|
-
|
|
59
|
-
nuxt.options.modules.push('@nuxt/fonts')
|
|
60
|
-
await installModule("@nuxt/fonts")
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
|
|
66
|
-
// install @nuxt/icon
|
|
67
|
-
|
|
68
|
-
nuxt.options.modules.push('@nuxt/icon')
|
|
69
|
-
await installModule("@nuxt/icon", {
|
|
70
|
-
clientBundle: {
|
|
71
|
-
scan: true,
|
|
72
|
-
sizeLimitKb: 256,
|
|
73
|
-
},
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
// install @vueuse/nuxt
|
|
81
|
-
|
|
82
|
-
nuxt.options.modules.push('@vueuse/nuxt')
|
|
83
|
-
await installModule("@vueuse/nuxt")
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
// install @nuxtjs/i18n
|
|
90
|
-
|
|
91
|
-
nuxt.options.modules.push('@nuxtjs/i18n')
|
|
92
|
-
await installModule("@nuxtjs/i18n")
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
{
|
|
97
|
-
|
|
98
|
-
// configure scss for vite
|
|
99
|
-
|
|
100
|
-
nuxt.hook('vite:extendConfig', (viteConfig) => {
|
|
101
|
-
viteConfig.css = viteConfig.css || {}
|
|
102
|
-
viteConfig.css.preprocessorOptions = viteConfig.css.preprocessorOptions || {}
|
|
103
|
-
viteConfig.css.preprocessorOptions.scss = {
|
|
104
|
-
api: 'modern-compiler',
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
|
|
112
|
-
// add css
|
|
113
|
-
|
|
114
|
-
nuxt.options.css.push('sanitize.css')
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
{
|
|
119
|
-
|
|
120
|
-
// add runtime components
|
|
121
|
-
|
|
122
|
-
addComponentsDir({
|
|
123
|
-
path: resolve("../runtime/components"),
|
|
124
|
-
prefix: "",
|
|
125
|
-
global: true,
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
{
|
|
131
|
-
|
|
132
|
-
nuxt.options.plugins.push(
|
|
133
|
-
resolve('../runtime/plugins/resize.client.ts'),
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
addImportsDir(resolve('../runtime/composables'))
|
|
137
|
-
addImportsDir(resolve('../runtime/core'))
|
|
138
|
-
addImportsDir(resolve('../runtime/stores'))
|
|
139
|
-
addImportsDir(resolve('../runtime/utils'))
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
})
|