@owdproject/nuxt-theme-ui 0.0.0-stage → 4.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/dist/i18n/locales/en.d.ts +2 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +50 -0
- package/dist/runtime/apps/calculator/app.config.d.ts +34 -0
- package/dist/runtime/apps/calculator/app.config.js +35 -0
- package/dist/runtime/apps/calculator/components/Window/WindowCalculator.d.vue.ts +6 -0
- package/dist/runtime/apps/calculator/components/Window/WindowCalculator.vue +94 -0
- package/dist/runtime/apps/calculator/components/Window/WindowCalculator.vue.d.ts +6 -0
- package/dist/runtime/apps/calculator/plugin.d.ts +2 -0
- package/dist/runtime/apps/calculator/plugin.js +11 -0
- package/dist/runtime/apps/explorer/app.config.d.ts +36 -0
- package/dist/runtime/apps/explorer/app.config.js +39 -0
- package/dist/runtime/apps/explorer/components/Window/WindowExplorer.d.vue.ts +6 -0
- package/dist/runtime/apps/explorer/components/Window/WindowExplorer.vue +30 -0
- package/dist/runtime/apps/explorer/components/Window/WindowExplorer.vue.d.ts +6 -0
- package/dist/runtime/apps/explorer/plugin.d.ts +2 -0
- package/dist/runtime/apps/explorer/plugin.js +11 -0
- package/dist/runtime/apps/installBuiltInApps.d.ts +3 -0
- package/dist/runtime/apps/installBuiltInApps.js +28 -0
- package/dist/runtime/apps/notepad/app.config.d.ts +34 -0
- package/dist/runtime/apps/notepad/app.config.js +35 -0
- package/dist/runtime/apps/notepad/components/Window/WindowNotepad.d.vue.ts +6 -0
- package/dist/runtime/apps/notepad/components/Window/WindowNotepad.vue +47 -0
- package/dist/runtime/apps/notepad/components/Window/WindowNotepad.vue.d.ts +6 -0
- package/dist/runtime/apps/notepad/plugin.d.ts +2 -0
- package/dist/runtime/apps/notepad/plugin.js +11 -0
- package/dist/runtime/apps/registry.d.ts +8 -0
- package/dist/runtime/apps/registry.js +10 -0
- package/dist/runtime/components/Background/DesktopBackground.d.vue.ts +3 -0
- package/dist/runtime/components/Background/DesktopBackground.vue +3 -0
- package/dist/runtime/components/Background/DesktopBackground.vue.d.ts +3 -0
- package/dist/runtime/components/Desktop/DesktopContent.d.vue.ts +13 -0
- package/dist/runtime/components/Desktop/DesktopContent.vue +23 -0
- package/dist/runtime/components/Desktop/DesktopContent.vue.d.ts +13 -0
- package/dist/runtime/components/Desktop.client.d.vue.ts +23 -0
- package/dist/runtime/components/Desktop.client.vue +52 -0
- package/dist/runtime/components/Desktop.client.vue.d.ts +23 -0
- package/dist/runtime/components/NuxtLauncherOverlay.d.vue.ts +3 -0
- package/dist/runtime/components/NuxtLauncherOverlay.vue +110 -0
- package/dist/runtime/components/NuxtLauncherOverlay.vue.d.ts +3 -0
- package/dist/runtime/components/NuxtTopBar.d.vue.ts +3 -0
- package/dist/runtime/components/NuxtTopBar.vue +63 -0
- package/dist/runtime/components/NuxtTopBar.vue.d.ts +3 -0
- package/dist/runtime/components/Window/DesktopWindow.d.vue.ts +43 -0
- package/dist/runtime/components/Window/DesktopWindow.vue +40 -0
- package/dist/runtime/components/Window/DesktopWindow.vue.d.ts +43 -0
- package/dist/runtime/components/Window/DesktopWindowContent.d.vue.ts +13 -0
- package/dist/runtime/components/Window/DesktopWindowContent.vue +5 -0
- package/dist/runtime/components/Window/DesktopWindowContent.vue.d.ts +13 -0
- package/dist/runtime/components/Window/DesktopWindowIframe.d.vue.ts +29 -0
- package/dist/runtime/components/Window/DesktopWindowIframe.vue +13 -0
- package/dist/runtime/components/Window/DesktopWindowIframe.vue.d.ts +29 -0
- package/dist/runtime/components/Window/DesktopWindowNav.d.vue.ts +3 -0
- package/dist/runtime/components/Window/DesktopWindowNav.vue +105 -0
- package/dist/runtime/components/Window/DesktopWindowNav.vue.d.ts +3 -0
- package/dist/runtime/composables/useNuxtStartMenu.d.ts +9 -0
- package/dist/runtime/composables/useNuxtStartMenu.js +57 -0
- package/dist/types.d.mts +7 -0
- package/package.json +70 -4
- package/src/i18n/locales/en.ts +1 -0
- package/src/module.ts +69 -0
- package/src/runtime/apps/calculator/app.config.ts +35 -0
- package/src/runtime/apps/calculator/components/Window/WindowCalculator.vue +104 -0
- package/src/runtime/apps/calculator/plugin.ts +12 -0
- package/src/runtime/apps/explorer/app.config.ts +39 -0
- package/src/runtime/apps/explorer/components/Window/WindowExplorer.vue +34 -0
- package/src/runtime/apps/explorer/plugin.ts +12 -0
- package/src/runtime/apps/installBuiltInApps.ts +36 -0
- package/src/runtime/apps/notepad/app.config.ts +35 -0
- package/src/runtime/apps/notepad/components/Window/WindowNotepad.vue +50 -0
- package/src/runtime/apps/notepad/plugin.ts +12 -0
- package/src/runtime/apps/registry.ts +21 -0
- package/src/runtime/components/Background/DesktopBackground.vue +3 -0
- package/src/runtime/components/Desktop/DesktopContent.vue +37 -0
- package/src/runtime/components/Desktop.client.vue +136 -0
- package/src/runtime/components/NuxtLauncherOverlay.vue +117 -0
- package/src/runtime/components/NuxtTopBar.vue +68 -0
- package/src/runtime/components/Window/DesktopWindow.vue +44 -0
- package/src/runtime/components/Window/DesktopWindowContent.vue +5 -0
- package/src/runtime/components/Window/DesktopWindowIframe.vue +13 -0
- package/src/runtime/components/Window/DesktopWindowNav.vue +110 -0
- package/src/runtime/composables/useNuxtStartMenu.ts +72 -0
- package/README.md +0 -3
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ref, computed } from 'vue'
|
|
2
|
+
import { useScrollLock } from '@vueuse/core'
|
|
3
|
+
import { useApplicationManager } from '@owdproject/nuxt/runtime/composables/useApplicationManager'
|
|
4
|
+
import { useApplicationEntries } from '@owdproject/nuxt/runtime/composables/useApplicationEntries'
|
|
5
|
+
|
|
6
|
+
const open = ref(false)
|
|
7
|
+
const searchQuery = ref('')
|
|
8
|
+
|
|
9
|
+
function isValidEntry(
|
|
10
|
+
entry: any
|
|
11
|
+
): entry is any {
|
|
12
|
+
return Boolean(entry?.application?.id && entry.command)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function useNuxtStartMenu() {
|
|
16
|
+
const applicationManager = useApplicationManager()
|
|
17
|
+
const applicationEntries = useApplicationEntries()
|
|
18
|
+
|
|
19
|
+
const bodyScrollLock = useScrollLock(
|
|
20
|
+
typeof document !== 'undefined' ? document.body : null,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
const allEntries = computed(() => {
|
|
24
|
+
return (applicationEntries as any)
|
|
25
|
+
.sortedAppEntries('title', 'primary')
|
|
26
|
+
.value.filter(isValidEntry)
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const filteredEntries = computed(() => {
|
|
30
|
+
const q = searchQuery.value.trim().toLowerCase()
|
|
31
|
+
const entries = allEntries.value
|
|
32
|
+
if (!q) return entries
|
|
33
|
+
return entries.filter((entry: any) =>
|
|
34
|
+
(entry.title ?? '').toLowerCase().includes(q),
|
|
35
|
+
)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
function syncScrollLock() {
|
|
39
|
+
bodyScrollLock.value = open.value
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function toggle() {
|
|
43
|
+
open.value = !open.value
|
|
44
|
+
searchQuery.value = ''
|
|
45
|
+
syncScrollLock()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function close() {
|
|
49
|
+
open.value = false
|
|
50
|
+
searchQuery.value = ''
|
|
51
|
+
bodyScrollLock.value = false
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function launchEntry(entry: any) {
|
|
55
|
+
if (!isValidEntry(entry)) return
|
|
56
|
+
await applicationManager.execAppCommand(
|
|
57
|
+
entry.application.id,
|
|
58
|
+
entry.command,
|
|
59
|
+
)
|
|
60
|
+
close()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
open,
|
|
65
|
+
searchQuery,
|
|
66
|
+
allEntries,
|
|
67
|
+
filteredEntries,
|
|
68
|
+
toggle,
|
|
69
|
+
close,
|
|
70
|
+
launchEntry,
|
|
71
|
+
}
|
|
72
|
+
}
|
package/README.md
DELETED