Skip to content

Commit

Permalink
feat: miss tab input type
Browse files Browse the repository at this point in the history
  • Loading branch information
FliPPeDround committed Dec 9, 2024
1 parent 91f3988 commit c34b8a0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 29 deletions.
3 changes: 2 additions & 1 deletion packages/client/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ declare global {
const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
const useSupported: typeof import('@vueuse/core')['useSupported']
const useSwipe: typeof import('@vueuse/core')['useSwipe']
const useTabs: typeof import('./src/composables/tab')['useTabs']
const useTabs: typeof import('./src/composables/useTabs')['useTabs']
const useTemplateRef: typeof import('vue')['useTemplateRef']
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
Expand Down Expand Up @@ -648,6 +648,7 @@ declare module 'vue' {
readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
readonly useTabs: UnwrapRef<typeof import('./src/composables/useTabs')['useTabs']>
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/components/SideNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { VueDropdown } from '@vue/devtools-ui'
import Logo from '/icon.png'
import type { Tab } from '~/constants/tab'
const builtinTab = useTabs()
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/composables/useTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ export function useTabs() {
},
})

return { builtinTab }
return builtinTab
}
11 changes: 3 additions & 8 deletions packages/kit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import { createTrpc } from './trpc'
export function addCustomTab(tab: CustomTab) {
console.log('addCustomTab', tab)

Check warning on line 5 in packages/kit/src/index.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
const trpc = createTrpc()!
trpc.sendTab.subscribe(
{
aa: '111',
},
{
onComplete: () => {},
},
)
trpc.sendTab.subscribe(tab, {
onComplete: () => {},
})
}
20 changes: 1 addition & 19 deletions packages/plugin/src/devtoolServer/rpc/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,7 @@ export function TabRouter(eventEmitter: EventEmitter) {
const { input, subscription } = publicProcedure

return router({
sendTab: input(
z.object({
name: z.string(),
icon: z.string(),
title: z.string(),
category: z.string(),
view: z.union([
z.object({
type: z.literal('iframe'),
src: z.string(),
persistent: z.boolean(),
}),
z.object({
type: z.literal('webview'),
vnode: z.unknown(),
}),
]),
}),
).subscription(({ input }) => {
sendTab: input(z.unknown()).subscription(({ input }) => {
console.log('sendTab', input)
eventEmitter.emit('tab', input)
}),
Expand Down

0 comments on commit c34b8a0

Please sign in to comment.