-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
258 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
path: string | ||
}>() | ||
const { data } = useAsyncData(props.path, () => queryContent(props.path).findOne()) | ||
const open = ref(false) | ||
const { | ||
showHelpButtons, | ||
} = useDevToolsSettings() | ||
</script> | ||
|
||
<template> | ||
<template v-if="showHelpButtons"> | ||
<button | ||
pos="absolute bottom-5 right-5" | ||
border="~ base rounded-full " | ||
flex="~ items-center justify-center" | ||
z-110 h-11 w-11 backdrop-blur-8 | ||
bg="bg-base op50!" light:shadow | ||
hover="bg-active" | ||
title="Help" | ||
@click="open = !open" | ||
> | ||
<div i-ri:question-mark /> | ||
</button> | ||
<Transition name="fade-in"> | ||
<div | ||
v-if="open" | ||
class="fixed bottom-0 left-0 right-0 top-0 z-100" | ||
bg-black:20 backdrop-blur-2 @click="open = false" | ||
/> | ||
</Transition> | ||
<Transition name="slide-in"> | ||
<div | ||
v-if="open" border="l base" | ||
class="prose" pos="fixed bottom-0 right-0 top-0" z-200 w-150 px8 py4 bg-base | ||
> | ||
<ContentRenderer v-if="data" :value="data" /> | ||
<NIconButton | ||
icon="carbon-close" | ||
pos="absolute top-3 right-3" | ||
rounded-full text-xl | ||
@click="open = false" | ||
/> | ||
</div> | ||
</Transition> | ||
</template> | ||
</template> | ||
|
||
<style> | ||
.slide-in-enter-active, | ||
.slide-in-leave-active { | ||
transition: transform 0.3s; | ||
} | ||
.slide-in-enter-from, | ||
.slide-in-leave-to { | ||
transform: translateX(100%); | ||
} | ||
.fade-in-enter-active, | ||
.fade-in-leave-active { | ||
transition: opacity 0.3s; | ||
} | ||
.fade-in-enter-from, | ||
.fade-in-leave-to { | ||
opacity: 0; | ||
} | ||
</style> |
11 changes: 11 additions & 0 deletions
11
packages/devtools/client/components/content/HelpImportsDirs.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script setup lang="ts"> | ||
const imports = useAutoImports() | ||
</script> | ||
|
||
<template> | ||
<div v-if="imports?.dirs" flex="~ col gap-2 items-start"> | ||
<template v-for="dir of imports.dirs" :key="dir"> | ||
<FilepathItem :filepath="dir" text-primary /> | ||
</template> | ||
</div> | ||
</template> |
15 changes: 15 additions & 0 deletions
15
packages/devtools/client/components/content/HelpImportsModules.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
const config = useAutoImports() | ||
const modules = computed(() => { | ||
return [...new Set(config.value?.imports.map(i => getModuleNameFromPath(i.from)).filter(x => Boolean(x) && !isBuiltInModule(x)))] | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div flex="~ gap-2 wrap" mb6> | ||
<code v-for="name of modules" :key="name" rounded bg-primary:5 p="x2 y0.5" text-primary> | ||
{{ name }} | ||
</code> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script setup lang="ts"> | ||
defineProps<{ | ||
title: string | ||
icon?: string | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<div class="n-tip n-tip-base" flex="~ col items-start" mx--4 px4 py4> | ||
<div flex="~ items-center gap-1" font-bold> | ||
<NIcon v-if="icon" :icon="icon" class="n-tip-icon" /> | ||
<div> | ||
{{ title }} | ||
</div> | ||
</div> | ||
<div> | ||
<slot> | ||
<ContentSlot :use="$slots.default" unwrap="p" /> | ||
</slot> | ||
</div> | ||
</div> | ||
</template> |
9 changes: 9 additions & 0 deletions
9
packages/devtools/client/components/content/HelpTipPerformance.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<HelpTip | ||
title="Performance Tip" | ||
icon="carbon-meter" | ||
n="lime6 dark:lime5" | ||
> | ||
<ContentSlot :use="$slots.default" unwrap="p" /> | ||
</HelpTip> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Components | ||
|
||
Vue components under the `components/` directory are automatically registered and can be used in your templates without importing them. | ||
|
||
[Learn more on the documentation](https://nuxt.com/docs/guide/directory-structure/components) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Hooks | ||
|
||
Hooks are an advanced API mainly for module authors or advanced use cases. The hooking system to expand almost every aspect of Nuxt. It's powered by [unjs/hookable](https://github.com/unjs/hookable). | ||
|
||
[Learn more about hooks](https://nuxt.com/docs/guide/going-further/hooks). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Auto imports | ||
|
||
Nuxt auto-imports helper functions, composables and Vue APIs to use across your application without explicitly importing them. Based on the directory structure, every Nuxt application can also use auto-imports for its own components, composables and plugins. Components, composables or plugins can use these functions. | ||
|
||
<hr> | ||
|
||
According to your config, exports of files under the following folders will be registed as auto-imports entry: | ||
|
||
:help-imports-dirs | ||
|
||
Meanwhile, modules could also provide auto-imports for their own components. You have auto-imports from the following modules as well: | ||
|
||
:help-imports-modules | ||
|
||
<hr> | ||
|
||
[Learn more on the documentation](https://nuxt.com/docs/guide/concepts/auto-imports) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Modules | ||
|
||
Nuxt provides a module system to extend the framework core and simplify integrations. You don't need to develop everything from scratch or maintain boilerplate if there is already a Nuxt module for it. Adding Nuxt modules is possible using `nuxt.config`. | ||
|
||
[Learn more on the documentation](https://nuxt.com/docs/guide/concepts/modules) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Pages | ||
|
||
One core feature of Nuxt is the file system router. Every Vue file inside the `pages/` directory creates a corresponding URL (or route) that displays the contents of the file. By using dynamic imports for each page, Nuxt leverages code-splitting to ship the minimum amount of JavaScript for the requested route. | ||
|
||
[Learn more on the documentation](https://nuxt.com/docs/getting-started/routing) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# State & Async Data | ||
|
||
// TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Plugins | ||
|
||
Nuxt plugins allows you to extend the functionality of Nuxt runtime and the Vue instance. You can add plugins to the `plugins/` directory and they will be automatically imported and registered. | ||
|
||
::help-tip-performance | ||
Plugins runs before your application at runtime, the time each plugin cost will directly affect your application's initial loading time. | ||
:: | ||
|
||
[Learn more on the documentation](https://nuxt.com/docs/guide/directory-structure/plugins) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Runtime Configs | ||
|
||
// TODO: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Virtual Files | ||
|
||
Virtual files are generated on the fly to support the conventions of the framework, and to provide a better developer experience. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,4 +53,6 @@ function toggleView() { | |
</div> | ||
</component> | ||
</div> | ||
|
||
<HelpFab path="/components" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,4 +70,6 @@ watchEffect(() => { | |
</template> | ||
</NSectionBlock> | ||
</div> | ||
|
||
<HelpFab path="/modules" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,4 +138,6 @@ function navigateToRoute(path: string) { | |
}, | ||
]" | ||
/> | ||
|
||
<HelpFab path="/pages" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.