@owdproject/nuxt-kit-nuxt-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/module.d.mts +14 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +112 -0
- package/dist/runtime/components/dialogs/NuxtUIAlertModal.d.vue.ts +8 -0
- package/dist/runtime/components/dialogs/NuxtUIAlertModal.vue +40 -0
- package/dist/runtime/components/dialogs/NuxtUIAlertModal.vue.d.ts +8 -0
- package/dist/runtime/components/dialogs/NuxtUIConfirmModal.d.vue.ts +12 -0
- package/dist/runtime/components/dialogs/NuxtUIConfirmModal.vue +47 -0
- package/dist/runtime/components/dialogs/NuxtUIConfirmModal.vue.d.ts +12 -0
- package/dist/runtime/components/explorer/AddressBar.d.vue.ts +17 -0
- package/dist/runtime/components/explorer/AddressBar.vue +39 -0
- package/dist/runtime/components/explorer/AddressBar.vue.d.ts +17 -0
- package/dist/runtime/components/explorer/Chrome.d.vue.ts +13 -0
- package/dist/runtime/components/explorer/Chrome.vue +5 -0
- package/dist/runtime/components/explorer/Chrome.vue.d.ts +13 -0
- package/dist/runtime/components/explorer/DefaultToolbar.d.vue.ts +31 -0
- package/dist/runtime/components/explorer/DefaultToolbar.vue +92 -0
- package/dist/runtime/components/explorer/DefaultToolbar.vue.d.ts +31 -0
- package/dist/runtime/components/explorer/FileContextMenu.d.vue.ts +18 -0
- package/dist/runtime/components/explorer/FileContextMenu.vue +90 -0
- package/dist/runtime/components/explorer/FileContextMenu.vue.d.ts +18 -0
- package/dist/runtime/components/explorer/FileEntry.d.vue.ts +109 -0
- package/dist/runtime/components/explorer/FileEntry.vue +263 -0
- package/dist/runtime/components/explorer/FileEntry.vue.d.ts +109 -0
- package/dist/runtime/components/explorer/FileIcon.d.vue.ts +29 -0
- package/dist/runtime/components/explorer/FileIcon.vue +41 -0
- package/dist/runtime/components/explorer/FileIcon.vue.d.ts +29 -0
- package/dist/runtime/components/explorer/FilePane.d.vue.ts +13 -0
- package/dist/runtime/components/explorer/FilePane.vue +5 -0
- package/dist/runtime/components/explorer/FilePane.vue.d.ts +13 -0
- package/dist/runtime/components/explorer/Frame.d.vue.ts +75 -0
- package/dist/runtime/components/explorer/Frame.vue +73 -0
- package/dist/runtime/components/explorer/Frame.vue.d.ts +75 -0
- package/dist/runtime/components/explorer/Nav.d.vue.ts +17 -0
- package/dist/runtime/components/explorer/Nav.vue +83 -0
- package/dist/runtime/components/explorer/Nav.vue.d.ts +17 -0
- package/dist/runtime/components/explorer/SelectableArea.d.vue.ts +33 -0
- package/dist/runtime/components/explorer/SelectableArea.vue +83 -0
- package/dist/runtime/components/explorer/SelectableArea.vue.d.ts +33 -0
- package/dist/runtime/components/explorer/Workspace.d.vue.ts +24 -0
- package/dist/runtime/components/explorer/Workspace.vue +116 -0
- package/dist/runtime/components/explorer/Workspace.vue.d.ts +24 -0
- package/dist/runtime/dialogs/createDesktopDialogs.d.ts +2 -0
- package/dist/runtime/dialogs/createDesktopDialogs.js +47 -0
- package/dist/runtime/plugins/01.desktop-nuxt-ui-dialogs.client.d.ts +2 -0
- package/dist/runtime/plugins/01.desktop-nuxt-ui-dialogs.client.js +13 -0
- package/dist/types.d.mts +9 -0
- package/package.json +78 -4
- package/src/kit/registerTailwindPath.ts +44 -0
- package/src/runtime/components/dialogs/NuxtUIAlertModal.vue +42 -0
- package/src/runtime/components/dialogs/NuxtUIConfirmModal.vue +49 -0
- package/src/runtime/components/explorer/AddressBar.vue +44 -0
- package/src/runtime/components/explorer/Chrome.vue +5 -0
- package/src/runtime/components/explorer/DefaultToolbar.vue +92 -0
- package/src/runtime/components/explorer/FileContextMenu.vue +99 -0
- package/src/runtime/components/explorer/FileEntry.vue +286 -0
- package/src/runtime/components/explorer/FileIcon.vue +43 -0
- package/src/runtime/components/explorer/FilePane.vue +5 -0
- package/src/runtime/components/explorer/Frame.vue +106 -0
- package/src/runtime/components/explorer/Nav.vue +87 -0
- package/src/runtime/components/explorer/SelectableArea.vue +93 -0
- package/src/runtime/components/explorer/Workspace.vue +119 -0
- package/src/runtime/dialogs/createDesktopDialogs.ts +56 -0
- package/src/runtime/plugins/01.desktop-nuxt-ui-dialogs.client.ts +14 -0
- package/README.md +0 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
|
|
3
|
+
interface KitNuxtUiModuleOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Register `DesktopExplorer*` components (Workspace, FileEntry, …).
|
|
6
|
+
* Requires `@owdproject/nuxt-module-fs` in the app when enabled (default).
|
|
7
|
+
* Set `false` for Nuxt UI + dialogs only.
|
|
8
|
+
*/
|
|
9
|
+
explorer?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: _nuxt_schema.NuxtModule<KitNuxtUiModuleOptions, KitNuxtUiModuleOptions, false>;
|
|
12
|
+
|
|
13
|
+
export { _default as default };
|
|
14
|
+
export type { KitNuxtUiModuleOptions };
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, installModule, addPlugin, addComponentsDir } from '@nuxt/kit';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { resolve, dirname } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
function tailwindContentPaths(nuxt) {
|
|
7
|
+
nuxt.options.desktopTailwindContent ??= [];
|
|
8
|
+
return nuxt.options.desktopTailwindContent;
|
|
9
|
+
}
|
|
10
|
+
function registerTailwindPath(nuxt, path) {
|
|
11
|
+
const paths = tailwindContentPaths(nuxt);
|
|
12
|
+
if (!paths.includes(path)) {
|
|
13
|
+
paths.push(path);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function resolveNuxtUiDistDir() {
|
|
18
|
+
try {
|
|
19
|
+
const resolveMeta = import.meta.resolve;
|
|
20
|
+
const resolved = resolveMeta?.("@nuxt/ui");
|
|
21
|
+
if (resolved) {
|
|
22
|
+
const distDir = dirname(fileURLToPath(resolved));
|
|
23
|
+
if (existsSync(resolve(distDir, "runtime/ui.config"))) return distDir;
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
function registerNuxtUiTailwindContent(nuxt) {
|
|
30
|
+
const distDir = resolveNuxtUiDistDir();
|
|
31
|
+
if (!distDir) return;
|
|
32
|
+
registerTailwindPath(nuxt, resolve(distDir, "runtime/components/**/*.{vue,mjs,ts}"));
|
|
33
|
+
registerTailwindPath(nuxt, resolve(distDir, "runtime/ui.config/**/*.{mjs,js,ts}"));
|
|
34
|
+
}
|
|
35
|
+
function flattenTailwindContentPaths(content) {
|
|
36
|
+
const paths = [];
|
|
37
|
+
if (typeof content === "string") {
|
|
38
|
+
paths.push(content);
|
|
39
|
+
return paths;
|
|
40
|
+
}
|
|
41
|
+
if (Array.isArray(content)) {
|
|
42
|
+
for (const entry of content) {
|
|
43
|
+
paths.push(...flattenTailwindContentPaths(entry));
|
|
44
|
+
}
|
|
45
|
+
return paths;
|
|
46
|
+
}
|
|
47
|
+
if (content && typeof content === "object") {
|
|
48
|
+
const record = content;
|
|
49
|
+
if (Array.isArray(record.files)) {
|
|
50
|
+
for (const entry of record.files) {
|
|
51
|
+
if (typeof entry === "string") paths.push(entry);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
for (const [key, value] of Object.entries(record)) {
|
|
55
|
+
if (key === "files") continue;
|
|
56
|
+
paths.push(...flattenTailwindContentPaths(value));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return paths;
|
|
60
|
+
}
|
|
61
|
+
function mergeDesktopTailwindContent(nuxt, config) {
|
|
62
|
+
const registered = [...nuxt.options.desktopTailwindContent ?? []];
|
|
63
|
+
const prior = flattenTailwindContentPaths(config.content);
|
|
64
|
+
const merged = [.../* @__PURE__ */ new Set([...prior, ...registered])];
|
|
65
|
+
if (merged.length > 0) {
|
|
66
|
+
config.content = { files: merged };
|
|
67
|
+
}
|
|
68
|
+
if (nuxt.options.dev && merged.length > 0) {
|
|
69
|
+
console.info(
|
|
70
|
+
"[desktop-kit-nuxt-ui] Tailwind content:",
|
|
71
|
+
merged.length,
|
|
72
|
+
"paths"
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const module$1 = defineNuxtModule({
|
|
77
|
+
meta: {
|
|
78
|
+
name: "desktop-kit-nuxt-ui",
|
|
79
|
+
configKey: "kitNuxtUi"
|
|
80
|
+
},
|
|
81
|
+
defaults: {
|
|
82
|
+
explorer: true
|
|
83
|
+
},
|
|
84
|
+
async setup(options, nuxt) {
|
|
85
|
+
const { resolve } = createResolver(import.meta.url);
|
|
86
|
+
nuxt.hook("tailwindcss:config", (config) => {
|
|
87
|
+
mergeDesktopTailwindContent(nuxt, config);
|
|
88
|
+
});
|
|
89
|
+
await installModule("@nuxt/ui", {
|
|
90
|
+
global: true
|
|
91
|
+
});
|
|
92
|
+
registerNuxtUiTailwindContent(nuxt);
|
|
93
|
+
addPlugin({
|
|
94
|
+
src: resolve("./runtime/plugins/01.desktop-nuxt-ui-dialogs.client"),
|
|
95
|
+
mode: "client",
|
|
96
|
+
order: 1
|
|
97
|
+
});
|
|
98
|
+
if (options.explorer !== false) {
|
|
99
|
+
addComponentsDir({
|
|
100
|
+
path: resolve("./runtime/components/explorer"),
|
|
101
|
+
prefix: "DesktopExplorer",
|
|
102
|
+
pathPrefix: false
|
|
103
|
+
});
|
|
104
|
+
registerTailwindPath(
|
|
105
|
+
nuxt,
|
|
106
|
+
resolve("./runtime/components/explorer/**/*.{vue,mjs,ts}")
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
message: string;
|
|
4
|
+
onSuccess: () => void;
|
|
5
|
+
};
|
|
6
|
+
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>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
defineProps({
|
|
4
|
+
title: { type: String, required: true },
|
|
5
|
+
message: { type: String, required: true },
|
|
6
|
+
onSuccess: { type: Function, required: true }
|
|
7
|
+
});
|
|
8
|
+
const isOpen = ref(true);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<UModal v-model="isOpen" prevent-close>
|
|
13
|
+
<UCard :ui="{ ring: '', divide: 'y divide-gray-100 dark:divide-gray-800' }">
|
|
14
|
+
<template #header>
|
|
15
|
+
<div class="flex items-center justify-between">
|
|
16
|
+
<h3 class="text-base font-semibold leading-6 text-gray-900 dark:text-white">
|
|
17
|
+
{{ title }}
|
|
18
|
+
</h3>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<div class="flex items-start space-x-4">
|
|
23
|
+
<div class="text-blue-500 flex-shrink-0 mt-0.5">
|
|
24
|
+
<UIcon name="i-heroicons-information-circle" class="w-6 h-6" />
|
|
25
|
+
</div>
|
|
26
|
+
<div class="text-sm text-gray-600 dark:text-gray-300">
|
|
27
|
+
{{ message }}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<template #footer>
|
|
32
|
+
<div class="flex justify-end">
|
|
33
|
+
<UButton color="primary" @click="onSuccess">
|
|
34
|
+
OK
|
|
35
|
+
</UButton>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
</UCard>
|
|
39
|
+
</UModal>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
message: string;
|
|
4
|
+
onSuccess: () => void;
|
|
5
|
+
};
|
|
6
|
+
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>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
message: string;
|
|
4
|
+
acceptLabel: string;
|
|
5
|
+
rejectLabel: string;
|
|
6
|
+
toTrash?: boolean;
|
|
7
|
+
onSuccess: () => void;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
};
|
|
10
|
+
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>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
defineProps({
|
|
4
|
+
title: { type: String, required: true },
|
|
5
|
+
message: { type: String, required: true },
|
|
6
|
+
acceptLabel: { type: String, required: true },
|
|
7
|
+
rejectLabel: { type: String, required: true },
|
|
8
|
+
toTrash: { type: Boolean, required: false },
|
|
9
|
+
onSuccess: { type: Function, required: true },
|
|
10
|
+
onCancel: { type: Function, required: true }
|
|
11
|
+
});
|
|
12
|
+
const isOpen = ref(true);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<UModal v-model="isOpen" prevent-close>
|
|
17
|
+
<UCard :ui="{ ring: '', divide: 'y divide-gray-100 dark:divide-gray-800' }">
|
|
18
|
+
<template #header>
|
|
19
|
+
<div class="flex items-center justify-between">
|
|
20
|
+
<h3 class="text-base font-semibold leading-6 text-gray-900 dark:text-white">
|
|
21
|
+
{{ title }}
|
|
22
|
+
</h3>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<div class="flex items-start space-x-4">
|
|
27
|
+
<div class="text-amber-500 flex-shrink-0 mt-0.5">
|
|
28
|
+
<UIcon name="i-heroicons-exclamation-triangle" class="w-6 h-6" />
|
|
29
|
+
</div>
|
|
30
|
+
<div class="text-sm text-gray-600 dark:text-gray-300">
|
|
31
|
+
{{ message }}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<template #footer>
|
|
36
|
+
<div class="flex justify-end space-x-2">
|
|
37
|
+
<UButton color="gray" variant="ghost" @click="onCancel">
|
|
38
|
+
{{ rejectLabel }}
|
|
39
|
+
</UButton>
|
|
40
|
+
<UButton color="primary" @click="onSuccess">
|
|
41
|
+
{{ acceptLabel }}
|
|
42
|
+
</UButton>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
</UCard>
|
|
46
|
+
</UModal>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
message: string;
|
|
4
|
+
acceptLabel: string;
|
|
5
|
+
rejectLabel: string;
|
|
6
|
+
toTrash?: boolean;
|
|
7
|
+
onSuccess: () => void;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
};
|
|
10
|
+
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>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
address: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (...args: any[]) => void;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
address: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, watch } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
formatExplorerDisplayPath,
|
|
5
|
+
parseExplorerVfsPath
|
|
6
|
+
} from "@owdproject/nuxt-module-fs/runtime/utils/utilExplorerDisplayPath";
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
address: { type: String, required: true }
|
|
9
|
+
});
|
|
10
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
11
|
+
const addressInput = ref(formatExplorerDisplayPath(props.address));
|
|
12
|
+
watch(
|
|
13
|
+
() => props.address,
|
|
14
|
+
(address) => {
|
|
15
|
+
addressInput.value = formatExplorerDisplayPath(address);
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
function onEnter() {
|
|
19
|
+
emit("update:modelValue", parseExplorerVfsPath(addressInput.value));
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<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">
|
|
25
|
+
<span class="text-xs font-semibold text-gray-500 dark:text-gray-400 select-none">
|
|
26
|
+
{{ $t("apps.explorer.address") }}
|
|
27
|
+
</span>
|
|
28
|
+
<UInput
|
|
29
|
+
v-model="addressInput"
|
|
30
|
+
class="flex-1"
|
|
31
|
+
size="sm"
|
|
32
|
+
color="gray"
|
|
33
|
+
variant="outline"
|
|
34
|
+
spellcheck="false"
|
|
35
|
+
icon="i-heroicons-folder-open"
|
|
36
|
+
@keydown.enter="onEnter"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
address: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (...args: any[]) => void;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
address: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
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,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,31 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
arrowsDisabled: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
back: (...args: any[]) => void;
|
|
8
|
+
forward: (...args: any[]) => void;
|
|
9
|
+
up: (...args: any[]) => void;
|
|
10
|
+
cut: (...args: any[]) => void;
|
|
11
|
+
copy: (...args: any[]) => void;
|
|
12
|
+
paste: (...args: any[]) => void;
|
|
13
|
+
delete: (...args: any[]) => void;
|
|
14
|
+
properties: (...args: any[]) => void;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
arrowsDisabled: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
}>> & Readonly<{
|
|
21
|
+
onBack?: ((...args: any[]) => any) | undefined;
|
|
22
|
+
onForward?: ((...args: any[]) => any) | undefined;
|
|
23
|
+
onUp?: ((...args: any[]) => any) | undefined;
|
|
24
|
+
onCut?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
onCopy?: ((...args: any[]) => any) | undefined;
|
|
26
|
+
onPaste?: ((...args: any[]) => any) | undefined;
|
|
27
|
+
onDelete?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
onProperties?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
arrowsDisabled: { type: Boolean, required: true }
|
|
4
|
+
});
|
|
5
|
+
defineEmits([
|
|
6
|
+
"back",
|
|
7
|
+
"forward",
|
|
8
|
+
"up",
|
|
9
|
+
"cut",
|
|
10
|
+
"copy",
|
|
11
|
+
"paste",
|
|
12
|
+
"delete",
|
|
13
|
+
"properties"
|
|
14
|
+
]);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div class="flex items-center space-x-1 p-2 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800">
|
|
19
|
+
<UButton
|
|
20
|
+
icon="i-heroicons-arrow-left"
|
|
21
|
+
color="gray"
|
|
22
|
+
variant="ghost"
|
|
23
|
+
size="sm"
|
|
24
|
+
:disabled="arrowsDisabled"
|
|
25
|
+
@click="$emit('back')"
|
|
26
|
+
:title="$t('apps.explorer.action.back')"
|
|
27
|
+
/>
|
|
28
|
+
<UButton
|
|
29
|
+
icon="i-heroicons-arrow-right"
|
|
30
|
+
color="gray"
|
|
31
|
+
variant="ghost"
|
|
32
|
+
size="sm"
|
|
33
|
+
:disabled="arrowsDisabled"
|
|
34
|
+
@click="$emit('forward')"
|
|
35
|
+
:title="$t('apps.explorer.action.forward')"
|
|
36
|
+
/>
|
|
37
|
+
<UButton
|
|
38
|
+
icon="i-heroicons-arrow-up-circle"
|
|
39
|
+
color="gray"
|
|
40
|
+
variant="ghost"
|
|
41
|
+
size="sm"
|
|
42
|
+
@click="$emit('up')"
|
|
43
|
+
:title="$t('apps.explorer.action.up')"
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
<div class="border-l border-gray-200 dark:border-gray-800 h-5 mx-1" />
|
|
47
|
+
|
|
48
|
+
<UButton
|
|
49
|
+
icon="i-heroicons-scissors"
|
|
50
|
+
color="gray"
|
|
51
|
+
variant="ghost"
|
|
52
|
+
size="sm"
|
|
53
|
+
@click="$emit('cut')"
|
|
54
|
+
:title="$t('apps.explorer.action.cut')"
|
|
55
|
+
/>
|
|
56
|
+
<UButton
|
|
57
|
+
icon="i-heroicons-document-duplicate"
|
|
58
|
+
color="gray"
|
|
59
|
+
variant="ghost"
|
|
60
|
+
size="sm"
|
|
61
|
+
@click="$emit('copy')"
|
|
62
|
+
:title="$t('apps.explorer.action.copy')"
|
|
63
|
+
/>
|
|
64
|
+
<UButton
|
|
65
|
+
icon="i-heroicons-clipboard"
|
|
66
|
+
color="gray"
|
|
67
|
+
variant="ghost"
|
|
68
|
+
size="sm"
|
|
69
|
+
@click="$emit('paste')"
|
|
70
|
+
:title="$t('apps.explorer.action.paste')"
|
|
71
|
+
/>
|
|
72
|
+
<UButton
|
|
73
|
+
icon="i-heroicons-trash"
|
|
74
|
+
color="red"
|
|
75
|
+
variant="ghost"
|
|
76
|
+
size="sm"
|
|
77
|
+
@click="$emit('delete')"
|
|
78
|
+
:title="$t('apps.explorer.action.delete')"
|
|
79
|
+
/>
|
|
80
|
+
|
|
81
|
+
<div class="border-l border-gray-200 dark:border-gray-800 h-5 mx-1" />
|
|
82
|
+
|
|
83
|
+
<UButton
|
|
84
|
+
icon="i-heroicons-information-circle"
|
|
85
|
+
color="gray"
|
|
86
|
+
variant="ghost"
|
|
87
|
+
size="sm"
|
|
88
|
+
@click="$emit('properties')"
|
|
89
|
+
:title="$t('apps.explorer.action.properties')"
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
arrowsDisabled: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
back: (...args: any[]) => void;
|
|
8
|
+
forward: (...args: any[]) => void;
|
|
9
|
+
up: (...args: any[]) => void;
|
|
10
|
+
cut: (...args: any[]) => void;
|
|
11
|
+
copy: (...args: any[]) => void;
|
|
12
|
+
paste: (...args: any[]) => void;
|
|
13
|
+
delete: (...args: any[]) => void;
|
|
14
|
+
properties: (...args: any[]) => void;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
arrowsDisabled: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
}>> & Readonly<{
|
|
21
|
+
onBack?: ((...args: any[]) => any) | undefined;
|
|
22
|
+
onForward?: ((...args: any[]) => any) | undefined;
|
|
23
|
+
onUp?: ((...args: any[]) => any) | undefined;
|
|
24
|
+
onCut?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
onCopy?: ((...args: any[]) => any) | undefined;
|
|
26
|
+
onPaste?: ((...args: any[]) => any) | undefined;
|
|
27
|
+
onDelete?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
onProperties?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
fileName: string;
|
|
3
|
+
window: any;
|
|
4
|
+
isDirectory?: boolean;
|
|
5
|
+
openPathInNewTab?: (p: string) => void;
|
|
6
|
+
};
|
|
7
|
+
declare function show(event: MouseEvent): void;
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
9
|
+
show: typeof show;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
open: (...args: any[]) => void;
|
|
12
|
+
rename: (...args: any[]) => void;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
15
|
+
onRename?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { explorerEntryAbsolutePath } from "@owdproject/nuxt-module-fs/runtime/utils/utilExplorerEntryPath";
|
|
5
|
+
const { t } = useI18n();
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
fileName: { type: String, required: true },
|
|
8
|
+
window: { type: null, required: true },
|
|
9
|
+
isDirectory: { type: Boolean, required: false },
|
|
10
|
+
openPathInNewTab: { type: Function, required: false }
|
|
11
|
+
});
|
|
12
|
+
const emit = defineEmits(["open", "rename"]);
|
|
13
|
+
const isOpen = ref(false);
|
|
14
|
+
const virtualElement = ref({ getBoundingClientRect: () => ({}) });
|
|
15
|
+
const entryPath = computed(
|
|
16
|
+
() => explorerEntryAbsolutePath(
|
|
17
|
+
props.window.fsExplorer.basePath.value,
|
|
18
|
+
props.fileName
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
function selectEntry() {
|
|
22
|
+
props.window.fsExplorer.selectFiles([entryPath.value]);
|
|
23
|
+
}
|
|
24
|
+
const items = computed(() => [
|
|
25
|
+
[
|
|
26
|
+
{
|
|
27
|
+
label: t("fs.contextMenu.open"),
|
|
28
|
+
click: () => {
|
|
29
|
+
emit("open", props.fileName);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
{
|
|
35
|
+
label: t("fs.contextMenu.cut"),
|
|
36
|
+
click: () => {
|
|
37
|
+
selectEntry();
|
|
38
|
+
props.window.fsExplorer.cutSelectedFiles();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: t("fs.contextMenu.copy"),
|
|
43
|
+
click: () => {
|
|
44
|
+
selectEntry();
|
|
45
|
+
props.window.fsExplorer.copySelectedFiles();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
{
|
|
51
|
+
label: t("fs.contextMenu.delete"),
|
|
52
|
+
click: () => {
|
|
53
|
+
selectEntry();
|
|
54
|
+
props.window.fsExplorer.fsController.deleteSelectedFiles();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: t("fs.contextMenu.rename"),
|
|
59
|
+
click: () => {
|
|
60
|
+
emit("rename", props.fileName);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
]);
|
|
65
|
+
function show(event) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
virtualElement.value = {
|
|
68
|
+
getBoundingClientRect: () => ({
|
|
69
|
+
width: 0,
|
|
70
|
+
height: 0,
|
|
71
|
+
top: event.clientY,
|
|
72
|
+
right: event.clientX,
|
|
73
|
+
bottom: event.clientY,
|
|
74
|
+
left: event.clientX
|
|
75
|
+
})
|
|
76
|
+
};
|
|
77
|
+
isOpen.value = true;
|
|
78
|
+
}
|
|
79
|
+
defineExpose({
|
|
80
|
+
show
|
|
81
|
+
});
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<UContextMenu v-model="isOpen" :virtual-element="virtualElement">
|
|
86
|
+
<UCard :ui="{ body: { padding: 'p-1' } }">
|
|
87
|
+
<UVerticalNavigation :links="[items[0], items[1], items[2]]" />
|
|
88
|
+
</UCard>
|
|
89
|
+
</UContextMenu>
|
|
90
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
fileName: string;
|
|
3
|
+
window: any;
|
|
4
|
+
isDirectory?: boolean;
|
|
5
|
+
openPathInNewTab?: (p: string) => void;
|
|
6
|
+
};
|
|
7
|
+
declare function show(event: MouseEvent): void;
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
9
|
+
show: typeof show;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
open: (...args: any[]) => void;
|
|
12
|
+
rename: (...args: any[]) => void;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
15
|
+
onRename?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|