feat(module): devtools integration (#2196)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Romain Hamel
2024-11-05 22:17:56 +01:00
committed by GitHub
parent 7fc6b387b3
commit 701c75a2a8
100 changed files with 2062 additions and 59 deletions

View File

@@ -1,10 +1,10 @@
<!-- eslint-disable vue/block-tag-newline -->
<script lang="ts">
import { tv, type VariantProps } from 'tailwind-variants'
import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps } from 'radix-vue'
import type { AppConfig } from '@nuxt/schema'
import _appConfig from '#build/app.config'
import theme from '#build/ui/context-menu'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import type { AvatarProps, KbdProps, LinkProps } from '../types'
import type { DynamicSlots, PartialString } from '../types/utils'
@@ -79,6 +79,66 @@ export type ContextMenuSlots<T extends { slot?: string }> = {
'item-trailing': SlotProps<T>
} & DynamicSlots<T, SlotProps<T>>
extendDevtoolsMeta({
example: 'ContextMenuExample',
ignoreProps: ['items'],
defaultProps: {
items: [
[{
label: 'My account',
avatar: {
src: 'https://avatars.githubusercontent.com/u/739984?v=4'
}
}],
[{
label: 'Appearance',
children: [{
label: 'System',
icon: 'i-heroicons-computer-desktop'
}, {
label: 'Light',
icon: 'i-heroicons-sun'
}, {
label: 'Dark',
icon: 'i-heroicons-moon'
}]
}],
[{
label: 'Show Sidebar',
kbds: ['meta', 'S']
}, {
label: 'Show Toolbar',
kbds: ['shift', 'meta', 'D']
}, {
label: 'Collapse Pinned Tabs',
disabled: true
}], [{
label: 'Refresh the Page'
}, {
label: 'Clear Cookies and Refresh'
}, {
label: 'Clear Cache and Refresh'
}, {
type: 'separator'
}, {
label: 'Developer',
children: [[{
label: 'View Source',
kbds: ['option', 'meta', 'U']
}, {
label: 'Developer Tools',
kbds: ['option', 'meta', 'I']
}], [{
label: 'Inspect Elements',
kbds: ['option', 'meta', 'C']
}], [{
label: 'JavaScript Console',
kbds: ['option', 'meta', 'J']
}]]
}]
]
}
})
</script>
<script setup lang="ts" generic="T extends ContextMenuItem">