@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.
Files changed (65) hide show
  1. package/dist/module.d.mts +14 -0
  2. package/dist/module.json +9 -0
  3. package/dist/module.mjs +112 -0
  4. package/dist/runtime/components/dialogs/NuxtUIAlertModal.d.vue.ts +8 -0
  5. package/dist/runtime/components/dialogs/NuxtUIAlertModal.vue +40 -0
  6. package/dist/runtime/components/dialogs/NuxtUIAlertModal.vue.d.ts +8 -0
  7. package/dist/runtime/components/dialogs/NuxtUIConfirmModal.d.vue.ts +12 -0
  8. package/dist/runtime/components/dialogs/NuxtUIConfirmModal.vue +47 -0
  9. package/dist/runtime/components/dialogs/NuxtUIConfirmModal.vue.d.ts +12 -0
  10. package/dist/runtime/components/explorer/AddressBar.d.vue.ts +17 -0
  11. package/dist/runtime/components/explorer/AddressBar.vue +39 -0
  12. package/dist/runtime/components/explorer/AddressBar.vue.d.ts +17 -0
  13. package/dist/runtime/components/explorer/Chrome.d.vue.ts +13 -0
  14. package/dist/runtime/components/explorer/Chrome.vue +5 -0
  15. package/dist/runtime/components/explorer/Chrome.vue.d.ts +13 -0
  16. package/dist/runtime/components/explorer/DefaultToolbar.d.vue.ts +31 -0
  17. package/dist/runtime/components/explorer/DefaultToolbar.vue +92 -0
  18. package/dist/runtime/components/explorer/DefaultToolbar.vue.d.ts +31 -0
  19. package/dist/runtime/components/explorer/FileContextMenu.d.vue.ts +18 -0
  20. package/dist/runtime/components/explorer/FileContextMenu.vue +90 -0
  21. package/dist/runtime/components/explorer/FileContextMenu.vue.d.ts +18 -0
  22. package/dist/runtime/components/explorer/FileEntry.d.vue.ts +109 -0
  23. package/dist/runtime/components/explorer/FileEntry.vue +263 -0
  24. package/dist/runtime/components/explorer/FileEntry.vue.d.ts +109 -0
  25. package/dist/runtime/components/explorer/FileIcon.d.vue.ts +29 -0
  26. package/dist/runtime/components/explorer/FileIcon.vue +41 -0
  27. package/dist/runtime/components/explorer/FileIcon.vue.d.ts +29 -0
  28. package/dist/runtime/components/explorer/FilePane.d.vue.ts +13 -0
  29. package/dist/runtime/components/explorer/FilePane.vue +5 -0
  30. package/dist/runtime/components/explorer/FilePane.vue.d.ts +13 -0
  31. package/dist/runtime/components/explorer/Frame.d.vue.ts +75 -0
  32. package/dist/runtime/components/explorer/Frame.vue +73 -0
  33. package/dist/runtime/components/explorer/Frame.vue.d.ts +75 -0
  34. package/dist/runtime/components/explorer/Nav.d.vue.ts +17 -0
  35. package/dist/runtime/components/explorer/Nav.vue +83 -0
  36. package/dist/runtime/components/explorer/Nav.vue.d.ts +17 -0
  37. package/dist/runtime/components/explorer/SelectableArea.d.vue.ts +33 -0
  38. package/dist/runtime/components/explorer/SelectableArea.vue +83 -0
  39. package/dist/runtime/components/explorer/SelectableArea.vue.d.ts +33 -0
  40. package/dist/runtime/components/explorer/Workspace.d.vue.ts +24 -0
  41. package/dist/runtime/components/explorer/Workspace.vue +116 -0
  42. package/dist/runtime/components/explorer/Workspace.vue.d.ts +24 -0
  43. package/dist/runtime/dialogs/createDesktopDialogs.d.ts +2 -0
  44. package/dist/runtime/dialogs/createDesktopDialogs.js +47 -0
  45. package/dist/runtime/plugins/01.desktop-nuxt-ui-dialogs.client.d.ts +2 -0
  46. package/dist/runtime/plugins/01.desktop-nuxt-ui-dialogs.client.js +13 -0
  47. package/dist/types.d.mts +9 -0
  48. package/package.json +78 -4
  49. package/src/kit/registerTailwindPath.ts +44 -0
  50. package/src/runtime/components/dialogs/NuxtUIAlertModal.vue +42 -0
  51. package/src/runtime/components/dialogs/NuxtUIConfirmModal.vue +49 -0
  52. package/src/runtime/components/explorer/AddressBar.vue +44 -0
  53. package/src/runtime/components/explorer/Chrome.vue +5 -0
  54. package/src/runtime/components/explorer/DefaultToolbar.vue +92 -0
  55. package/src/runtime/components/explorer/FileContextMenu.vue +99 -0
  56. package/src/runtime/components/explorer/FileEntry.vue +286 -0
  57. package/src/runtime/components/explorer/FileIcon.vue +43 -0
  58. package/src/runtime/components/explorer/FilePane.vue +5 -0
  59. package/src/runtime/components/explorer/Frame.vue +106 -0
  60. package/src/runtime/components/explorer/Nav.vue +87 -0
  61. package/src/runtime/components/explorer/SelectableArea.vue +93 -0
  62. package/src/runtime/components/explorer/Workspace.vue +119 -0
  63. package/src/runtime/dialogs/createDesktopDialogs.ts +56 -0
  64. package/src/runtime/plugins/01.desktop-nuxt-ui-dialogs.client.ts +14 -0
  65. package/README.md +0 -3
