From 42c8b2002e2cc53e3034470cbc6fefd948c2e321 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Mon, 8 Dec 2025 20:17:31 +0800 Subject: [PATCH] update --- package.json | 8 ++++---- src/apps/hotkeys/store.ts | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e41664e..c4fad9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/hot-api", - "version": "0.0.2", + "version": "0.0.3", "description": "", "main": "index.js", "basename": "/root/hot-api", @@ -8,11 +8,11 @@ "dev": "astro dev", "build": "astro build", "preview": "astro preview", - "pub": "envision deploy ./dist -k hot-api -v 0.0.2 -u -y y", - "pub:docs": "envision deploy ./dist -k hot-api-docs -v 0.0.2 -u", + "pub": "envision deploy ./dist -k hot-api -v 0.0.3 -u -y y", + "pub:docs": "envision deploy ./dist -k hot-api-docs -v 0.0.3 -u", "slide:dev": "slidev --open slides/index.md", "slide:build": "slidev build slides/index.md --base /root/hot-api-slide/", - "slide:pub": "envision deploy ./slides/dist -k hot-api-slide -v 0.0.2 -u", + "slide:pub": "envision deploy ./slides/dist -k hot-api-slide -v 0.0.3 -u", "ui": "pnpm dlx shadcn@latest add " }, "keywords": [], diff --git a/src/apps/hotkeys/store.ts b/src/apps/hotkeys/store.ts index e2a9872..b90aa57 100644 --- a/src/apps/hotkeys/store.ts +++ b/src/apps/hotkeys/store.ts @@ -36,8 +36,23 @@ export const useStore = create((set) => ({ mockData.unshift({ id: 'item-search', title: 'win+d 显示桌面', + data: { type: "hotkeys", hotkeys: "win+d" }, iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=search', description: '显示桌面' + }); + mockData.unshift({ + id: 'item-recor', + title: 'ctrl+alt+h 开始或停止语音转文字', + data: { type: "hotkeys", hotkeys: "ctrl+alt+h" }, + iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=record', + description: '开始或停止语音转文字' + }) + mockData.unshift({ + id: 'item-newtab', + title: 'ctrl+t 打开浏览器新标签页', + data: { type: "hotkeys", hotkeys: "ctrl+t" }, + iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=newtab', + description: '打开浏览器新标签页' }) // Simulate network delay await new Promise(resolve => setTimeout(resolve, 800)); @@ -46,9 +61,10 @@ export const useStore = create((set) => ({ }, sendEvent: async (item: CardItem) => { // client/router?path=key-sender&keys=win+d + console.log('Sending event for item:', item); const res = await query.post({ path: 'key-sender', - keys: 'win+d' + keys: item?.data?.hotkeys || 'win+d' }); console.log('Event sent for item:', item, 'Response:', res); if (res.code !== 200) {