forked from nuxt/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
modules.vue
88 lines (83 loc) · 2.42 KB
/
modules.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<script setup lang="ts">
definePageMeta({
icon: 'carbon-3d-mpr-toggle',
title: 'Modules',
order: 4,
})
const installModuleOpen = ref(false)
const { showExperimentalFeatures } = useDevToolsSettings()
const { packageModules, userModules } = useModules()
</script>
<template>
<div h-full w-full of-auto>
<NSectionBlock
icon="carbon-3d-mpr-toggle"
text="Installed Modules"
container-class="grid grid-cols-minmax-400px gap3 px4"
:padding="false"
:description="`Total modules: ${packageModules.length}`"
>
<ModuleItem
v-for="m of packageModules"
:key="m.meta?.name || m.entryPath"
:mod="m"
/>
<NCard
v-if="showExperimentalFeatures"
border="1.5 dashed"
min-h-30 p4 transition
hover="border-primary"
flex="~ col gap-2 items-center justify-center"
role="button"
class="group"
@click="installModuleOpen = true"
>
<div i-carbon-new-tab text-4xl op40 group-hover="op75 text-primary" transition />
<div text-lg op40 group-hover="op75 text-primary" transition>
Install New Module
</div>
</NCard>
</NSectionBlock>
<NSectionBlock
v-if="userModules.length"
icon="carbon-3d-mpr-toggle"
text="User Modules"
container-class="grid grid-cols-minmax-400px gap3 px4"
:padding="false"
:description="`Total modules: ${userModules.length}`"
>
<template v-for="m of userModules" :key="m.meta?.name || m.entryPath">
<ModuleItem
v-if="m.meta?.name || m.entryPath"
:mod="m"
/>
</template>
</NSectionBlock>
<template v-if="showExperimentalFeatures">
<Transition name="fade-in">
<div
v-if="installModuleOpen"
class="fixed bottom-0 left-0 right-0 top-0 z-100"
bg-black:20 backdrop-blur-2 @click="installModuleOpen = false"
/>
</Transition>
<Transition name="slide-in">
<div
v-if="installModuleOpen" border="l base"
pos="fixed bottom-0 right-0 top-0" z-200 w-150 bg-base
>
<NIconButton
icon="carbon-close"
pos="absolute top-3 right-3"
rounded-full text-xl
@click="installModuleOpen = false"
/>
<ModuleInstallList />
</div>
</Transition>
</template>
</div>
<HelpFab>
<DocsModules />
</HelpFab>
</template>