diff --git a/package.json b/package.json index d842936..8843a92 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "publisher": "oeyoews", "name": "usewiki2", "displayName": "usewiki2", - "version": "0.9.1", + "version": "1.0.0", "private": true, "packageManager": "pnpm@9.0.6", "description": "", diff --git a/packages/react/src/App.tsx b/packages/react/src/App.tsx index 6fde9b0..e708ec6 100644 --- a/packages/react/src/App.tsx +++ b/packages/react/src/App.tsx @@ -8,12 +8,51 @@ import { } from '@/components/ui/context-menu'; import { Button } from '@/components/ui/button'; import { Textarea } from './components/ui/textarea'; +import { + Card, + CardDescription, + CardHeader, + CardTitle, +} from './components/ui/card'; function App() { const [inputValue, setInputValue] = useState(''); const inputRef = useRef(null); const [vscode, setVscode] = useState(null); + const cards = [ + { + title: '太微官网', + description: 'a non-linear personal web notebook', + link: 'https://tiddlywiki.com', + class: 'bg-green-300/15', + }, + { + title: '太微 GitHub', + description: 'The TiddlyWiki5 source code', + link: 'https://github.com/TiddlyWiki/TiddlyWiki5', + class: 'bg-rose-300/15', + }, + { + title: '太微官方论坛', + description: 'The official TiddlyWiki5 forum', + link: 'https://talk.tiddlywiki.org', + class: 'bg-yellow-300/15', + }, + { + title: '中文太微文档', + description: 'The TiddlyWiki5 Chinese documentation', + link: 'https://bramchen.github.io/tw5-docs/zh-Hans', + class: 'bg-purple-300/15', + }, + { + title: '中文太微教程', + description: 'The TiddlyWiki5 Chinese tutorial', + link: 'https://tw-cn.netlify.app', + class: 'bg-orange-300/15', + }, + ]; + useEffect(() => { inputRef.current?.focus(); @@ -24,6 +63,20 @@ function App() { } }, []); + function openLink(link: string) { + if (vscode) { + //@ts-expect-error + vscode.postMessage({ + type: 'openLink', + data: { + link: link.toString(), + }, + }); + } else { + window.open(link.toString(), '_blank'); + } + } + // support ctrl enter to save function handleInputBoxSave(e: KeyboardEvent) { if (e.ctrlKey && e.key === 'Enter') { @@ -49,6 +102,26 @@ function App() { Coming + + {/* https://talks.antfu.me/2024/vue-fes-japan/15?clicks=6 */} +
+ {cards.map((card) => ( + openLink(card.link)}> + + + + {card.title} + + + {card.description} + + + + ))} +
+