@owdproject/core 3.1.3 → 3.1.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +6 -7
  3. package/bin/owd.js +14 -14
  4. package/index.ts +5 -2
  5. package/module.ts +78 -61
  6. package/package.json +19 -17
  7. package/project.json +4 -0
  8. package/runtime/components/Core/Application/CoreApplicationRender.vue +6 -5
  9. package/runtime/components/Core/Application/CoreApplicationWindowsRender.vue +8 -8
  10. package/runtime/components/Core/Background/CoreBackground.vue +1 -1
  11. package/runtime/components/Core/Desktop/CoreDesktop.vue +31 -24
  12. package/runtime/components/Core/Explorer/CoreExplorerFile.vue +47 -38
  13. package/runtime/components/Core/Explorer/CoreExplorerFolder.vue +0 -1
  14. package/runtime/components/Core/Time/CoreTime.vue +10 -7
  15. package/runtime/components/Core/Window/CoreWindow.vue +49 -35
  16. package/runtime/components/Core/Window/CoreWindowContent.vue +3 -5
  17. package/runtime/components/Core/Window/CoreWindowNav.vue +12 -7
  18. package/runtime/composables/useApplicationEntries.ts +51 -0
  19. package/runtime/composables/useApplicationManager.ts +278 -5
  20. package/runtime/composables/useDesktopManager.ts +22 -4
  21. package/runtime/composables/useTerminalManager.ts +63 -4
  22. package/runtime/core/controllers/ApplicationController.ts +203 -192
  23. package/runtime/core/controllers/WindowController.ts +342 -334
  24. package/runtime/plugins/resize.client.ts +4 -4
  25. package/runtime/stores/storeApplication.ts +236 -0
  26. package/runtime/stores/storeApplicationMeta.ts +12 -8
  27. package/runtime/stores/storeApplicationWindows.ts +16 -12
  28. package/runtime/stores/storeDesktop.ts +35 -29
  29. package/runtime/stores/storeDesktopDefaultApps.ts +53 -0
  30. package/runtime/stores/storeDesktopVolume.ts +12 -12
  31. package/runtime/stores/storeDesktopWindow.ts +13 -13
  32. package/runtime/stores/storeDesktopWorkspace.ts +35 -31
  33. package/runtime/utils/utilApp.ts +27 -22
  34. package/runtime/utils/utilCommon.ts +43 -43
  35. package/runtime/utils/utilDebug.ts +17 -17
  36. package/runtime/utils/utilDesktop.ts +4 -4
  37. package/runtime/utils/utilTerminal.ts +6 -5
  38. package/runtime/utils/utilWindow.ts +11 -11
  39. package/test/fixtures/basic/app.vue +1 -2
  40. package/test/fixtures/basic/nuxt.config.ts +1 -3
  41. package/tsconfig.app.json +1 -1
  42. package/tsconfig.json +1 -1
  43. package/types/index.d.ts +235 -207
  44. package/vitest.config.ts +3 -3
  45. package/eslint.config.mjs +0 -30
  46. package/runtime/composables/useAppEntries.ts +0 -36
  47. package/runtime/composables/useClipboardFs.ts +0 -25
  48. package/runtime/core/managers/ApplicationManager.ts +0 -237
  49. package/runtime/core/managers/DesktopManager.ts +0 -37
  50. package/runtime/core/managers/TerminalManager.ts +0 -44
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ ## 3.1.4 (2025-05-22)
2
+
3
+ ### 🚀 Features
4
+
5
+ - Allow apps to have a menu ([4bfea74](https://github.com/owdproject/client/commit/4bfea74))
6
+ - Add methods to better handle window changes ([54d1346](https://github.com/owdproject/client/commit/54d1346))
7
+ - Check if owd.config.ts is available and valid ([4920302](https://github.com/owdproject/client/commit/4920302))
8
+ - Add fit-parent to CoreWindow.vue ([59e068c](https://github.com/owdproject/client/commit/59e068c))
9
+ - Add focus() to WindowController and set methods as public (deprecate actions) ([710f7be](https://github.com/owdproject/client/commit/710f7be))
10
+ - Add owd global command ([f98c74c](https://github.com/owdproject/client/commit/f98c74c))
11
+ - Add useClipboardFs.ts composable ([cf934f4](https://github.com/owdproject/client/commit/cf934f4))
12
+ - Add window utils in ApplicationController.ts ([ffc97d0](https://github.com/owdproject/client/commit/ffc97d0))
13
+ - Export most used functions from core ([6635af7](https://github.com/owdproject/client/commit/6635af7))
14
+ - Merge owd.config.ts with nuxt.config.ts in module.ts ([069243c](https://github.com/owdproject/client/commit/069243c))
15
+ - Implement basic owd.config.ts ([d052552](https://github.com/owdproject/client/commit/d052552))
16
+ - Rewrite project ([cbbd45d](https://github.com/owdproject/client/commit/cbbd45d))
17
+
18
+ ### 🩹 Fixes
19
+
20
+ - Add key on CoreApplicationWindowsRender v-for ([d2e8e3c](https://github.com/owdproject/client/commit/d2e8e3c))
21
+ - Check if entries property is set before normalizing in utilApp.ts ([6092c33](https://github.com/owdproject/client/commit/6092c33))
22
+ - Add missing min-width ([aa0c1b5](https://github.com/owdproject/client/commit/aa0c1b5))
23
+ - Minor improvements ([7f79208](https://github.com/owdproject/client/commit/7f79208))
24
+ - Fix imports ([44740cd](https://github.com/owdproject/client/commit/44740cd))
25
+ - Set window starting positionZ to 0 ([b99352e](https://github.com/owdproject/client/commit/b99352e))
package/README.md CHANGED
@@ -14,7 +14,6 @@ Open Web Desktop (OWD) is a framework designed to provide a simple environment f
14
14
 
15
15
  ## Features
16
16
 
17
- - Open-source web desktop environment built with Nuxt.js
18
17
  - Fully extendable through themes, apps, and modules
19
18
  - Bundled with popular Vue.js libraries like Pinia and VueUse
20
19
  - Designed to make the most of the Nuxt.js ecosystem
@@ -48,9 +47,9 @@ Thanks to Tailwind and PrimeVue, you can create custom themes from scratch and e
48
47
 
49
48
  [Applications](https://github.com/topics/owd-apps) · [Modules](https://github.com/topics/owd-modules) · [Themes](https://github.com/topics/owd-themes)
50
49
 
51
- ### 🧩 Install an application
50
+ ### 🧩 Install an app
52
51
 
53
- You can discover new apps by searching for the [owd-apps](https://github.com/topics/owd-apps) tag on GitHub.
52
+ Discover apps by searching the [owd-apps](https://github.com/topics/owd-apps) tag on GitHub.
54
53
 
55
54
  For example, to install the To-do app:
56
55
 
@@ -62,7 +61,7 @@ This will install the package and automatically register it in your desktop conf
62
61
 
63
62
  ### 🧩 Install a module
64
63
 
65
- You can discover new modules by searching for the [owd-modules](https://github.com/topics/owd-modules) tag on GitHub.
64
+ Discover modules by searching the [owd-modules](https://github.com/topics/owd-modules) tag on GitHub.
66
65
 
67
66
  For example, to install the session persistence module:
68
67
 
@@ -70,12 +69,12 @@ For example, to install the session persistence module:
70
69
  owd install-module @owdproject/module-pinia-localforage
71
70
  ```
72
71
 
73
- ### 🖥️ Themes
72
+ ### 🖥️ Install a theme
74
73
 
75
- Themes are full desktop environments that style all UI components independently using [PrimeVue](https://primevue.org/).
74
+ Themes are full desktop environments that style all UI components independently, using [PrimeVue](https://primevue.org/).
76
75
  Each theme provides a unique look and feel while maintaining consistent functionality across all applications.
77
76
 
78
- You can discover new themes by searching for the [owd-themes](https://github.com/topics/owd-themes) tag on GitHub.
77
+ Discover themes by searching the [owd-themes](https://github.com/topics/owd-themes) tag on GitHub.
79
78
 
80
79
  ```bash
81
80
  owd install-theme @owdproject/theme-gnome
package/bin/owd.js CHANGED
@@ -1,28 +1,28 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { spawn } from 'child_process';
3
+ import { spawn } from 'child_process'
4
4
 
5
- const [, , cmd, pkgName, ...rest] = process.argv;
5
+ const [, , cmd, pkgName, ...rest] = process.argv
6
6
 
7
7
  const commandMap = {
8
- "install-app": "desktop:install-app",
9
- "install-module": "desktop:install-module",
10
- "install-theme": "desktop:install-theme",
11
- };
8
+ 'install-app': 'desktop:install-app',
9
+ 'install-module': 'desktop:install-module',
10
+ 'install-theme': 'desktop:install-theme',
11
+ }
12
12
 
13
13
  if (!commandMap[cmd]) {
14
- console.error(`Unknown command: ${cmd}`);
15
- process.exit(1);
14
+ console.error(`Unknown command: ${cmd}`)
15
+ process.exit(1)
16
16
  }
17
17
 
18
18
  if (!pkgName) {
19
- console.error("Missing package name (e.g., @owdproject/package)");
20
- process.exit(1);
19
+ console.error('Missing package name (e.g., @owdproject/package)')
20
+ process.exit(1)
21
21
  }
22
22
 
23
- const nxArgs = ["run", commandMap[cmd], `--name=${pkgName}`, ...rest];
23
+ const nxArgs = ['run', commandMap[cmd], `--name=${pkgName}`, ...rest]
24
24
 
25
- const child = spawn("pnpm", ["nx", ...nxArgs], {
26
- stdio: "inherit",
25
+ const child = spawn('pnpm', ['nx', ...nxArgs], {
26
+ stdio: 'inherit',
27
27
  shell: true,
28
- });
28
+ })
package/index.ts CHANGED
@@ -1,2 +1,5 @@
1
- export { defineDesktopApp, defineDesktopConfig } from "./runtime/utils/utilDesktop"
2
- export { registerTailwindPath } from "./runtime/utils/utilApp"
1
+ export {
2
+ defineDesktopApp,
3
+ defineDesktopConfig,
4
+ } from './runtime/utils/utilDesktop'
5
+ export { registerTailwindPath } from './runtime/utils/utilApp'
package/module.ts CHANGED
@@ -1,79 +1,114 @@
1
- import {defineNuxtModule, createResolver, addComponentsDir, addImportsDir, installModule, addPlugin} from '@nuxt/kit'
2
- import {deepMerge} from './runtime/utils/utilCommon'
1
+ import {
2
+ defineNuxtModule,
3
+ createResolver,
4
+ addComponentsDir,
5
+ addImportsDir,
6
+ installModule,
7
+ addPlugin
8
+ } from '@nuxt/kit'
9
+ import { deepMerge } from './runtime/utils/utilCommon'
3
10
  import pkg from './package.json'
4
11
 
5
12
  export default defineNuxtModule({
6
13
  meta: {
7
14
  name: 'owd-core',
15
+ configKey: 'owd'
16
+ },
17
+ defaults: {
18
+ theme: '@owdproject/theme-win95',
19
+ apps: [],
20
+ modules: [],
8
21
  },
9
22
  async setup(_options, _nuxt) {
10
- const {resolve} = createResolver(import.meta.url)
23
+ const { resolve } = createResolver(import.meta.url)
24
+
25
+ _nuxt.options.runtimeConfig.public.desktop = {}
11
26
 
12
27
  // get open web desktop config
13
28
 
14
- const desktopConfig = (await import(_nuxt.options.rootDir + '/owd.config.ts')).default
29
+ let clientConfig
30
+
31
+ try {
32
+
33
+ clientConfig = (
34
+ await import(_nuxt.options.rootDir + '/owd.config.ts')
35
+ ).default
36
+
37
+ } catch (e) {
38
+ console.error('/desktop/owd.config.ts not found or invalid', e)
39
+ return
40
+ }
41
+
42
+ if (!clientConfig.theme) {
43
+ clientConfig.theme = '@owdproject/theme-win95'
44
+ }
15
45
 
16
46
  // extend nuxt.config.ts with owd.config.ts
17
47
 
18
48
  _nuxt.options = {
19
49
  ..._nuxt.options,
20
- ...desktopConfig,
50
+ ...clientConfig
21
51
  }
22
52
 
23
- // set core version to runtime config
53
+ // init desktop runtime config and define core version
54
+
55
+ _nuxt.options.runtimeConfig.public.desktop = {
56
+ coreVersion: pkg.version
57
+ }
24
58
 
25
- _nuxt.options.runtimeConfig.public.coreVersion = pkg.version
59
+ // assign open web desktop config to runtime config
60
+ _nuxt.options.runtimeConfig.public.desktop = deepMerge(
61
+ _nuxt.options.runtimeConfig.public.desktop,
62
+ clientConfig
63
+ )
26
64
 
27
65
  {
28
-
29
66
  // install open web desktop theme
30
67
 
31
- if (desktopConfig.theme) {
32
- await installModule(desktopConfig.theme)
68
+ if (clientConfig.theme) {
69
+ await installModule(clientConfig.theme)
33
70
  }
34
71
 
35
72
  // install open web desktop modules
36
73
 
37
- if (desktopConfig.modules) {
38
- for (const modulePath of desktopConfig.modules) {
74
+ if (clientConfig.modules && Array.isArray(clientConfig.modules)) {
75
+ for (const modulePath of clientConfig.modules) {
39
76
  await installModule(modulePath)
40
77
  }
41
78
  }
42
79
 
43
80
  // install open web desktop apps
44
81
 
45
- if (desktopConfig.apps) {
46
- for (const appPath of desktopConfig.apps) {
82
+ if (clientConfig.apps && Array.isArray(clientConfig.apps)) {
83
+ for (const appPath of clientConfig.apps) {
47
84
  await installModule(appPath)
48
85
  }
49
86
  }
50
87
 
51
- // assign open web desktop config to runtime config
52
- _nuxt.options.runtimeConfig.public.desktop = deepMerge(
53
- _nuxt.options.runtimeConfig.public.desktop,
54
- desktopConfig
55
- )
56
-
57
88
  }
58
89
 
59
- {
90
+ // assign runtimeConfig desktop prop to appConfig
91
+ // to make it overwritable by components later
92
+ // via useDesktopManager
93
+ _nuxt.options.appConfig.desktop = _nuxt.options.runtimeConfig.public.desktop
60
94
 
95
+ {
61
96
  // install primevue
62
97
 
63
- _nuxt.options.primevue = _nuxt.options.primevue || {};
64
- _nuxt.options.primevue.options = _nuxt.options.primevue.options || {};
65
- _nuxt.options.primevue.options.theme = _nuxt.options.primevue.options.theme || {};
66
-
67
- await installModule("@primevue/nuxt-module")
98
+ _nuxt.options.primevue = _nuxt.options.primevue || {}
99
+ _nuxt.options.primevue.options = _nuxt.options.primevue.options || {}
100
+ _nuxt.options.primevue.options.theme =
101
+ _nuxt.options.primevue.options.theme || {}
68
102
 
103
+ await installModule('@primevue/nuxt-module')
69
104
  }
70
105
 
71
106
  {
72
-
73
107
  // install tailwind
74
108
 
75
- const tailwindPaths = _nuxt.options.runtimeConfig.app.owd?.tailwindPaths || []
76
- tailwindPaths.push('./runtime/components/**/*.{vue,mjs,ts}') // Aggiungi sempre questo al core
109
+ const tailwindPaths =
110
+ _nuxt.options.runtimeConfig.app.owd?.tailwindPaths || []
111
+ tailwindPaths.push('./runtime/components/**/*.{vue,mjs,ts}') // Aggiungi sempre questo al core
77
112
 
78
113
  _nuxt.options.tailwindcss = _nuxt.options.tailwindcss || {}
79
114
  _nuxt.options.tailwindcss.config = _nuxt.options.tailwindcss.config || {}
@@ -81,92 +116,75 @@ export default defineNuxtModule({
81
116
  _nuxt.options.tailwindcss.config.content = tailwindPaths
82
117
 
83
118
  await installModule('@nuxtjs/tailwindcss', {
84
- viewer: false,
119
+ viewer: false
85
120
  })
86
-
87
121
  }
88
122
 
89
123
  {
90
-
91
124
  // install pinia
92
125
 
93
- await installModule("@pinia/nuxt")
94
-
126
+ await installModule('@pinia/nuxt')
95
127
  }
96
128
 
97
129
  {
98
-
99
130
  // install @nuxt/fonts
100
131
 
101
- await installModule("@nuxt/fonts")
102
-
132
+ await installModule('@nuxt/fonts')
103
133
  }
104
134
 
105
135
  {
106
-
107
136
  // install @nuxt/icon
108
137
 
109
- await installModule("@nuxt/icon", {
138
+ await installModule('@nuxt/icon', {
110
139
  clientBundle: {
111
140
  scan: true,
112
- sizeLimitKb: 256,
113
- },
141
+ sizeLimitKb: 256
142
+ }
114
143
  })
115
-
116
144
  }
117
145
 
118
146
  {
119
-
120
147
  // install @vueuse/nuxt
121
148
 
122
- await installModule("@vueuse/nuxt")
123
-
149
+ await installModule('@vueuse/nuxt')
124
150
  }
125
151
 
126
152
  {
127
-
128
153
  // install @nuxtjs/i18n
129
154
 
130
- await installModule("@nuxtjs/i18n")
131
-
155
+ await installModule('@nuxtjs/i18n')
132
156
  }
133
157
 
134
158
  {
135
-
136
159
  // configure scss for vite
137
160
 
138
161
  _nuxt.hook('vite:extendConfig', (viteConfig) => {
139
162
  viteConfig.css = viteConfig.css || {}
140
- viteConfig.css.preprocessorOptions = viteConfig.css.preprocessorOptions || {}
163
+ viteConfig.css.preprocessorOptions =
164
+ viteConfig.css.preprocessorOptions || {}
141
165
  viteConfig.css.preprocessorOptions.scss = {
142
- api: 'modern-compiler',
166
+ api: 'modern-compiler'
143
167
  }
144
168
  })
145
-
146
169
  }
147
170
 
148
171
  {
149
-
150
172
  // add css
151
173
 
152
174
  _nuxt.options.css.push('sanitize.css')
153
-
154
175
  }
155
176
 
156
177
  {
157
-
158
178
  // add components
159
179
 
160
180
  addComponentsDir({
161
- path: resolve("./runtime/components"),
162
- prefix: "",
163
- global: true,
181
+ path: resolve('./runtime/components'),
182
+ prefix: '',
183
+ global: true
164
184
  })
165
-
166
185
  }
167
186
 
168
187
  {
169
-
170
188
  addPlugin(resolve('./runtime/plugins/resize.client.ts'))
171
189
 
172
190
  // add other files
@@ -175,7 +193,6 @@ export default defineNuxtModule({
175
193
  addImportsDir(resolve('./runtime/core'))
176
194
  addImportsDir(resolve('./runtime/stores'))
177
195
  addImportsDir(resolve('./runtime/utils'))
178
-
179
196
  }
180
197
  }
181
198
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owdproject/core",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "keywords": [
5
5
  "web",
6
6
  "desktop",
@@ -25,27 +25,29 @@
25
25
  "type": "module",
26
26
  "types": "types/index.d.ts",
27
27
  "bin": {
28
- "owd": "./bin/owd.js"
28
+ "owd": "bin/owd.js"
29
29
  },
30
30
  "dependencies": {
31
- "@nuxt/kit": "^3.17.2",
32
- "@nuxt/fonts": "^0.11.3",
33
- "@nuxt/icon": "^1.12.0",
34
- "@nuxtjs/i18n": "^9.5.4",
31
+ "@nuxt/fonts": "^0.11.4",
32
+ "@nuxt/icon": "^1.14.0",
33
+ "@nuxt/kit": "^3.17.5",
34
+ "@nuxtjs/i18n": "^9.5.5",
35
35
  "@nuxtjs/tailwindcss": "^6.14.0",
36
- "@pinia/nuxt": "^0.11.0",
37
- "@primeuix/themes": "^1.1.1",
38
- "@primevue/forms": "^4.3.4",
39
- "@primevue/nuxt-module": "^4.3.4",
40
- "@vueuse/components": "^13.1.0",
41
- "@vueuse/core": "^13.1.0",
42
- "@vueuse/nuxt": "^13.1.0",
36
+ "@pinia/nuxt": "^0.11.1",
37
+ "@primeuix/themes": "^1.1.2",
38
+ "@primevue/forms": "^4.3.5",
39
+ "@primevue/nuxt-module": "^4.3.5",
40
+ "@vueuse/components": "^13.4.0",
41
+ "@vueuse/core": "^13.4.0",
42
+ "@vueuse/nuxt": "^13.4.0",
43
43
  "mitt": "^3.0.1",
44
44
  "nanoid": "^5.1.5",
45
- "nuxt": "^3.17.2",
46
- "pinia": "^3.0.2",
45
+ "nuxt": "^3.17.5",
46
+ "pinia": "^3.0.3",
47
47
  "sanitize.css": "^13.0.0",
48
- "sass": "^1.88.0",
49
- "vue-resizable": "^2.1.7"
48
+ "sass": "^1.89.2",
49
+ "shellwords": "^1.0.1",
50
+ "vue-resizable": "^2.1.7",
51
+ "getopts": "^2.3.0"
50
52
  }
51
53
  }
package/project.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "core",
3
+ "version": "3.1.3"
4
+ }
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import {useApplicationManager} from "../../../composables/useApplicationManager"
2
+ import { useApplicationManager } from '../../../composables/useApplicationManager'
3
3
 
4
4
  defineProps<{
5
5
  workspaceFilter?: string
@@ -10,8 +10,9 @@ const applicationManager = useApplicationManager()
10
10
 
11
11
  <template>
12
12
  <CoreApplicationWindowsRender
13
- v-for="app of applicationManager.appsRunning"
14
- :workspace-filter="workspaceFilter"
15
- :windows="app.windowsOpened"
13
+ v-for="app of applicationManager.appsRunning.value"
14
+ :key="app.id"
15
+ :workspace-filter="workspaceFilter"
16
+ :windows="app.windowsOpened"
16
17
  />
17
- </template>
18
+ </template>
@@ -6,14 +6,14 @@ defineProps<{
6
6
  </script>
7
7
 
8
8
  <template>
9
- <template
10
- v-for="[windowId, window] in windows"
11
- :key="windowId"
12
- >
9
+ <template v-for="[windowId, window] in windows" :key="windowId">
13
10
  <component
14
- v-if="!workspaceFilter || (workspaceFilter && window.state.workspace === workspaceFilter)"
15
- :window="window"
16
- :is="window.config.component"
11
+ v-if="
12
+ !workspaceFilter ||
13
+ (workspaceFilter && window.state.workspace === workspaceFilter)
14
+ "
15
+ :window="window"
16
+ :is="window.config.component"
17
17
  />
18
18
  </template>
19
- </template>
19
+ </template>
@@ -13,4 +13,4 @@
13
13
  bottom: 0;
14
14
  background-color: var(--owd-background-color);
15
15
  }
16
- </style>
16
+ </style>
@@ -1,30 +1,35 @@
1
1
  <script setup lang="ts">
2
- import {onMounted, onUnmounted} from "vue"
3
- import {useRuntimeConfig} from "nuxt/app"
4
- import {computed, toRaw} from "@vue/reactivity"
5
- import {useDesktopManager} from "../../../composables/useDesktopManager"
6
- import {useApplicationManager} from "../../../composables/useApplicationManager"
7
- import {useDesktopStore} from "../../../stores/storeDesktop"
8
- import {useDesktopWorkspaceStore} from "../../../stores/storeDesktopWorkspace"
2
+ import { onBeforeMount, onMounted, onUnmounted } from 'vue'
3
+ import { useAppConfig, useRuntimeConfig } from 'nuxt/app'
4
+ import { computed, toRaw } from '@vue/reactivity'
5
+ import { useDesktopManager } from '../../../composables/useDesktopManager'
6
+ import { useDesktopStore } from '../../../stores/storeDesktop'
7
+ import { useDesktopDefaultAppsStore } from '../../../stores/storeDesktopDefaultApps'
8
+ import { useDesktopWorkspaceStore } from '../../../stores/storeDesktopWorkspace'
9
9
 
10
- const props = withDefaults(defineProps<{
11
- windows?: DesktopWindowsConfig
12
- systemBar?: DesktopSystemBarConfig
13
- dockBar?: DesktopDockBarConfig
14
- workspaces?: DesktopWorkspacesConfig
15
- }>(), {
16
- windows: {
17
- position: 'fixed',
10
+ const props = withDefaults(
11
+ defineProps<{
12
+ windows?: DesktopWindowsConfig
13
+ systemBar?: DesktopSystemBarConfig
14
+ dockBar?: DesktopDockBarConfig
15
+ workspaces?: DesktopWorkspacesConfig
16
+ }>(),
17
+ {
18
+ windows: {
19
+ position: 'fixed',
20
+ },
21
+ systemBar: {},
22
+ dockBar: {},
23
+ workspaces: {},
18
24
  },
19
- systemBar: {},
20
- dockBar: {},
21
- workspaces: {},
22
- })
25
+ )
23
26
 
24
27
  // todo move to owd initialization
28
+ // perhaps in a plugin
25
29
 
30
+ const appConfig = useAppConfig()
26
31
  const desktopManager = useDesktopManager()
27
- const applicationManager = useApplicationManager()
32
+ const desktopDefaultAppsStore = useDesktopDefaultAppsStore()
28
33
  const runtimeConfig = useRuntimeConfig()
29
34
 
30
35
  // create firsts workspaces if not available
@@ -39,8 +44,6 @@ if (desktopStore.$persistedState) {
39
44
  desktopWorkspaceStore.setupWorkspaces()
40
45
  }
41
46
 
42
- desktopManager.setConfig(runtimeConfig.public.desktop)
43
-
44
47
  // override desktop configurations
45
48
  desktopManager.setConfig({
46
49
  windows: toRaw(props.windows),
@@ -62,15 +65,19 @@ function handleDesktopResize() {
62
65
  const classes = computed(() => {
63
66
  const list = ['owd-desktop']
64
67
 
65
- list.push(`owd-desktop--${desktopManager.config.name}`)
68
+ list.push(`owd-desktop--${appConfig.desktop.name}`)
66
69
 
67
70
  return list
68
71
  })
72
+
73
+ onBeforeMount(() => {
74
+ desktopDefaultAppsStore.loadDefaultAppsFromConfig(runtimeConfig)
75
+ })
69
76
  </script>
70
77
 
71
78
  <template>
72
79
  <div :class="classes">
73
- <slot/>
80
+ <slot />
74
81
  </div>
75
82
  </template>
76
83