import { setup } from "https://raw.githubusercontent.com/takker99/scrapbox-select-suggestion/main/mod.tsx"; const projects = [ scrapbox.Project.name, "yuyasurarin", "villagepump","nishio","takker","shokai","discordwiki","work4ai", "yuyasurarin", "wogikaze", "wogikaze-study", "rashitamemo", "sta", "sta-taskmanagement", "GTD-kamikudaku", "taskmanagement", "thinkandcreateteck" ]; const ops = await setup({ limit: 10, projects, mark: { yuyasurarin: "/api/pages/yuyasurarin/yuyasurarin/icon", villagepump: "/api/pages/villagepump/井戸端/icon", nishio: "/api/pages/nishio/nishio/icon", takker: "/api/pages/takker/takker/icon", shokai: "/api/pages/shokai/shokai/icon", discordwiki: "/api/pages/discordwiki/discord wiki/icon", work4ai: "/api/pages/work4ai/work4ai/icon", yuyasurarin: "/api/pages/yuyasurarin/yuyasurarin/icon", wogikaze: "/api/pages/wogikaze/wogikaze/icon", "wogikaze-study": "/api/pages/wogikaze-study/wogikaze/icon", rashitamemo: "/api/pages/rashitamemo/rashita/icon", sta: "/api/pages/sta/sta/icon", "sta-taskmanagement": "🐇", "GTD-kamikudaku": "☕", taskmanagement: "/api/pages/taskmanagement/タスク管理のScrapboxについて/icon", thinkandcreateteck: "/api/pages/thinkandcreateteck/このプロジェクトについて/icon", }, }); document.getElementById("text-input")!.addEventListener("keydown", (e) => { if (e.ctrlKey || e.metaKey || e.altKey) return; switch (e.key) { case "Tab": { const executed = e.shiftKey ? ops.selectPrev({ cyclic: true }) : ops.selectNext({ cyclic: true }); if (!executed) return; break; } case "Enter": { if (e.shiftKey) return; if (!ops.confirm()) return; break; } case "Escape": { if (e.shiftKey) return; if (!ops.cancel()) return; break; } default: return; } e.preventDefault(); e.stopPropagation(); });