7da1eb6d65
對應 tasks.md backlog #12 / design.md §3.6.2。leo 反饋:要像 Logseq 那樣 寫 [[X]] 立刻建檔,下次 [[X 自動補完,render 變連結。 helpers: - parseWikilinks(text) → 抽 [[X]] entity list - fetchAllEntityNames(apiKey) → 合 index-entry + wiki-page entity 名稱 - getEntityNamesCached → 30s session cache for autocomplete - ensureEntitiesExist → 新 entity 立刻建 wiki-page placeholder - tags 含 entity-type:book/url/concept(guessEntityType 推測:《》→ book / http → url) - source: leo-explicit - expandWikilinks(text) → render 時把 [[X]] 轉 markdown link to /mira/wiki/wiki-X UI: - <WikilinkAutocomplete>:textarea cursor 在 `[[query` 未閉合時,下拉顯示既存 entity(substring filter)+「⊕ 建立 [[query]]」option,↑↓選 / Enter 確認 / Esc 取消。fixed-position below textarea bottom(cursor tracking 留下輪) - PostComposer compact + popup 兩個 textarea 都掛 autocomplete - EditingArea(PostEditor / BlockEditor / ReplyLine / PageReplyComposer 共用) 加 apiKey prop,內部 textarea + popup 都掛 autocomplete submit hook: - PostComposer.submit:postBlockId 建好後 ensureEntitiesExist(wikilinks) - BlockEditor.submitReply / ReplyLine.submitReply 同樣建檔 - 在 wiki_synthesis trigger 前先建,避免 race render: - markdown.tsx expandWikilinks 取代 stripLogseqMeta 前處理(兩階段) - 內部 wiki link(/mira/wiki/...)不開 _target=_blank(不離開頁面) 留下輪:metadata 補完 (作者/出版社) / cursor tracking / PostEditor.save 也建檔
This is a Next.js project bootstrapped with create-next-app.
Getting Started
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.