@owdproject/nuxt-theme-ui 0.0.0-stage → 4.0.0-alpha.3

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 (85) hide show
  1. package/dist/i18n/locales/en.d.ts +2 -0
  2. package/dist/i18n/locales/en.js +1 -0
  3. package/dist/module.d.mts +7 -0
  4. package/dist/module.json +9 -0
  5. package/dist/module.mjs +50 -0
  6. package/dist/runtime/apps/calculator/app.config.d.ts +34 -0
  7. package/dist/runtime/apps/calculator/app.config.js +35 -0
  8. package/dist/runtime/apps/calculator/components/Window/WindowCalculator.d.vue.ts +6 -0
  9. package/dist/runtime/apps/calculator/components/Window/WindowCalculator.vue +85 -0
  10. package/dist/runtime/apps/calculator/components/Window/WindowCalculator.vue.d.ts +6 -0
  11. package/dist/runtime/apps/calculator/plugin.d.ts +2 -0
  12. package/dist/runtime/apps/calculator/plugin.js +11 -0
  13. package/dist/runtime/apps/explorer/app.config.d.ts +36 -0
  14. package/dist/runtime/apps/explorer/app.config.js +39 -0
  15. package/dist/runtime/apps/explorer/components/Window/WindowExplorer.d.vue.ts +6 -0
  16. package/dist/runtime/apps/explorer/components/Window/WindowExplorer.vue +30 -0
  17. package/dist/runtime/apps/explorer/components/Window/WindowExplorer.vue.d.ts +6 -0
  18. package/dist/runtime/apps/explorer/plugin.d.ts +2 -0
  19. package/dist/runtime/apps/explorer/plugin.js +11 -0
  20. package/dist/runtime/apps/installBuiltInApps.d.ts +3 -0
  21. package/dist/runtime/apps/installBuiltInApps.js +28 -0
  22. package/dist/runtime/apps/notepad/app.config.d.ts +34 -0
  23. package/dist/runtime/apps/notepad/app.config.js +35 -0
  24. package/dist/runtime/apps/notepad/components/Window/WindowNotepad.d.vue.ts +6 -0
  25. package/dist/runtime/apps/notepad/components/Window/WindowNotepad.vue +43 -0
  26. package/dist/runtime/apps/notepad/components/Window/WindowNotepad.vue.d.ts +6 -0
  27. package/dist/runtime/apps/notepad/plugin.d.ts +2 -0
  28. package/dist/runtime/apps/notepad/plugin.js +11 -0
  29. package/dist/runtime/apps/registry.d.ts +8 -0
  30. package/dist/runtime/apps/registry.js +10 -0
  31. package/dist/runtime/components/Background/DesktopBackground.d.vue.ts +3 -0
  32. package/dist/runtime/components/Background/DesktopBackground.vue +3 -0
  33. package/dist/runtime/components/Background/DesktopBackground.vue.d.ts +3 -0
  34. package/dist/runtime/components/Desktop/DesktopContent.d.vue.ts +13 -0
  35. package/dist/runtime/components/Desktop/DesktopContent.vue +23 -0
  36. package/dist/runtime/components/Desktop/DesktopContent.vue.d.ts +13 -0
  37. package/dist/runtime/components/Desktop.client.d.vue.ts +23 -0
  38. package/dist/runtime/components/Desktop.client.vue +47 -0
  39. package/dist/runtime/components/Desktop.client.vue.d.ts +23 -0
  40. package/dist/runtime/components/NuxtLauncherOverlay.d.vue.ts +3 -0
  41. package/dist/runtime/components/NuxtLauncherOverlay.vue +69 -0
  42. package/dist/runtime/components/NuxtLauncherOverlay.vue.d.ts +3 -0
  43. package/dist/runtime/components/NuxtTopBar.d.vue.ts +3 -0
  44. package/dist/runtime/components/NuxtTopBar.vue +63 -0
  45. package/dist/runtime/components/NuxtTopBar.vue.d.ts +3 -0
  46. package/dist/runtime/components/Window/DesktopWindow.d.vue.ts +43 -0
  47. package/dist/runtime/components/Window/DesktopWindow.vue +40 -0
  48. package/dist/runtime/components/Window/DesktopWindow.vue.d.ts +43 -0
  49. package/dist/runtime/components/Window/DesktopWindowContent.d.vue.ts +13 -0
  50. package/dist/runtime/components/Window/DesktopWindowContent.vue +9 -0
  51. package/dist/runtime/components/Window/DesktopWindowContent.vue.d.ts +13 -0
  52. package/dist/runtime/components/Window/DesktopWindowIframe.d.vue.ts +29 -0
  53. package/dist/runtime/components/Window/DesktopWindowIframe.vue +13 -0
  54. package/dist/runtime/components/Window/DesktopWindowIframe.vue.d.ts +29 -0
  55. package/dist/runtime/components/Window/DesktopWindowNav.d.vue.ts +3 -0
  56. package/dist/runtime/components/Window/DesktopWindowNav.vue +105 -0
  57. package/dist/runtime/components/Window/DesktopWindowNav.vue.d.ts +3 -0
  58. package/dist/runtime/composables/useNuxtStartMenu.d.ts +9 -0
  59. package/dist/runtime/composables/useNuxtStartMenu.js +57 -0
  60. package/dist/types.d.mts +7 -0
  61. package/package.json +70 -4
  62. package/src/i18n/locales/en.ts +1 -0
  63. package/src/module.ts +69 -0
  64. package/src/runtime/apps/calculator/app.config.ts +35 -0
  65. package/src/runtime/apps/calculator/components/Window/WindowCalculator.vue +95 -0
  66. package/src/runtime/apps/calculator/plugin.ts +12 -0
  67. package/src/runtime/apps/explorer/app.config.ts +39 -0
  68. package/src/runtime/apps/explorer/components/Window/WindowExplorer.vue +34 -0
  69. package/src/runtime/apps/explorer/plugin.ts +12 -0
  70. package/src/runtime/apps/installBuiltInApps.ts +36 -0
  71. package/src/runtime/apps/notepad/app.config.ts +35 -0
  72. package/src/runtime/apps/notepad/components/Window/WindowNotepad.vue +46 -0
  73. package/src/runtime/apps/notepad/plugin.ts +12 -0
  74. package/src/runtime/apps/registry.ts +21 -0
  75. package/src/runtime/components/Background/DesktopBackground.vue +3 -0
  76. package/src/runtime/components/Desktop/DesktopContent.vue +37 -0
  77. package/src/runtime/components/Desktop.client.vue +55 -0
  78. package/src/runtime/components/NuxtLauncherOverlay.vue +71 -0
  79. package/src/runtime/components/NuxtTopBar.vue +68 -0
  80. package/src/runtime/components/Window/DesktopWindow.vue +44 -0
  81. package/src/runtime/components/Window/DesktopWindowContent.vue +17 -0
  82. package/src/runtime/components/Window/DesktopWindowIframe.vue +13 -0
  83. package/src/runtime/components/Window/DesktopWindowNav.vue +110 -0
  84. package/src/runtime/composables/useNuxtStartMenu.ts +72 -0
  85. package/README.md +0 -3
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default {};
@@ -0,0 +1,7 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ declare const _default: {
4
+ with: <TOptionsDefaults extends Partial<_nuxt_schema.ModuleOptions>>(definition: _nuxt_schema.ModuleDefinition<_nuxt_schema.ModuleOptions, TOptionsDefaults, true> | _nuxt_schema.NuxtModule<_nuxt_schema.ModuleOptions, TOptionsDefaults, true>) => _nuxt_schema.NuxtModule<_nuxt_schema.ModuleOptions, TOptionsDefaults, true>;
5
+ };
6
+
7
+ export { _default as default };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "desktop-theme-nuxt",
3
+ "configKey": "desktop",
4
+ "version": "4.0.0-alpha.3",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.3",
7
+ "unbuild": "3.6.1"
8
+ }
9
+ }
@@ -0,0 +1,50 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { createResolver, installModule, addComponentsDir, addImportsDir } from '@nuxt/kit';
3
+ import { defineDesktopTheme } from '@owdproject/nuxt';
4
+ import { registerThemeTailwindPath, registerTailwindPath } from '@owdproject/nuxt-kit-nuxt-ui/kit/registerTailwindPath';
5
+ import { installNuxtBuiltInApps } from '../dist/runtime/apps/installBuiltInApps.js';
6
+
7
+ const module$1 = defineDesktopTheme({
8
+ meta: {
9
+ name: "desktop-theme-nuxt"
10
+ },
11
+ defaults: {
12
+ name: "nuxt",
13
+ systemBar: {
14
+ enabled: true,
15
+ position: "top",
16
+ startButton: true
17
+ },
18
+ windows: {
19
+ position: "fixed"
20
+ }
21
+ },
22
+ async setup(_options, nuxt) {
23
+ const { resolve } = createResolver(import.meta.url);
24
+ await installModule("@owdproject/nuxt-kit-nuxt-ui");
25
+ registerThemeTailwindPath(nuxt, import.meta.url);
26
+ registerTailwindPath(nuxt, resolve("./runtime/pages/**/*.{vue,mjs,ts}"));
27
+ addComponentsDir({
28
+ path: resolve("./runtime/components"),
29
+ pathPrefix: false
30
+ });
31
+ nuxt.hook("i18n:registerModule", (register) => {
32
+ register({
33
+ langDir: resolve("./i18n"),
34
+ locales: [
35
+ {
36
+ code: "en",
37
+ file: existsSync(resolve("./i18n/locales/en.js")) ? "locales/en.js" : "locales/en.ts"
38
+ }
39
+ ]
40
+ });
41
+ });
42
+ addImportsDir(resolve("./runtime/composables"));
43
+ addImportsDir(resolve("./runtime/consts"));
44
+ addImportsDir(resolve("./runtime/stores"));
45
+ addImportsDir(resolve("./runtime/utils"));
46
+ installNuxtBuiltInApps(nuxt, import.meta.url);
47
+ }
48
+ });
49
+
50
+ export { module$1 as default };
@@ -0,0 +1,34 @@
1
+ declare const _default: {
2
+ id: string;
3
+ title: string;
4
+ singleton: boolean;
5
+ icon: string;
6
+ provides: {
7
+ name: string;
8
+ entry: string;
9
+ };
10
+ windows: {
11
+ main: {
12
+ component: () => Promise<any>;
13
+ resizable: boolean;
14
+ size: {
15
+ width: number;
16
+ height: number;
17
+ };
18
+ position: {
19
+ x: number;
20
+ y: number;
21
+ z: number;
22
+ };
23
+ };
24
+ };
25
+ entries: {
26
+ calculator: {
27
+ command: string;
28
+ };
29
+ };
30
+ commands: {
31
+ calculator: (app: any) => void;
32
+ };
33
+ };
34
+ export default _default;
@@ -0,0 +1,35 @@
1
+ export default {
2
+ id: "org.owdproject.calculator",
3
+ title: "Calculator",
4
+ singleton: false,
5
+ icon: "i-heroicons-calculator",
6
+ provides: {
7
+ name: "calculator",
8
+ entry: "calculator"
9
+ },
10
+ windows: {
11
+ main: {
12
+ component: () => import("./components/Window/WindowCalculator.vue"),
13
+ resizable: false,
14
+ size: {
15
+ width: 260,
16
+ height: 380
17
+ },
18
+ position: {
19
+ x: 200,
20
+ y: 150,
21
+ z: 0
22
+ }
23
+ }
24
+ },
25
+ entries: {
26
+ calculator: {
27
+ command: "calculator"
28
+ }
29
+ },
30
+ commands: {
31
+ calculator: (app) => {
32
+ app.openWindow("main");
33
+ }
34
+ }
35
+ };
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ window: any;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,85 @@
1
+ <script setup>
2
+ import { ref } from "vue";
3
+ defineProps({
4
+ window: { type: null, required: true }
5
+ });
6
+ const display = ref("0");
7
+ const equation = ref("");
8
+ const isFinished = ref(false);
9
+ const buttons = [
10
+ ["C", "(", ")", "/"],
11
+ ["7", "8", "9", "*"],
12
+ ["4", "5", "6", "-"],
13
+ ["1", "2", "3", "+"],
14
+ ["0", ".", "=", ""]
15
+ ];
16
+ function handleClick(val) {
17
+ if (val === "=") {
18
+ calculate();
19
+ } else if (val === "C") {
20
+ clear();
21
+ } else if (val === "") {
22
+ } else {
23
+ append(val);
24
+ }
25
+ }
26
+ function append(val) {
27
+ if (isFinished.value) {
28
+ display.value = "";
29
+ isFinished.value = false;
30
+ }
31
+ if (display.value === "0" && val !== ".") {
32
+ display.value = val;
33
+ } else {
34
+ display.value += val;
35
+ }
36
+ }
37
+ function clear() {
38
+ display.value = "0";
39
+ equation.value = "";
40
+ isFinished.value = false;
41
+ }
42
+ function calculate() {
43
+ try {
44
+ const expr = display.value;
45
+ if (/^[0-9+\-*/().\s]+$/.test(expr)) {
46
+ const res = eval(expr);
47
+ equation.value = expr + " =";
48
+ display.value = String(res);
49
+ isFinished.value = true;
50
+ } else {
51
+ display.value = "Error";
52
+ }
53
+ } catch (e) {
54
+ display.value = "Error";
55
+ }
56
+ }
57
+ </script>
58
+
59
+ <template>
60
+ <DesktopWindow :window="window" class="h-full bg-gray-50 dark:bg-gray-950 flex flex-col p-3">
61
+ <!-- Calculator screen -->
62
+ <div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-lg p-3 mb-3 text-right shadow-inner flex-shrink-0">
63
+ <div class="text-xs text-gray-400 dark:text-gray-500 h-4 mb-0.5 truncate">{{ equation }}</div>
64
+ <div class="text-2xl font-bold font-mono text-gray-800 dark:text-gray-100 truncate">{{ display }}</div>
65
+ </div>
66
+
67
+ <!-- Buttons Grid -->
68
+ <div class="grid grid-cols-4 gap-2 flex-1">
69
+ <template v-for="(row, rIdx) in buttons" :key="rIdx">
70
+ <template v-for="(btn, bIdx) in row" :key="bIdx">
71
+ <UButton
72
+ v-if="btn !== ''"
73
+ :label="btn"
74
+ size="md"
75
+ class="flex items-center justify-center font-bold text-sm h-11 w-full"
76
+ :color="btn === '=' ? 'primary' : btn === 'C' ? 'red' : ['/', '*', '-', '+'].includes(btn) ? 'orange' : 'gray'"
77
+ variant="solid"
78
+ @click="handleClick(btn)"
79
+ />
80
+ <div v-else class="h-11 w-full" />
81
+ </template>
82
+ </template>
83
+ </div>
84
+ </DesktopWindow>
85
+ </template>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ window: any;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { defineNuxtPlugin } from "nuxt/app";
2
+ import { defineDesktopApp } from "@owdproject/nuxt/kit/defineDesktopApp";
3
+ import configAppCalculator from "./app.config.js";
4
+ export default defineNuxtPlugin({
5
+ name: "desktop-theme-nuxt-calculator",
6
+ dependsOn: ["pinia", "desktop-shell-init"],
7
+ async setup() {
8
+ if (import.meta.server) return;
9
+ await defineDesktopApp(configAppCalculator);
10
+ }
11
+ });
@@ -0,0 +1,36 @@
1
+ declare const _default: {
2
+ id: string;
3
+ title: string;
4
+ singleton: boolean;
5
+ icon: string;
6
+ provides: {
7
+ name: string;
8
+ entry: string;
9
+ };
10
+ windows: {
11
+ main: {
12
+ component: () => Promise<any>;
13
+ resizable: boolean;
14
+ size: {
15
+ width: number;
16
+ height: number;
17
+ minWidth: number;
18
+ minHeight: number;
19
+ };
20
+ position: {
21
+ x: number;
22
+ y: number;
23
+ z: number;
24
+ };
25
+ };
26
+ };
27
+ entries: {
28
+ explorer: {
29
+ command: string;
30
+ };
31
+ };
32
+ commands: {
33
+ explorer: (app: any, args: any) => void;
34
+ };
35
+ };
36
+ export default _default;
@@ -0,0 +1,39 @@
1
+ export default {
2
+ id: "org.owdproject.explorer",
3
+ title: "Explorer",
4
+ singleton: false,
5
+ icon: "i-heroicons-folder-open",
6
+ provides: {
7
+ name: "explorer",
8
+ entry: "explorer"
9
+ },
10
+ windows: {
11
+ main: {
12
+ component: () => import("./components/Window/WindowExplorer.vue"),
13
+ resizable: true,
14
+ size: {
15
+ width: 720,
16
+ height: 480,
17
+ minWidth: 560,
18
+ minHeight: 440
19
+ },
20
+ position: {
21
+ x: 120,
22
+ y: 80,
23
+ z: 0
24
+ }
25
+ }
26
+ },
27
+ entries: {
28
+ explorer: {
29
+ command: "explorer /"
30
+ }
31
+ },
32
+ commands: {
33
+ explorer: (app, args) => {
34
+ const a = args;
35
+ const pathArg = a?._?.[1];
36
+ app.openWindow("main", void 0, { path: pathArg ?? "/" });
37
+ }
38
+ }
39
+ };
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ window: any;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,30 @@
1
+ <script setup>
2
+ import { useI18n } from "vue-i18n";
3
+ import { inject } from "vue";
4
+ import { DESKTOP_DIALOG_PROVIDER_KEY } from "@owdproject/nuxt/runtime/constants/desktopShellKeys";
5
+ import { createExplorerWindowMenuItems } from "@owdproject/nuxt-module-fs/runtime/composables/useExplorerWindowMenu";
6
+ const props = defineProps({
7
+ window: { type: null, required: true }
8
+ });
9
+ const { t } = useI18n();
10
+ const dialogs = inject(DESKTOP_DIALOG_PROVIDER_KEY);
11
+ const explorerMenu = createExplorerWindowMenuItems(
12
+ () => props.window,
13
+ t,
14
+ () => {
15
+ dialogs?.alert("Nuxt UI theme explorer powered by module-fs!", { title: "About Explorer" });
16
+ }
17
+ );
18
+ props.window.setMenu(explorerMenu);
19
+ </script>
20
+
21
+ <template>
22
+ <DesktopExplorerWorkspace
23
+ :window="window"
24
+ frame-class="nuxt-explorer-frame"
25
+ >
26
+ <template #nav>
27
+ <DesktopWindowNav />
28
+ </template>
29
+ </DesktopExplorerWorkspace>
30
+ </template>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ window: any;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { defineNuxtPlugin } from "nuxt/app";
2
+ import { defineDesktopApp } from "@owdproject/nuxt/kit/defineDesktopApp";
3
+ import configAppExplorer from "./app.config.js";
4
+ export default defineNuxtPlugin({
5
+ name: "desktop-theme-nuxt-explorer",
6
+ dependsOn: ["pinia", "desktop-shell-init"],
7
+ async setup() {
8
+ if (import.meta.server) return;
9
+ await defineDesktopApp(configAppExplorer);
10
+ }
11
+ });
@@ -0,0 +1,3 @@
1
+ import type { Nuxt } from '@nuxt/schema';
2
+ /** Register autoload built-in apps from `runtime/apps/<name>/`. */
3
+ export declare function installNuxtBuiltInApps(nuxt: Nuxt, themeRoot: string): void;
@@ -0,0 +1,28 @@
1
+ import {
2
+ addComponentsDir,
3
+ addPlugin,
4
+ createResolver
5
+ } from "@nuxt/kit";
6
+ import { registerTailwindPath } from "@owdproject/nuxt-kit-nuxt-ui/kit/registerTailwindPath";
7
+ import { NUXT_THEME_BUILTIN_APPS } from "./registry.js";
8
+ export function installNuxtBuiltInApps(nuxt, themeRoot) {
9
+ const { resolve } = createResolver(themeRoot);
10
+ for (const app of NUXT_THEME_BUILTIN_APPS) {
11
+ if (!app.autoload) continue;
12
+ if (app.when && !app.when(nuxt)) continue;
13
+ const appRoot = resolve(`./runtime/apps/${app.name}`);
14
+ addPlugin({
15
+ src: resolve(appRoot, "plugin"),
16
+ mode: "client",
17
+ name: `desktop-theme-nuxt-${app.name}`,
18
+ order: 1
19
+ });
20
+ addComponentsDir({
21
+ path: resolve(appRoot, "components")
22
+ });
23
+ registerTailwindPath(
24
+ nuxt,
25
+ resolve(appRoot, "components/**/*.{vue,mjs,ts}")
26
+ );
27
+ }
28
+ }
@@ -0,0 +1,34 @@
1
+ declare const _default: {
2
+ id: string;
3
+ title: string;
4
+ singleton: boolean;
5
+ icon: string;
6
+ provides: {
7
+ name: string;
8
+ entry: string;
9
+ };
10
+ windows: {
11
+ main: {
12
+ component: () => Promise<any>;
13
+ resizable: boolean;
14
+ size: {
15
+ width: number;
16
+ height: number;
17
+ };
18
+ position: {
19
+ x: number;
20
+ y: number;
21
+ z: number;
22
+ };
23
+ };
24
+ };
25
+ entries: {
26
+ notepad: {
27
+ command: string;
28
+ };
29
+ };
30
+ commands: {
31
+ notepad: (app: any) => void;
32
+ };
33
+ };
34
+ export default _default;
@@ -0,0 +1,35 @@
1
+ export default {
2
+ id: "org.owdproject.notepad",
3
+ title: "Notepad",
4
+ singleton: false,
5
+ icon: "i-heroicons-document-text",
6
+ provides: {
7
+ name: "notepad",
8
+ entry: "notepad"
9
+ },
10
+ windows: {
11
+ main: {
12
+ component: () => import("./components/Window/WindowNotepad.vue"),
13
+ resizable: true,
14
+ size: {
15
+ width: 600,
16
+ height: 400
17
+ },
18
+ position: {
19
+ x: 180,
20
+ y: 120,
21
+ z: 0
22
+ }
23
+ }
24
+ },
25
+ entries: {
26
+ notepad: {
27
+ command: "notepad"
28
+ }
29
+ },
30
+ commands: {
31
+ notepad: (app) => {
32
+ app.openWindow("main");
33
+ }
34
+ }
35
+ };
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ window: any;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,43 @@
1
+ <script setup>
2
+ import { ref } from "vue";
3
+ defineProps({
4
+ window: { type: null, required: true }
5
+ });
6
+ const text = ref("");
7
+ function clear() {
8
+ text.value = "";
9
+ }
10
+ </script>
11
+
12
+ <template>
13
+ <DesktopWindow :window="window" class="h-full bg-white dark:bg-gray-950 flex flex-col">
14
+ <!-- Toolbar -->
15
+ <div class="flex items-center space-x-2 p-2 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800 flex-shrink-0">
16
+ <UButton
17
+ icon="i-heroicons-document"
18
+ label="New"
19
+ color="gray"
20
+ variant="ghost"
21
+ size="xs"
22
+ @click="clear"
23
+ />
24
+ <UButton
25
+ icon="i-heroicons-trash"
26
+ label="Clear"
27
+ color="red"
28
+ variant="ghost"
29
+ size="xs"
30
+ @click="clear"
31
+ />
32
+ </div>
33
+
34
+ <!-- Text area -->
35
+ <div class="flex-1 min-h-0">
36
+ <textarea
37
+ v-model="text"
38
+ class="w-full h-full p-4 resize-none outline-none border-0 text-sm font-mono bg-transparent text-gray-800 dark:text-gray-200"
39
+ placeholder="Type here..."
40
+ />
41
+ </div>
42
+ </DesktopWindow>
43
+ </template>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ window: any;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { defineNuxtPlugin } from "nuxt/app";
2
+ import { defineDesktopApp } from "@owdproject/nuxt/kit/defineDesktopApp";
3
+ import configAppNotepad from "./app.config.js";
4
+ export default defineNuxtPlugin({
5
+ name: "desktop-theme-nuxt-notepad",
6
+ dependsOn: ["pinia", "desktop-shell-init"],
7
+ async setup() {
8
+ if (import.meta.server) return;
9
+ await defineDesktopApp(configAppNotepad);
10
+ }
11
+ });
@@ -0,0 +1,8 @@
1
+ import type { Nuxt } from '@nuxt/schema';
2
+ export type NuxtThemeBuiltInApp = {
3
+ name: string;
4
+ autoload: boolean;
5
+ when?: (nuxt: Nuxt) => boolean;
6
+ };
7
+ export declare function hasModuleFs(nuxt: Nuxt): boolean;
8
+ export declare const NUXT_THEME_BUILTIN_APPS: NuxtThemeBuiltInApp[];
@@ -0,0 +1,10 @@
1
+ export function hasModuleFs(nuxt) {
2
+ const desktop = nuxt.options.runtimeConfig.public.desktop;
3
+ const modules = desktop?.modules ?? [];
4
+ return modules.some((m) => String(m).includes("nuxt-fs"));
5
+ }
6
+ export const NUXT_THEME_BUILTIN_APPS = [
7
+ { name: "explorer", autoload: true },
8
+ { name: "calculator", autoload: true },
9
+ { name: "notepad", autoload: true }
10
+ ];
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <DesktopCoreBackground />
3
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+ import { useAppConfig } from "nuxt/app";
3
+ import { computed } from "vue";
4
+ const appConfig = useAppConfig();
5
+ const classes = computed(() => {
6
+ const list = ["owd-desktop__content"];
7
+ const pos = appConfig.desktop?.systemBar?.position;
8
+ if (pos) {
9
+ list.push(`owd-desktop__content--system-bar-position-${pos}`);
10
+ }
11
+ return list;
12
+ });
13
+ </script>
14
+
15
+ <template>
16
+ <div :class="classes">
17
+ <slot />
18
+ </div>
19
+ </template>
20
+
21
+ <style scoped>
22
+ .owd-desktop__content{height:100%;overflow:hidden;position:relative;width:100%}.owd-desktop__content--system-bar-position-bottom,.owd-desktop__content--system-bar-position-top{flex:1 1 auto;min-height:0}
23
+ </style>