@@ -0,0 +1,75 @@
1
+ declare var __VLS_14: {}, __VLS_23: {}, __VLS_26: {}, __VLS_29: {}, __VLS_31: {}, __VLS_33: {};
2
+ type __VLS_Slots = {} & {
3
+ nav?: (props: typeof __VLS_14) => any;
4
+ } & {
5
+ 'nav-prepend'?: (props: typeof __VLS_23) => any;
6
+ } & {
7
+ 'nav-title'?: (props: typeof __VLS_26) => any;
8
+ } & {
9
+ 'nav-append'?: (props: typeof __VLS_29) => any;
10
+ } & {
11
+ 'header-below-nav'?: (props: typeof __VLS_31) => any;
12
+ } & {
13
+ default?: (props: typeof __VLS_33) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
16
+ window: {
17
+ type: ObjectConstructor;
18
+ required: false;
19
+ };
20
+ content: {
21
+ type: null;
22
+ required: false;
23
+ };
24
+ chromePadding: {
25
+ type: BooleanConstructor;
26
+ required: false;
27
+ default: boolean;
28
+ };
29
+ frameClass: {
30
+ type: StringConstructor;
31
+ required: false;
32
+ };
33
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
34
+ "drag:start": (...args: any[]) => void;
35
+ "drag:move": (...args: any[]) => void;
36
+ "drag:end": (...args: any[]) => void;
37
+ "resize:start": (...args: any[]) => void;
38
+ "resize:move": (...args: any[]) => void;
39
+ "resize:end": (...args: any[]) => void;
40
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
+ window: {
42
+ type: ObjectConstructor;
43
+ required: false;
44
+ };
45
+ content: {
46
+ type: null;
47
+ required: false;
48
+ };
49
+ chromePadding: {
50
+ type: BooleanConstructor;
51
+ required: false;
52
+ default: boolean;
53
+ };
54
+ frameClass: {
55
+ type: StringConstructor;
56
+ required: false;
57
+ };
58
+ }>> & Readonly<{
59
+ "onDrag:start"?: ((...args: any[]) => any) | undefined;
60
+ "onDrag:move"?: ((...args: any[]) => any) | undefined;
61
+ "onDrag:end"?: ((...args: any[]) => any) | undefined;
62
+ "onResize:start"?: ((...args: any[]) => any) | undefined;
63
+ "onResize:move"?: ((...args: any[]) => any) | undefined;
64
+ "onResize:end"?: ((...args: any[]) => any) | undefined;
65
+ }>, {
66
+ chromePadding: boolean;
67
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
68
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
69
+ declare const _default: typeof __VLS_export;
70
+ export default _default;
71
+ type __VLS_WithSlots<T, S> = T & {
72
+ new (): {
73
+ $slots: S;
74
+ };
75
+ };
@@ -0,0 +1,73 @@
1
+ <script setup>
2
+ import { useSlots, computed, useAttrs } from "vue";
3
+ import Nav from "./Nav.vue";
4
+ const props = defineProps({
5
+ window: { type: Object, required: false },
6
+ content: { type: null, required: false },
7
+ chromePadding: { type: Boolean, required: false, default: true },
8
+ frameClass: { type: String, required: false }
9
+ });
10
+ defineEmits([
11
+ "drag:start",
12
+ "drag:move",
13
+ "drag:end",
14
+ "resize:start",
15
+ "resize:move",
16
+ "resize:end"
17
+ ]);
18
+ defineOptions({ inheritAttrs: false });
19
+ const attrs = useAttrs();
20
+ const windowRootClass = computed(
21
+ () => [attrs.class, props.frameClass].filter(Boolean)
22
+ );
23
+ const slots = useSlots();
24
+ const hasHeaderBelowNavSlot = computed(
25
+ () => typeof slots["header-below-nav"] === "function"
26
+ );
27
+ const hasNavSlot = computed(() => typeof slots.nav === "function");
28
+ </script>
29
+
30
+ <template>
31
+ <DesktopCoreWindow
32
+ :class="windowRootClass"
33
+ :window="props.window"
34
+ :content="props.content"
35
+ v-show="props.window?.state?.active ?? true"
36
+ @drag:start="$emit('drag:start', $event)"
37
+ @drag:move="$emit('drag:move', $event)"
38
+ @drag:end="$emit('drag:end', $event)"
39
+ @resize:start="$emit('resize:start', $event)"
40
+ @resize:move="$emit('resize:move', $event)"
41
+ @resize:end="$emit('resize:end', $event)"
42
+ >
43
+ <div :class="['flex flex-col h-full bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 rounded-lg shadow-lg overflow-hidden', props.chromePadding === false ? '' : 'p-2']">
44
+ <div class="desktop-explorer-frame__header-stack">
45
+ <slot v-if="hasNavSlot" name="nav" />
46
+ <Nav v-else>
47
+ <template #prepend>
48
+ <slot name="nav-prepend" />
49
+ </template>
50
+ <template v-slot:title v-if="$slots['nav-title']">
51
+ <slot name="nav-title" />
52
+ </template>
53
+ <template #append>
54
+ <slot name="nav-append" />
55
+ </template>
56
+ </Nav>
57
+ <div
58
+ v-if="hasHeaderBelowNavSlot"
59
+ class="desktop-explorer-frame__header-below-nav"
60
+ >
61
+ <slot name="header-below-nav" />
62
+ </div>
63
+ </div>
64
+ <div class="flex-1 min-h-0 flex flex-col">
65
+ <slot />
66
+ </div>
67
+ </div>
68
+ </DesktopCoreWindow>
69
+ </template>
70
+
71
+ <style scoped>
72
+ .desktop-explorer-frame__header-stack{display:flex;flex-direction:column;min-width:0}.desktop-explorer-frame__header-below-nav{min-width:0}.owd-window.resizable-component{box-sizing:border-box;cursor:default;display:inline-block;min-height:160px;min-width:160px;text-align:left}@media (max-width:599px){.owd-window.resizable-component{bottom:0!important;height:100vh!important;left:0!important;max-height:100vh;max-width:100vw;right:0!important;top:0!important;z-index:9999999999!important}}
73
+ </style>
@@ -0,0 +1,75 @@
1
+ declare var __VLS_14: {}, __VLS_23: {}, __VLS_26: {}, __VLS_29: {}, __VLS_31: {}, __VLS_33: {};
2
+ type __VLS_Slots = {} & {
3
+ nav?: (props: typeof __VLS_14) => any;
4
+ } & {
5
+ 'nav-prepend'?: (props: typeof __VLS_23) => any;
6
+ } & {
7
+ 'nav-title'?: (props: typeof __VLS_26) => any;
8
+ } & {
9
+ 'nav-append'?: (props: typeof __VLS_29) => any;
10
+ } & {
11
+ 'header-below-nav'?: (props: typeof __VLS_31) => any;
12
+ } & {
13
+ default?: (props: typeof __VLS_33) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
16
+ window: {
17
+ type: ObjectConstructor;
18
+ required: false;
19
+ };
20
+ content: {
21
+ type: null;
22
+ required: false;
23
+ };
24
+ chromePadding: {
25
+ type: BooleanConstructor;
26
+ required: false;
27
+ default: boolean;
28
+ };
29
+ frameClass: {
30
+ type: StringConstructor;
31
+ required: false;
32
+ };
33
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
34
+ "drag:start": (...args: any[]) => void;
35
+ "drag:move": (...args: any[]) => void;
36
+ "drag:end": (...args: any[]) => void;
37
+ "resize:start": (...args: any[]) => void;
38
+ "resize:move": (...args: any[]) => void;
39
+ "resize:end": (...args: any[]) => void;
40
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
+ window: {
42
+ type: ObjectConstructor;
43
+ required: false;
44
+ };
45
+ content: {
46
+ type: null;
47
+ required: false;
48
+ };
49
+ chromePadding: {
50
+ type: BooleanConstructor;
51
+ required: false;
52
+ default: boolean;
53
+ };
54
+ frameClass: {
55
+ type: StringConstructor;
56
+ required: false;
57
+ };
58
+ }>> & Readonly<{
59
+ "onDrag:start"?: ((...args: any[]) => any) | undefined;
60
+ "onDrag:move"?: ((...args: any[]) => any) | undefined;
61
+ "onDrag:end"?: ((...args: any[]) => any) | undefined;
62
+ "onResize:start"?: ((...args: any[]) => any) | undefined;
63
+ "onResize:move"?: ((...args: any[]) => any) | undefined;
64
+ "onResize:end"?: ((...args: any[]) => any) | undefined;
65
+ }>, {
66
+ chromePadding: boolean;
67
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
68
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
69
+ declare const _default: typeof __VLS_export;
70
+ export default _default;
71
+ type __VLS_WithSlots<T, S> = T & {
72
+ new (): {
73
+ $slots: S;
74
+ };
75
+ };
@@ -0,0 +1,17 @@
1
+ declare var __VLS_9: {}, __VLS_11: {}, __VLS_18: {};
2
+ type __VLS_Slots = {} & {
3
+ prepend?: (props: typeof __VLS_9) => any;
4
+ } & {
5
+ title?: (props: typeof __VLS_11) => any;
6
+ } & {
7
+ append?: (props: typeof __VLS_18) => any;
8
+ };
9
+ 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>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,83 @@
1
+ <script setup>
2
+ import { inject, useSlots, computed } from "vue";
3
+ import { useToggleWindowMaximize } from "@owdproject/nuxt/runtime/composables/useToggleWindowMaximize";
4
+ const windowController = inject("windowController");
5
+ const toggleWindowMaximize = useToggleWindowMaximize();
6
+ const slots = useSlots();
7
+ const hasCustomTitle = computed(() => typeof slots.title === "function");
8
+ function onWindowMinimize() {
9
+ if (!windowController?.instanced) return;
10
+ windowController.actions.minimize();
11
+ }
12
+ function onWindowMaximize() {
13
+ toggleWindowMaximize(windowController);
14
+ }
15
+ function onWindowNavDestroy() {
16
+ if (!windowController?.instanced) return;
17
+ windowController.actions.destroy();
18
+ }
19
+ </script>
20
+
21
+ <template>
22
+ <DesktopCoreWindowNav
23
+ class="flex items-center justify-between px-3 py-1.5 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 select-none cursor-default"
24
+ @dblclick="onWindowMaximize"
25
+ >
26
+ <div class="flex items-center space-x-2 min-w-0">
27
+ <slot name="prepend" />
28
+
29
+ <slot v-if="hasCustomTitle" name="title" />
30
+
31
+ <template v-else>
32
+ <UIcon
33
+ v-if="windowController?.icon"
34
+ :name="windowController.icon"
35
+ class="w-4 h-4 text-gray-500 dark:text-gray-400 flex-shrink-0"
36
+ />
37
+
38
+ <span
39
+ v-if="windowController?.title"
40
+ class="text-xs font-semibold text-gray-700 dark:text-gray-300 truncate"
41
+ v-text="windowController?.title"
42
+ />
43
+ </template>
44
+ </div>
45
+
46
+ <div class="flex items-center space-x-1 flex-shrink-0">
47
+ <slot name="append" />
48
+
49
+ <UButton
50
+ v-if="!windowController?.instanced || windowController?.isMinimizable"
51
+ icon="i-heroicons-minus"
52
+ size="2xs"
53
+ color="gray"
54
+ variant="ghost"
55
+ class="h-5 w-5 p-0 flex items-center justify-center rounded"
56
+ @mousedown.stop
57
+ @click.stop="onWindowMinimize"
58
+ />
59
+ <UButton
60
+ v-slot:default
61
+ v-if="windowController?.isMaximizable"
62
+ icon="i-heroicons-squares-2x2"
63
+ size="2xs"
64
+ color="gray"
65
+ variant="ghost"
66
+ class="h-5 w-5 p-0 flex items-center justify-center rounded"
67
+ @mousedown.stop
68
+ @click.stop="onWindowMaximize"
69
+ />
70
+ <UButton
71
+ v-slot:default
72
+ v-if="!windowController?.instanced || windowController?.isDestroyable"
73
+ icon="i-heroicons-x-mark"
74
+ size="2xs"
75
+ color="red"
76
+ variant="ghost"
77
+ class="h-5 w-5 p-0 flex items-center justify-center rounded hover:bg-red-500 hover:text-white"
78
+ @mousedown.stop
79
+ @click.stop="onWindowNavDestroy"
80
+ />
81
+ </div>
82
+ </DesktopCoreWindowNav>
83
+ </template>
@@ -0,0 +1,17 @@
1
+ declare var __VLS_9: {}, __VLS_11: {}, __VLS_18: {};
2
+ type __VLS_Slots = {} & {
3
+ prepend?: (props: typeof __VLS_9) => any;
4
+ } & {
5
+ title?: (props: typeof __VLS_11) => any;
6
+ } & {
7
+ append?: (props: typeof __VLS_18) => any;
8
+ };
9
+ 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>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,33 @@
1
+ declare var __VLS_8: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_8) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ fsExplorer: {
7
+ type: ObjectConstructor;
8
+ required: true;
9
+ };
10
+ dropEnabled: {
11
+ type: BooleanConstructor;
12
+ required: false;
13
+ };
14
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ fsExplorer: {
16
+ type: ObjectConstructor;
17
+ required: true;
18
+ };
19
+ dropEnabled: {
20
+ type: BooleanConstructor;
21
+ required: false;
22
+ };
23
+ }>> & Readonly<{}>, {
24
+ dropEnabled: boolean;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,83 @@
1
+ <script setup>
2
+ import { ref, onMounted, useTemplateRef, computed, watch } from "vue";
3
+ import { VueSelecto } from "vue3-selecto";
4
+ import { useExplorerExternalDrop } from "@owdproject/nuxt-module-fs/runtime/composables/useExplorerExternalDrop";
5
+ import { explorerEntryAbsolutePath } from "@owdproject/nuxt-module-fs/runtime/utils/utilExplorerEntryPath";
6
+ const props = defineProps({
7
+ fsExplorer: { type: Object, required: true },
8
+ dropEnabled: { type: Boolean, required: false }
9
+ });
10
+ const dropEnabled = computed(() => props.dropEnabled ?? true);
11
+ const { isDragOver, onDragEnter, onDragOver, onDragLeave, onDrop } = useExplorerExternalDrop(props.fsExplorer, {
12
+ enabled: () => dropEnabled.value
13
+ });
14
+ const selectoContainer = useTemplateRef("selectoContainer");
15
+ const windowContentContainer = ref();
16
+ const container = typeof document !== "undefined" ? document.body : void 0;
17
+ const files = ref([]);
18
+ watch(
19
+ () => props.fsExplorer.selectedFiles.value,
20
+ (newSelected) => {
21
+ files.value = newSelected ? [...newSelected] : [];
22
+ },
23
+ { deep: true, immediate: true }
24
+ );
25
+ function resolveEntryPath(fileName) {
26
+ return explorerEntryAbsolutePath(props.fsExplorer.basePath.value, fileName);
27
+ }
28
+ function onSelect(e) {
29
+ e.added.forEach((el) => {
30
+ const name = el.getAttribute("data-filename");
31
+ if (!name) return;
32
+ const path = resolveEntryPath(name);
33
+ if (!files.value.includes(path)) {
34
+ files.value.push(path);
35
+ }
36
+ props.fsExplorer.selectFiles(files.value);
37
+ });
38
+ e.removed.forEach((el) => {
39
+ const name = el.getAttribute("data-filename");
40
+ if (!name) return;
41
+ const path = resolveEntryPath(name);
42
+ const fileIndex = files.value.indexOf(path);
43
+ if (fileIndex > -1) {
44
+ files.value.splice(fileIndex, 1);
45
+ }
46
+ props.fsExplorer.selectFiles(files.value);
47
+ });
48
+ }
49
+ onMounted(() => {
50
+ const root = selectoContainer.value;
51
+ if (root) {
52
+ windowContentContainer.value = root.closest(".owd-window__content") ?? void 0;
53
+ }
54
+ });
55
+ </script>
56
+
57
+ <template>
58
+ <div
59
+ ref="selectoContainer"
60
+ class="desktop-explorer-dropzone flex-1 flex flex-wrap p-4 select-none min-h-full items-start content-start"
61
+ :class="{ 'desktop-explorer-dropzone--active bg-blue-50/30 dark:bg-blue-900/10': isDragOver }"
62
+ @dragenter="onDragEnter"
63
+ @dragover="onDragOver"
64
+ @dragleave="onDragLeave"
65
+ @drop="onDrop"
66
+ >
67
+ <VueSelecto
68
+ v-if="container && windowContentContainer"
69
+ :rootContainer="windowContentContainer"
70
+ :dragContainer="windowContentContainer"
71
+ :selectableTargets='[".owd-file"]'
72
+ :selectByClick="true"
73
+ :selectFromInside="true"
74
+ :continueSelect="false"
75
+ toggleContinueSelect="ctrl"
76
+ :keyContainer="container"
77
+ :hitRate="60"
78
+ @select="onSelect"
79
+ />
80
+
81
+ <slot />
82
+ </div>
83
+ </template>
@@ -0,0 +1,33 @@
1
+ declare var __VLS_8: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_8) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ fsExplorer: {
7
+ type: ObjectConstructor;
8
+ required: true;
9
+ };
10
+ dropEnabled: {
11
+ type: BooleanConstructor;
12
+ required: false;
13
+ };
14
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ fsExplorer: {
16
+ type: ObjectConstructor;
17
+ required: true;
18
+ };
19
+ dropEnabled: {
20
+ type: BooleanConstructor;
21
+ required: false;
22
+ };
23
+ }>> & Readonly<{}>, {
24
+ dropEnabled: boolean;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,24 @@
1
+ type __VLS_Props = {
2
+ config?: Record<string, any>;
3
+ window: Record<string, any>;
4
+ frameClass?: string;
5
+ };
6
+ declare var __VLS_8: {}, __VLS_29: {}, __VLS_45: {}, __VLS_54: {};
7
+ type __VLS_Slots = {} & {
8
+ nav?: (props: typeof __VLS_8) => any;
9
+ } & {
10
+ toolbar?: (props: typeof __VLS_29) => any;
11
+ } & {
12
+ address?: (props: typeof __VLS_45) => any;
13
+ } & {
14
+ 'file-pane'?: (props: typeof __VLS_54) => any;
15
+ };
16
+ declare const __VLS_base: 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>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,116 @@
1
+ <script setup>
2
+ import { useExplorerWindow } from "@owdproject/nuxt-module-fs/runtime/composables/useExplorerWindow";
3
+ import { useI18n } from "vue-i18n";
4
+ import { explorerEntryAbsolutePath } from "@owdproject/nuxt-module-fs/runtime/utils/utilExplorerEntryPath";
5
+ import { computed } from "vue";
6
+ import Frame from "./Frame.vue";
7
+ import Chrome from "./Chrome.vue";
8
+ import FilePane from "./FilePane.vue";
9
+ import AddressBar from "./AddressBar.vue";
10
+ import DefaultToolbar from "./DefaultToolbar.vue";
11
+ const props = defineProps({
12
+ config: { type: Object, required: false },
13
+ window: { type: Object, required: true },
14
+ frameClass: { type: String, required: false }
15
+ });
16
+ const { t } = useI18n();
17
+ const fsExplorer = useExplorerWindow(props.window, t);
18
+ props.window.fsExplorer = fsExplorer;
19
+ void fsExplorer.initialize();
20
+ function mapMenuItems(items) {
21
+ if (!items) return [];
22
+ return [
23
+ items.map((subItem) => ({
24
+ label: subItem.label,
25
+ icon: subItem.icon,
26
+ click: () => {
27
+ if (typeof subItem.command === "function") {
28
+ subItem.command();
29
+ }
30
+ }
31
+ }))
32
+ ];
33
+ }
34
+ </script>
35
+
36
+ <template>
37
+ <Frame
38
+ :window="window"
39
+ :frame-class="frameClass"
40
+ >
41
+ <template v-if="$slots.nav" v-slot:nav>
42
+ <slot name="nav" />
43
+ </template>
44
+
45
+ <Chrome>
46
+ <!-- Menu bar row -->
47
+ <div v-if="window.menu && window.menu.length > 0" class="flex items-center space-x-1 px-2 py-1 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800 flex-shrink-0">
48
+ <UDropdown
49
+ v-for="menu of window.menu"
50
+ :key="menu.label"
51
+ :items="mapMenuItems(menu.items)"
52
+ :popper="{ placement: 'bottom-start' }"
53
+ >
54
+ <UButton
55
+ color="gray"
56
+ variant="ghost"
57
+ size="xs"
58
+ class="text-xs font-medium py-1 px-2"
59
+ >
60
+ {{ menu.label }}
61
+ </UButton>
62
+ </UDropdown>
63
+ </div>
64
+
65
+ <slot name="toolbar">
66
+ <DefaultToolbar
67
+ :arrows-disabled="fsExplorer.fsDirectoryNavigation.history.value.length <= 1"
68
+ @back="fsExplorer.directoryBack"
69
+ @forward="fsExplorer.directoryForward"
70
+ @up="fsExplorer.directoryUp"
71
+ @cut="fsExplorer.cutSelectedFiles"
72
+ @copy="fsExplorer.copySelectedFiles"
73
+ @paste="() => fsExplorer.fsController?.pasteClipboardFiles()"
74
+ @delete="() => fsExplorer.fsController?.deleteSelectedFiles()"
75
+ @properties="fsExplorer.fileProperties"
76
+ />
77
+ </slot>
78
+
79
+ <slot name="address">
80
+ <AddressBar
81
+ :address="fsExplorer.basePath.value ?? ''"
82
+ @update:model-value="(value) => {
83
+ fsExplorer.basePath.value = value;
84
+ }"
85
+ />
86
+ </slot>
87
+
88
+ <slot name="file-pane">
89
+ <FilePane>
90
+ <DesktopExplorerSelectableArea
91
+ v-if="!String(window.meta.path ?? '').startsWith('http')"
92
+ :fs-explorer="fsExplorer"
93
+ >
94
+ <DesktopExplorerFileEntry
95
+ v-for="fileName of fsExplorer.fsEntries.value"
96
+ :key="fileName"
97
+ :data-filename="fileName"
98
+ :basePath="fsExplorer.basePath.value"
99
+ :fileName="fileName"
100
+ :layout="fsExplorer.layout.value"
101
+ :selected="fsExplorer.selectedFiles.value.includes(explorerEntryAbsolutePath(fsExplorer.basePath.value, fileName))"
102
+ :cutted="fsExplorer.fsClipboard.clipboardFiles.value.includes(explorerEntryAbsolutePath(fsExplorer.basePath.value, fileName)) && fsExplorer.fsClipboard.clipboardType.value === 'cut'"
103
+ :window="window"
104
+ />
105
+ </DesktopExplorerSelectableArea>
106
+ <iframe
107
+ v-else
108
+ class="w-full h-full border-0"
109
+ :src="window.meta.path ?? ''"
110
+ :style="{ pointerEvents: window?.state?.focused ? 'auto' : 'none' }"
111
+ />
112
+ </FilePane>
113
+ </slot>
114
+ </Chrome>
115
+ </Frame>
116
+ </template>
@@ -0,0 +1,24 @@
1
+ type __VLS_Props = {
2
+ config?: Record<string, any>;
3
+ window: Record<string, any>;
4
+ frameClass?: string;
5
+ };
6
+ declare var __VLS_8: {}, __VLS_29: {}, __VLS_45: {}, __VLS_54: {};
7
+ type __VLS_Slots = {} & {
8
+ nav?: (props: typeof __VLS_8) => any;
9
+ } & {
10
+ toolbar?: (props: typeof __VLS_29) => any;
11
+ } & {
12
+ address?: (props: typeof __VLS_45) => any;
13
+ } & {
14
+ 'file-pane'?: (props: typeof __VLS_54) => any;
15
+ };
16
+ declare const __VLS_base: 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>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,2 @@
1
+ import type { DesktopDialogProvider } from '@owdproject/nuxt/runtime/dialogs/desktopDialogProvider';
2
+ export declare function createDesktopDialogs(): DesktopDialogProvider;