@owdproject/core 3.1.4 → 3.2.0
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 +6 -6
- package/bin/cli.js +395 -0
- package/bin/desktop.js +5 -0
- package/bin/lib/catalog.js +293 -0
- package/bin/lib/config.js +109 -0
- package/bin/lib/desktopConfig.js +56 -0
- package/bin/lib/generateTemplate.js +389 -0
- package/bin/lib/install.js +408 -0
- package/bin/lib/migrateModulePlayground.config.mjs +164 -0
- package/bin/lib/migrateModulePlayground.mjs +313 -0
- package/bin/lib/npmVersions.js +124 -0
- package/bin/lib/playgroundContext.js +188 -0
- package/bin/lib/scaffold.js +197 -0
- package/bin/lib/status.js +289 -0
- package/bin/lib/validateModule.js +683 -0
- package/bin/lib/workspace.js +182 -0
- package/bin/owd.js +2 -25
- package/bin/tui.js +1379 -0
- package/dist/module.d.mts +13 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +219 -0
- package/dist/types.d.mts +7 -0
- package/module.ts +38 -12
- package/package.json +78 -22
- package/runtime/components/Core/Application/CoreApplicationRender.vue +3 -1
- package/runtime/components/Core/Application/CoreApplicationWindowsRender.vue +28 -7
- package/runtime/components/Core/Window/CoreWindow.vue +42 -8
- package/runtime/components/Core/Window/CoreWindowNav.vue +26 -8
- package/runtime/composables/useApplicationManager.ts +18 -13
- package/runtime/composables/useDesktopManager.ts +31 -7
- package/runtime/composables/useOwdDialogs.ts +13 -0
- package/runtime/composables/useWorkspaceOverview.ts +41 -0
- package/runtime/core/controllers/ApplicationController.ts +114 -24
- package/runtime/core/controllers/WindowController.ts +4 -9
- package/runtime/dialogs/owdDialogProvider.ts +81 -0
- package/runtime/plugins/01.owd-dialogs-fallback.ts +15 -0
- package/runtime/stores/storeApplicationMeta.ts +56 -12
- package/runtime/stores/storeDesktop.ts +79 -2
- package/runtime/stores/storeDesktopDefaultApps.ts +2 -2
- package/runtime/stores/storeDesktopExplorer.ts +74 -0
- package/runtime/stores/storeDesktopWorkspace.ts +14 -2
- package/runtime/utils/captureElementToCanvas.ts +21 -0
- package/runtime/utils/explorerEntryPath.ts +10 -0
- package/runtime/utils/resolveDesktopConfigPath.ts +52 -0
- package/runtime/utils/validateOwdUserConfig.ts +44 -0
- package/types/index.d.ts +64 -12
- package/CHANGELOG.md +0 -25
- package/project.json +0 -4
- package/runtime/stores/storeApplication.ts +0 -236
- package/test/basic.test.ts +0 -15
- package/test/fixtures/basic/app.vue +0 -5
- package/test/fixtures/basic/nuxt.config.ts +0 -5
- package/test/fixtures/basic/package.json +0 -5
- package/tsconfig.app.json +0 -31
- package/tsconfig.json +0 -12
- package/tsconfig.spec.json +0 -37
- package/vitest.config.ts +0 -24
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
import { defineStore } from 'pinia'
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
|
|
4
|
+
export type DesktopWindowSurface = 'acrylic' | 'solid'
|
|
5
|
+
|
|
6
|
+
export type DesktopAppearance = 'dark' | 'light'
|
|
7
|
+
|
|
8
|
+
export type DesktopPersonalization = {
|
|
9
|
+
windowSurface: DesktopWindowSurface
|
|
10
|
+
/** Used when windowSurface is solid (CSS color string). */
|
|
11
|
+
windowTint: string
|
|
12
|
+
appearance: DesktopAppearance
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const defaultDesktopPersonalization: DesktopPersonalization = {
|
|
16
|
+
windowSurface: 'acrylic',
|
|
17
|
+
windowTint: '#2d2d30',
|
|
18
|
+
appearance: 'dark',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function mergePersonalization(
|
|
22
|
+
raw: Partial<DesktopPersonalization> | undefined | null,
|
|
23
|
+
): DesktopPersonalization {
|
|
24
|
+
const windowSurface =
|
|
25
|
+
raw?.windowSurface === 'solid' || raw?.windowSurface === 'acrylic'
|
|
26
|
+
? raw.windowSurface
|
|
27
|
+
: defaultDesktopPersonalization.windowSurface
|
|
28
|
+
const appearance =
|
|
29
|
+
raw?.appearance === 'light' || raw?.appearance === 'dark'
|
|
30
|
+
? raw.appearance
|
|
31
|
+
: defaultDesktopPersonalization.appearance
|
|
32
|
+
const tint =
|
|
33
|
+
typeof raw?.windowTint === 'string' && raw.windowTint.trim()
|
|
34
|
+
? raw.windowTint.trim()
|
|
35
|
+
: defaultDesktopPersonalization.windowTint
|
|
36
|
+
return { windowSurface, windowTint: tint, appearance }
|
|
37
|
+
}
|
|
38
|
+
|
|
4
39
|
export const useDesktopStore = defineStore(
|
|
5
40
|
'owd/desktop',
|
|
6
41
|
() => {
|
|
@@ -16,7 +51,12 @@ export const useDesktopStore = defineStore(
|
|
|
16
51
|
window: {
|
|
17
52
|
positionZ: number
|
|
18
53
|
}
|
|
19
|
-
|
|
54
|
+
explorer: {
|
|
55
|
+
navExpandedKeys: string[]
|
|
56
|
+
quickAccessPins: { id: string; label: string; path: string; icon?: string }[]
|
|
57
|
+
}
|
|
58
|
+
defaultApps: Record<string, { applicationId: string; entry: string }>
|
|
59
|
+
personalization: DesktopPersonalization
|
|
20
60
|
}>({
|
|
21
61
|
workspace: {
|
|
22
62
|
overview: false,
|
|
@@ -29,11 +69,48 @@ export const useDesktopStore = defineStore(
|
|
|
29
69
|
window: {
|
|
30
70
|
positionZ: 0,
|
|
31
71
|
},
|
|
32
|
-
|
|
72
|
+
explorer: {
|
|
73
|
+
navExpandedKeys: [
|
|
74
|
+
'quickAccess',
|
|
75
|
+
'thisPc',
|
|
76
|
+
],
|
|
77
|
+
quickAccessPins: [],
|
|
78
|
+
},
|
|
79
|
+
defaultApps: {},
|
|
80
|
+
personalization: { ...defaultDesktopPersonalization },
|
|
33
81
|
})
|
|
34
82
|
|
|
83
|
+
function setWindowSurface(value: DesktopWindowSurface) {
|
|
84
|
+
const base = mergePersonalization(state.value.personalization)
|
|
85
|
+
state.value.personalization = mergePersonalization({
|
|
86
|
+
...base,
|
|
87
|
+
windowSurface: value,
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function setWindowTint(value: string) {
|
|
92
|
+
const v = value.trim()
|
|
93
|
+
if (!v) return
|
|
94
|
+
const base = mergePersonalization(state.value.personalization)
|
|
95
|
+
state.value.personalization = mergePersonalization({
|
|
96
|
+
...base,
|
|
97
|
+
windowTint: v,
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function setAppearance(value: DesktopAppearance) {
|
|
102
|
+
const base = mergePersonalization(state.value.personalization)
|
|
103
|
+
state.value.personalization = mergePersonalization({
|
|
104
|
+
...base,
|
|
105
|
+
appearance: value,
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
|
|
35
109
|
return {
|
|
36
110
|
state,
|
|
111
|
+
setWindowSurface,
|
|
112
|
+
setWindowTint,
|
|
113
|
+
setAppearance,
|
|
37
114
|
}
|
|
38
115
|
},
|
|
39
116
|
{
|
|
@@ -27,12 +27,12 @@ export const useDesktopDefaultAppsStore = defineStore(
|
|
|
27
27
|
/**
|
|
28
28
|
* Gets the default app config for a given feature
|
|
29
29
|
*/
|
|
30
|
-
function getDefaultApp(feature: string): DefaultAppConfig {
|
|
30
|
+
function getDefaultApp(feature: string): DefaultAppConfig | undefined {
|
|
31
31
|
if (!desktopStore.state.hasOwnProperty('defaultApps')) {
|
|
32
32
|
desktopStore.state.defaultApps = {}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
return desktopStore.state.defaultApps[feature]
|
|
35
|
+
return desktopStore.state.defaultApps[feature]
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { useDesktopStore } from './storeDesktop'
|
|
4
|
+
|
|
5
|
+
type ExplorerQuickAccessPin = {
|
|
6
|
+
id: string
|
|
7
|
+
label: string
|
|
8
|
+
path: string
|
|
9
|
+
icon?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const useDesktopExplorerStore = defineStore(
|
|
13
|
+
'owd/desktop/explorer',
|
|
14
|
+
() => {
|
|
15
|
+
const desktopStore = useDesktopStore()
|
|
16
|
+
|
|
17
|
+
const navExpandedKeys = computed(
|
|
18
|
+
() => desktopStore.state.explorer.navExpandedKeys,
|
|
19
|
+
)
|
|
20
|
+
const quickAccessPins = computed(
|
|
21
|
+
() => desktopStore.state.explorer.quickAccessPins,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
function setNavExpandedKeys(keys: string[]) {
|
|
25
|
+
desktopStore.state.explorer.navExpandedKeys = [...new Set(keys)]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function setQuickAccessPins(pins: ExplorerQuickAccessPin[]) {
|
|
29
|
+
desktopStore.state.explorer.quickAccessPins = pins
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function pinQuickAccess(entry: ExplorerQuickAccessPin) {
|
|
33
|
+
const exists = desktopStore.state.explorer.quickAccessPins.some(
|
|
34
|
+
(pin) => pin.path === entry.path,
|
|
35
|
+
)
|
|
36
|
+
if (exists) return
|
|
37
|
+
desktopStore.state.explorer.quickAccessPins.push(entry)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function unpinQuickAccess(path: string) {
|
|
41
|
+
desktopStore.state.explorer.quickAccessPins =
|
|
42
|
+
desktopStore.state.explorer.quickAccessPins.filter(
|
|
43
|
+
(pin) => pin.path !== path,
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function reorderQuickAccess(startIndex: number, endIndex: number) {
|
|
48
|
+
const list = [...desktopStore.state.explorer.quickAccessPins]
|
|
49
|
+
if (
|
|
50
|
+
startIndex < 0 ||
|
|
51
|
+
endIndex < 0 ||
|
|
52
|
+
startIndex >= list.length ||
|
|
53
|
+
endIndex >= list.length ||
|
|
54
|
+
startIndex === endIndex
|
|
55
|
+
) {
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
const [item] = list.splice(startIndex, 1)
|
|
59
|
+
if (!item) return
|
|
60
|
+
list.splice(endIndex, 0, item)
|
|
61
|
+
desktopStore.state.explorer.quickAccessPins = list
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
navExpandedKeys,
|
|
66
|
+
quickAccessPins,
|
|
67
|
+
setNavExpandedKeys,
|
|
68
|
+
setQuickAccessPins,
|
|
69
|
+
pinQuickAccess,
|
|
70
|
+
unpinQuickAccess,
|
|
71
|
+
reorderQuickAccess,
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
)
|
|
@@ -23,13 +23,23 @@ export const useDesktopWorkspaceStore = defineStore(
|
|
|
23
23
|
function setupWorkspaces() {
|
|
24
24
|
if (desktopStore.state.workspace.list.length === 0) {
|
|
25
25
|
createWorkspace()
|
|
26
|
-
desktopStore.state.workspace.active = desktopStore.state.workspace
|
|
27
|
-
.list[0] as string
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
if (desktopStore.state.workspace.list.length === 1) {
|
|
31
29
|
createWorkspace()
|
|
32
30
|
}
|
|
31
|
+
|
|
32
|
+
const list = desktopStore.state.workspace.list
|
|
33
|
+
const active = desktopStore.state.workspace.active
|
|
34
|
+
if (!active || !list.includes(active)) {
|
|
35
|
+
desktopStore.state.workspace.active = list[0] ?? ''
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Id of the workspace new windows should use (after setupWorkspaces). */
|
|
40
|
+
function resolveActiveWorkspaceId(): string {
|
|
41
|
+
setupWorkspaces()
|
|
42
|
+
return desktopStore.state.workspace.active || desktopStore.state.workspace.list[0] || ''
|
|
33
43
|
}
|
|
34
44
|
|
|
35
45
|
function setOverview(value: boolean) {
|
|
@@ -56,8 +66,10 @@ export const useDesktopWorkspaceStore = defineStore(
|
|
|
56
66
|
list,
|
|
57
67
|
workspaceActiveIndex,
|
|
58
68
|
setupWorkspaces,
|
|
69
|
+
resolveActiveWorkspaceId,
|
|
59
70
|
setOverview,
|
|
60
71
|
setWorkspace,
|
|
72
|
+
createWorkspace,
|
|
61
73
|
}
|
|
62
74
|
},
|
|
63
75
|
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a DOM subtree to a canvas via html2canvas (optional dependency).
|
|
3
|
+
* Used for workspace thumbnails / previews; returns null if capture fails or html2canvas is missing.
|
|
4
|
+
*/
|
|
5
|
+
export async function captureElementToCanvas(
|
|
6
|
+
element: HTMLElement | null | undefined,
|
|
7
|
+
options?: Record<string, unknown>,
|
|
8
|
+
): Promise<HTMLCanvasElement | null> {
|
|
9
|
+
if (!element || typeof window === 'undefined') {
|
|
10
|
+
return null
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const { default: html2canvas } = await import('html2canvas')
|
|
14
|
+
return await html2canvas(element, {
|
|
15
|
+
allowTaint: true,
|
|
16
|
+
...(options as object),
|
|
17
|
+
})
|
|
18
|
+
} catch {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Absolute path for a listing entry under `basePath` (virtual FS paths).
|
|
3
|
+
* Avoids `//fileName` when `basePath` is `/` or has trailing slashes.
|
|
4
|
+
*/
|
|
5
|
+
export function explorerEntryAbsolutePath(basePath: string, fileName: string): string {
|
|
6
|
+
const normalizedBase = (basePath ?? '/').replace(/\/+$/, '') || '/'
|
|
7
|
+
const tail = fileName.replace(/^\/+/, '')
|
|
8
|
+
if (normalizedBase === '/') return `/${tail}`
|
|
9
|
+
return `${normalizedBase}/${tail}`
|
|
10
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
import { join } from 'node:path'
|
|
3
|
+
|
|
4
|
+
export const DESKTOP_CONFIG_FILENAME = 'desktop.config.ts'
|
|
5
|
+
export const LEGACY_DESKTOP_CONFIG_FILENAME = 'owd.config.ts'
|
|
6
|
+
|
|
7
|
+
export const LEGACY_CONFIG_DEPRECATION =
|
|
8
|
+
'[@owdproject/core] owd.config.ts is deprecated and kept only for backward compatibility; rename to desktop.config.ts (required from @owdproject/core 3.2).'
|
|
9
|
+
|
|
10
|
+
export type ResolvedDesktopConfigPath = {
|
|
11
|
+
path: string
|
|
12
|
+
file: string
|
|
13
|
+
legacy: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function resolveDesktopConfigPath(
|
|
17
|
+
rootDir: string,
|
|
18
|
+
): ResolvedDesktopConfigPath | null {
|
|
19
|
+
const desktopPath = join(rootDir, DESKTOP_CONFIG_FILENAME)
|
|
20
|
+
const legacyPath = join(rootDir, LEGACY_DESKTOP_CONFIG_FILENAME)
|
|
21
|
+
const hasDesktop = existsSync(desktopPath)
|
|
22
|
+
const hasLegacy = existsSync(legacyPath)
|
|
23
|
+
|
|
24
|
+
if (hasDesktop && hasLegacy) {
|
|
25
|
+
console.warn(
|
|
26
|
+
'[@owdproject/core] Both desktop.config.ts and owd.config.ts exist; using desktop.config.ts. Remove owd.config.ts.',
|
|
27
|
+
)
|
|
28
|
+
return { path: desktopPath, file: DESKTOP_CONFIG_FILENAME, legacy: false }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (hasDesktop) {
|
|
32
|
+
return { path: desktopPath, file: DESKTOP_CONFIG_FILENAME, legacy: false }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (hasLegacy) {
|
|
36
|
+
return {
|
|
37
|
+
path: legacyPath,
|
|
38
|
+
file: LEGACY_DESKTOP_CONFIG_FILENAME,
|
|
39
|
+
legacy: true,
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return null
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function warnLegacyDesktopConfig(
|
|
47
|
+
resolved: ResolvedDesktopConfigPath | null | undefined,
|
|
48
|
+
): void {
|
|
49
|
+
if (resolved?.legacy) {
|
|
50
|
+
console.warn(LEGACY_CONFIG_DEPRECATION)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime validation for the object exported from `desktop.config.ts`
|
|
3
|
+
* (or legacy `owd.config.ts`).
|
|
4
|
+
*/
|
|
5
|
+
export function assertValidOwdUserConfig(
|
|
6
|
+
config: unknown,
|
|
7
|
+
configFile = 'desktop.config.ts',
|
|
8
|
+
): void {
|
|
9
|
+
if (!config || typeof config !== 'object' || Array.isArray(config)) {
|
|
10
|
+
throw new Error(
|
|
11
|
+
`[@owdproject/core] ${configFile} must default-export a non-array object from defineDesktopConfig({ ... }).`,
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const c = config as Record<string, unknown>
|
|
16
|
+
|
|
17
|
+
if (c.theme != null && typeof c.theme !== 'string') {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`[@owdproject/core] ${configFile}: \`theme\` must be a string (npm package name of the theme module).`,
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (c.apps !== undefined) {
|
|
24
|
+
if (
|
|
25
|
+
!Array.isArray(c.apps) ||
|
|
26
|
+
!(c.apps as unknown[]).every((item) => typeof item === 'string')
|
|
27
|
+
) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`[@owdproject/core] ${configFile}: \`apps\` must be an array of strings (Nuxt module package names).`,
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (c.modules !== undefined) {
|
|
35
|
+
if (
|
|
36
|
+
!Array.isArray(c.modules) ||
|
|
37
|
+
!(c.modules as unknown[]).every((item) => typeof item === 'string')
|
|
38
|
+
) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
`[@owdproject/core] ${configFile}: \`modules\` must be an array of strings (Nuxt module package names).`,
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Nuxt } from '@nuxt/schema'
|
|
2
|
+
import type { ShallowRef } from 'vue'
|
|
2
3
|
import { useApplicationManager } from '../runtime/composables/useApplicationManager'
|
|
3
4
|
|
|
4
5
|
declare module 'nuxt/schema' {
|
|
@@ -16,7 +17,7 @@ interface IApplicationManager {
|
|
|
16
17
|
|
|
17
18
|
get appsRunning(): Reactive<IApplicationController[]>
|
|
18
19
|
|
|
19
|
-
get windowsOpened(): Reactive<IWindowController
|
|
20
|
+
get windowsOpened(): Reactive<Map<string, IWindowController>>
|
|
20
21
|
|
|
21
22
|
get appCategories(): string[]
|
|
22
23
|
|
|
@@ -84,7 +85,8 @@ interface IApplicationController {
|
|
|
84
85
|
get meta(): { [key: string]: any }
|
|
85
86
|
|
|
86
87
|
store: Pinia
|
|
87
|
-
windows:
|
|
88
|
+
windows: Map<string, IWindowController>
|
|
89
|
+
openWindowCount: ShallowRef<number>
|
|
88
90
|
|
|
89
91
|
isRunning: boolean
|
|
90
92
|
|
|
@@ -116,7 +118,7 @@ interface IApplicationController {
|
|
|
116
118
|
get windowsOpened(): Reactive<Map<string, IWindowController>>
|
|
117
119
|
}
|
|
118
120
|
|
|
119
|
-
interface IWindowController {
|
|
121
|
+
export interface IWindowController {
|
|
120
122
|
application: IApplicationController
|
|
121
123
|
instanced: boolean
|
|
122
124
|
model: string
|
|
@@ -134,6 +136,8 @@ interface IWindowController {
|
|
|
134
136
|
// sizes
|
|
135
137
|
get size(): WindowSize
|
|
136
138
|
|
|
139
|
+
get position(): WindowPosition | undefined
|
|
140
|
+
|
|
137
141
|
// minimize
|
|
138
142
|
get isMinimizable(): boolean
|
|
139
143
|
|
|
@@ -179,14 +183,27 @@ interface IWindowController {
|
|
|
179
183
|
setTitleOverride(title: string | undefined): void
|
|
180
184
|
resetTitleOverride(): void
|
|
181
185
|
}
|
|
186
|
+
|
|
187
|
+
/** Payload restored with window state (e.g. explorer cwd in `path`). */
|
|
188
|
+
get meta(): { path?: string } & Record<string, unknown>
|
|
189
|
+
|
|
190
|
+
/** Chrome menu model (e.g. PrimeVue Menubar). */
|
|
191
|
+
menu: unknown[]
|
|
192
|
+
|
|
193
|
+
setMenu(menu: unknown[]): void
|
|
194
|
+
|
|
195
|
+
destroy(): boolean
|
|
196
|
+
|
|
197
|
+
/** Set by module-fs when an explorer surface mounts on this window. */
|
|
198
|
+
fsExplorer?: any
|
|
182
199
|
}
|
|
183
200
|
|
|
184
|
-
interface WindowContent {
|
|
201
|
+
export interface WindowContent {
|
|
185
202
|
padded?: boolean
|
|
186
203
|
centered?: boolean
|
|
187
204
|
}
|
|
188
205
|
|
|
189
|
-
interface WindowConfig {
|
|
206
|
+
export interface WindowConfig {
|
|
190
207
|
title?: string
|
|
191
208
|
category?: string
|
|
192
209
|
icon?: string
|
|
@@ -309,15 +326,28 @@ type ApplicationEntryVisibility = 'primary' | 'secondary' | 'hidden'
|
|
|
309
326
|
// DESKTOP
|
|
310
327
|
|
|
311
328
|
interface IDesktopManager {
|
|
312
|
-
defaultApps:
|
|
329
|
+
defaultApps: import('vue').ComputedRef<Record<string, DefaultAppConfig>>
|
|
313
330
|
|
|
314
|
-
getDefaultApp(feature: string)
|
|
331
|
+
getDefaultApp(feature: string): DefaultAppConfig | undefined
|
|
315
332
|
|
|
316
333
|
setDefaultApp(
|
|
317
334
|
feature: string,
|
|
318
335
|
application: IApplicationController,
|
|
319
|
-
|
|
320
|
-
)
|
|
336
|
+
entry: string,
|
|
337
|
+
): void
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
interface DocsModuleUserSourceConfig {
|
|
341
|
+
cwd: string
|
|
342
|
+
prefix?: string
|
|
343
|
+
include?: string
|
|
344
|
+
exclude?: string[]
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
interface DocsModuleConfig {
|
|
348
|
+
basePath?: string
|
|
349
|
+
title?: string
|
|
350
|
+
sources?: DocsModuleUserSourceConfig[]
|
|
321
351
|
}
|
|
322
352
|
|
|
323
353
|
interface DesktopConfig {
|
|
@@ -325,15 +355,36 @@ interface DesktopConfig {
|
|
|
325
355
|
modules?: string[]
|
|
326
356
|
apps?: string[]
|
|
327
357
|
|
|
328
|
-
|
|
358
|
+
docs?: DocsModuleConfig
|
|
359
|
+
|
|
360
|
+
name?: string
|
|
329
361
|
defaultApps?: DefaultAppsConfig
|
|
330
362
|
features?: string[]
|
|
363
|
+
explorer?: DesktopExplorerConfig
|
|
331
364
|
|
|
332
365
|
systemBar?: DesktopSystemBarConfig
|
|
333
366
|
dockBar?: DesktopDockBarConfig
|
|
334
367
|
workspaces?: DesktopWorkspacesConfig
|
|
335
368
|
}
|
|
336
369
|
|
|
370
|
+
interface DesktopExplorerFolderConfig {
|
|
371
|
+
id: string
|
|
372
|
+
label: string
|
|
373
|
+
path: string
|
|
374
|
+
icon?: string
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
interface DesktopExplorerConfig {
|
|
378
|
+
quickAccess?: DesktopExplorerFolderConfig[]
|
|
379
|
+
quickAccessExtra?: DesktopExplorerFolderConfig[]
|
|
380
|
+
quickAccessOverride?: DesktopExplorerFolderConfig[]
|
|
381
|
+
specialFolders?: DesktopExplorerFolderConfig[]
|
|
382
|
+
specialFoldersExtra?: DesktopExplorerFolderConfig[]
|
|
383
|
+
specialFoldersOverride?: DesktopExplorerFolderConfig[]
|
|
384
|
+
/** Friendly labels for ZenFS mount points shown under “This PC” (paths → label). */
|
|
385
|
+
mountLabels?: Record<string, string>
|
|
386
|
+
}
|
|
387
|
+
|
|
337
388
|
interface DesktopWindowsConfig {
|
|
338
389
|
position: 'relative' | 'absolute' | 'fixed'
|
|
339
390
|
}
|
|
@@ -375,9 +426,10 @@ interface DefaultAppsConfig {
|
|
|
375
426
|
[key: string]: DefaultAppConfig
|
|
376
427
|
}
|
|
377
428
|
|
|
429
|
+
/** Stored default for a feature: which app and which entry key to use. */
|
|
378
430
|
interface DefaultAppConfig {
|
|
379
|
-
|
|
380
|
-
entry:
|
|
431
|
+
applicationId: string
|
|
432
|
+
entry: string
|
|
381
433
|
}
|
|
382
434
|
|
|
383
435
|
export function defineDesktopApp(config: ApplicationConfig)
|
package/CHANGELOG.md
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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/project.json
DELETED