aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/dist/v3/assets/index-CPnxXrEk.css1
-rw-r--r--web/dist/v3/assets/index-DWEqmxLr.css1
-rw-r--r--web/dist/v3/assets/index-FNdWoCuA.js102
-rw-r--r--web/dist/v3/assets/index-eg2Tn_DA.js102
-rw-r--r--web/dist/v3/index.html4
5 files changed, 105 insertions, 105 deletions
diff --git a/web/dist/v3/assets/index-CPnxXrEk.css b/web/dist/v3/assets/index-CPnxXrEk.css
deleted file mode 100644
index 98e580a..0000000
--- a/web/dist/v3/assets/index-CPnxXrEk.css
+++ /dev/null
@@ -1 +0,0 @@
-:root{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;--bg-color: #ffffff;--text-color: #213547;--sidebar-bg: #f8f9fa;--border-color: #e9ecef;--accent-color: #007bff;--hover-color: #e2e6ea;--sidebar-width: 250px;--item-list-width: 350px}.theme-dark{--bg-color: #1a1a1a;--text-color: #e9ecef;--sidebar-bg: #212529;--border-color: #343a40;--accent-color: #375a7f;--hover-color: #2c3034}.font-serif{font-family:Georgia,serif}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}body{margin:0;color:var(--text-color);background-color:var(--bg-color);height:100vh;overflow:hidden}#app{height:100%}.layout{display:flex;height:100%}.sidebar{width:var(--sidebar-width);background-color:var(--sidebar-bg);border-right:1px solid var(--border-color);display:flex;flex-direction:column}.sidebar-header{padding:1rem;border-bottom:1px solid var(--border-color)}.sidebar-header h2{margin:0;font-size:1.1rem}.sidebar-search{padding:.75rem 1rem;border-bottom:1px solid var(--border-color)}.sidebar-search input{width:100%;padding:.4rem .6rem;background-color:var(--bg-color);border:1px solid var(--border-color);border-radius:4px;color:var(--text-color);font-size:.85rem}.sidebar-scroll{flex:1;overflow-y:auto;padding:1rem 0}.sidebar-section{margin-bottom:2rem}.sidebar-section h3{padding:0 1rem;font-size:.7rem;text-transform:uppercase;color:#888;margin:0 0 .5rem;letter-spacing:.05rem}.sidebar-section ul{list-style:none;padding:0;margin:0}.sidebar-section li a{display:block;padding:.4rem 1rem;text-decoration:none;color:var(--text-color);font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-section li:hover{background-color:var(--hover-color)}.sidebar-section li.active{background-color:var(--hover-color);font-weight:700}.sidebar-section li.active a{color:var(--accent-color)}.sidebar-footer{padding:1rem;border-top:1px solid var(--border-color);display:flex;justify-content:space-between;font-size:.85rem}.sidebar-footer a{color:var(--text-color);text-decoration:none;opacity:.7}.sidebar-footer a:hover{opacity:1}.item-list-pane{width:var(--item-list-width);border-right:1px solid var(--border-color);display:flex;flex-direction:column;background-color:var(--bg-color)}.top-bar{padding:.75rem 1rem;border-bottom:1px solid var(--border-color);background-color:var(--bg-color);height:40px;display:flex;align-items:center}.top-bar h1{margin:0;font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item-list-container{flex:1;overflow-y:auto}.item-list{list-style:none;padding:0;margin:0}.item-row{padding:.75rem 1rem;border-bottom:1px solid var(--border-color);cursor:pointer;transition:background .1s}.item-row:hover{background-color:var(--hover-color)}.item-row.active{background-color:var(--hover-color);border-left:3px solid var(--accent-color)}.item-row.read{opacity:.6}.item-title{font-weight:600;font-size:.9rem;margin-bottom:.2rem;line-height:1.3}.item-meta{font-size:.75rem;color:#888}.load-more{padding:1.5rem;text-align:center;color:#888;font-size:.85rem}.item-detail-pane{flex:1;overflow-y:auto;background-color:var(--bg-color)}.item-detail-content{max-width:700px;margin:0 auto;padding:2rem}.item-detail header{margin-bottom:2rem;border-bottom:1px solid var(--border-color);padding-bottom:1.5rem}.item-detail h1{font-size:1.75rem;margin:0 0 .75rem;line-height:1.2}.item-detail h1 a{color:var(--text-color);text-decoration:none}.item-detail h1 a:hover{text-decoration:underline}.item-actions{display:flex;gap:.5rem;margin-top:1rem}.item-actions button{padding:.3rem .6rem;font-size:.8rem;cursor:pointer;background-color:var(--bg-color);border:1px solid var(--border-color);color:var(--text-color);border-radius:4px}.item-actions button:hover{background-color:var(--hover-color)}.full-content{font-size:1.1rem;line-height:1.7}.full-content img{max-width:100%;height:auto;display:block;margin:1.5rem 0;border-radius:4px}.full-content a{color:var(--accent-color)}.settings-view{padding:2rem}.settings-section{margin-bottom:2rem}.settings-section h3{font-size:1rem;margin-bottom:1rem;border-bottom:1px solid var(--border-color);padding-bottom:.5rem}.theme-options{display:flex;gap:1rem}.theme-options button.active{border-color:var(--accent-color);background-color:var(--hover-color)}.empty-state{display:flex;align-items:center;justify-content:center;height:100%;color:#888;font-size:1.1rem}.loading,.empty{padding:2rem;text-align:center;color:#888}
diff --git a/web/dist/v3/assets/index-DWEqmxLr.css b/web/dist/v3/assets/index-DWEqmxLr.css
new file mode 100644
index 0000000..e5cfd30
--- /dev/null
+++ b/web/dist/v3/assets/index-DWEqmxLr.css
@@ -0,0 +1 @@
+:root{--font-body: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;--font-heading: "Helvetica Neue", Helvetica, Arial, sans-serif;--font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;line-height:1.5;font-size:18px;--bg-color: #ffffff;--text-color: rgba(0, 0, 0, .87);--sidebar-bg: #ccc;--link-color: #0000ee;--border-color: #999;--accent-color: #007bff;color-scheme:light dark}body{margin:0;font-family:var(--font-body);background-color:var(--bg-color);color:var(--text-color);height:100vh;overflow:hidden}#app{height:100%}.layout{display:flex;height:100%;width:100%}.sidebar{width:14rem;background:#ffffff0d;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-right:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;height:100%;overflow:hidden;z-index:100;padding:1.5rem}.theme-dark .sidebar{background:#0003;border-right-color:#ffffff0d}.sidebar-header h2{font-family:var(--font-heading);font-size:1.5rem;margin:0 0 2rem;opacity:.8;cursor:pointer}.sidebar-search{margin-bottom:2rem}.sidebar-search input{width:100%;border-radius:20px;background:#0000000d;border:1px solid rgba(255,255,255,.1);color:var(--text-color);padding:.5rem 1rem;font-size:.9rem}.sidebar-scroll{flex:1;overflow-y:auto;margin:0 -1.5rem;padding:0 1.5rem}.sidebar-section h3{font-family:var(--font-heading);font-size:.75rem;text-transform:uppercase;letter-spacing:.1em;opacity:.5;margin-top:2rem;margin-bottom:.5rem;font-weight:600}.sidebar-section ul{list-style:none;padding:0;margin:0}.sidebar-section li a{display:block;padding:.4rem .8rem;margin:.2rem 0;border-radius:8px;transition:all .2s ease;font-weight:500;text-decoration:none;color:var(--text-color);opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-section li a:hover{background:#ffffff1a;opacity:1;transform:translate(4px)}.sidebar-section li.active a{background:#ffffff40;opacity:1;font-weight:700;box-shadow:0 4px 12px #0000001a;border:1px solid rgba(255,255,255,.2)}.sidebar-footer{margin-top:auto;padding-top:1.5rem;border-top:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;gap:.5rem}.sidebar-footer a{opacity:.6;padding:.5rem .8rem;border-radius:8px;text-decoration:none;color:var(--text-color);font-size:.9rem;font-family:var(--font-heading)}.sidebar-footer a:hover{background:#ffffff0d;opacity:1}.main-content{flex:1;min-width:0;overflow-y:auto;background-color:var(--bg-color);padding:2rem}.main-content>*{max-width:35em;margin:0 auto}.item-list{list-style:none;padding:0;margin:0}.feed-item{padding:1rem 0;margin-top:5rem;border-bottom:none}.item-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:.5rem}.item-title{font-family:var(--font-heading);font-size:1.8rem;font-weight:700;text-decoration:none;color:var(--link-color);display:block;flex:1;cursor:pointer}.item-title:hover{text-decoration:underline}.star-btn{background:none;border:none;cursor:pointer;font-size:1.25rem;padding:0 0 0 .5rem;vertical-align:middle;transition:color .2s;line-height:1}.star-btn.is-starred{color:#00f}.star-btn.is-unstarred{color:var(--text-color);opacity:.3}.dateline{margin-top:0;font-weight:400;font-size:.75em;color:#ccc;margin-bottom:1rem}.dateline a{color:#ccc;text-decoration:none}.item-description{color:var(--text-color);line-height:1.5;font-size:1rem;margin-top:1rem;overflow-wrap:break-word;word-break:break-word}.item-description img{max-width:100%;height:auto;display:block;margin:1rem 0}.scrape-btn{background:var(--bg-color);border:1px solid var(--border-color, #ccc);color:#00f;cursor:pointer;font-family:var(--font-heading);font-weight:700;font-size:.8rem;padding:2px 6px;margin-left:.5rem}.theme-dark{--bg-color: #000000;--text-color: #ffffff;--sidebar-bg: #111111;--link-color: rgb(90, 200, 250);--border-color: #333}.font-serif{--font-body: Georgia, "Times New Roman", Times, serif;font-family:var(--font-body)}.font-mono{--font-body: Menlo, Monaco, Consolas, "Courier New", monospace;font-family:var(--font-body)}.settings-view{padding-top:2rem}.settings-section{margin-bottom:2.5rem}.settings-section h3{font-family:var(--font-heading);border-bottom:1px solid var(--border-color);padding-bottom:.5rem;margin-bottom:1rem}.theme-options{display:flex;gap:1rem}button{border-radius:8px;border:1px solid var(--border-color);padding:.6em 1.2em;font-size:1em;font-weight:700;font-family:inherit;background-color:#f9f9f9;cursor:pointer;transition:all .2s}.theme-dark button{background-color:#1a1a1a;color:#fff;border-color:#333}button.active{border-color:var(--accent-color);background-color:#eef}.theme-dark button.active{background-color:#224;border-color:var(--accent-color)}@media(max-width:768px){.sidebar{display:none}}
diff --git a/web/dist/v3/assets/index-FNdWoCuA.js b/web/dist/v3/assets/index-FNdWoCuA.js
deleted file mode 100644
index 96a65fc..0000000
--- a/web/dist/v3/assets/index-FNdWoCuA.js
+++ /dev/null
@@ -1,102 +0,0 @@
-(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const d of r.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=i(n);fetch(n.href,r)}})();function k(t){const i=`; ${document.cookie}`.split(`; ${t}=`);if(i.length===2)return i.pop()?.split(";").shift()}async function c(t,e){const i=e?.method?.toUpperCase()||"GET",s=["POST","PUT","DELETE"].includes(i),n=new Headers(e?.headers||{});if(s){const r=k("csrf_token");r&&n.set("X-CSRF-Token",r)}return fetch(t,{...e,headers:n,credentials:"include"})}class F extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";setFeeds(e){this.feeds=e,this.emit("feeds-updated")}setTags(e){this.tags=e,this.emit("tags-updated")}setItems(e,i=!1){i?this.items=[...this.items,...e]:this.items=e,this.emit("items-updated")}setActiveFeed(e){this.activeFeedId=e,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(e){this.activeTagName=e,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(e){this.filter!==e&&(this.filter=e,this.emit("filter-updated"))}setSearchQuery(e){this.searchQuery!==e&&(this.searchQuery=e,this.emit("search-updated"))}setLoading(e){this.loading=e,this.emit("loading-state-changed")}setHasMore(e){this.hasMore=e}setTheme(e){this.theme=e,localStorage.setItem("neko-theme",e),this.emit("theme-updated")}setFontTheme(e){this.fontTheme=e,localStorage.setItem("neko-font-theme",e),this.emit("theme-updated")}emit(e,i){this.dispatchEvent(new CustomEvent(e,{detail:i}))}on(e,i){this.addEventListener(e,i)}}const a=new F;class _ extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const e=new URL(window.location.href),s=e.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let n="/";const r={};return s[0]==="feed"&&s[1]?(n="/feed",r.feedId=s[1]):s[0]==="tag"&&s[1]&&(n="/tag",r.tagName=decodeURIComponent(s[1])),{path:n,params:r,query:e.searchParams}}navigate(e,i){let s=`/v3${e}`;if(i){const n=new URLSearchParams(i);s+=`?${n.toString()}`}window.history.pushState({},"",s),this.handleRouteChange()}updateQuery(e){const i=new URL(window.location.href);for(const[s,n]of Object.entries(e))n?i.searchParams.set(s,n):i.searchParams.delete(s);window.history.pushState({},"",i.toString()),this.handleRouteChange()}}const u=new _;function R(t,e){return`
- <li class="feed-item ${e?"active":""}" data-id="${t._id}">
- <a href="/v3/feed/${t._id}" class="feed-link" onclick="event.preventDefault(); window.app.navigate('/feed/${t._id}')">
- ${t.title||t.url}
- </a>
- </li>
- `}const v=document.querySelector("#app");function C(){v.className=`theme-${a.theme} font-${a.fontTheme}`,v.innerHTML=`
- <div class="layout">
- <aside class="sidebar">
- <div class="sidebar-header">
- <h2 onclick="window.app.navigate('/')" style="cursor: pointer">Neko v3</h2>
- </div>
- <div class="sidebar-search">
- <input type="search" id="search-input" placeholder="Search..." value="${a.searchQuery}">
- </div>
- <div class="sidebar-scroll">
- <section class="sidebar-section">
- <h3>Filters</h3>
- <ul id="filter-list" class="filter-list">
- <li class="filter-item" data-filter="unread"><a href="#" onclick="event.preventDefault(); window.app.setFilter('unread')">Unread</a></li>
- <li class="filter-item" data-filter="all"><a href="#" onclick="event.preventDefault(); window.app.setFilter('all')">All</a></li>
- <li class="filter-item" data-filter="starred"><a href="#" onclick="event.preventDefault(); window.app.setFilter('starred')">Starred</a></li>
- </ul>
- </section>
- <section class="sidebar-section">
- <h3>Tags</h3>
- <ul id="tag-list" class="tag-list"></ul>
- </section>
- <section class="sidebar-section">
- <h3>Feeds</h3>
- <ul id="feed-list" class="feed-list"></ul>
- </section>
- </div>
- <div class="sidebar-footer">
- <a href="#" onclick="event.preventDefault(); window.app.navigate('/settings')">Settings</a>
- <a href="#" onclick="event.preventDefault(); window.app.logout()">Logout</a>
- </div>
- </aside>
- <section class="item-list-pane">
- <header class="top-bar">
- <h1 id="view-title">All Items</h1>
- </header>
- <div id="item-list-container" class="item-list-container"></div>
- </section>
- <main class="item-detail-pane" id="main-pane">
- <div id="item-detail-content" class="item-detail-content">
- <div class="empty-state">Select an item to read</div>
- </div>
- </main>
- </div>
- `,document.getElementById("search-input")?.addEventListener("input",e=>{const i=e.target.value;window.app.setSearch(i)})}C();const w=document.getElementById("feed-list"),y=document.getElementById("tag-list"),T=document.getElementById("filter-list"),h=document.getElementById("view-title"),l=document.getElementById("item-list-container"),p=document.getElementById("item-detail-content");let o=null;function $(){const{feeds:t,activeFeedId:e}=a;w&&(w.innerHTML=t.map(i=>R(i,i._id===e)).join(""))}function E(){const{tags:t,activeTagName:e}=a;y&&(y.innerHTML=t.map(i=>`
- <li class="tag-item ${i.title===e?"active":""}">
- <a href="/v3/tag/${encodeURIComponent(i.title)}" class="tag-link" onclick="event.preventDefault(); window.app.navigate('/tag/${encodeURIComponent(i.title)}')">
- ${i.title}
- </a>
- </li>
- `).join(""))}function L(){const{filter:t}=a;T&&T.querySelectorAll(".filter-item").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-filter")===t)})}function S(){const{items:t,loading:e}=a;if(!l)return;if(e&&t.length===0){l.innerHTML='<p class="loading">Loading items...</p>';return}if(t.length===0){l.innerHTML='<p class="empty">No items found.</p>';return}l.innerHTML=`
- <ul class="item-list">
- ${t.map(s=>`
- <li class="item-row ${s.read?"read":""} ${s._id===o?"active":""}" data-id="${s._id}">
- <div class="item-title">${s.title}</div>
- <div class="item-meta">${s.feed_title||""}</div>
- </li>
- `).join("")}
- </ul>
- ${a.hasMore?'<div id="load-more" class="load-more">Loading more...</div>':""}
- `,l.querySelectorAll(".item-row").forEach(s=>{s.addEventListener("click",()=>{const n=parseInt(s.getAttribute("data-id")||"0");b(n)})});const i=document.getElementById("load-more");i&&new IntersectionObserver(n=>{n[0].isIntersecting&&!a.loading&&a.hasMore&&P()},{threshold:.1}).observe(i)}async function b(t,e=!1){o=t;const i=a.items.find(s=>s._id===t);if(i&&(l.querySelectorAll(".item-row").forEach(s=>{const n=parseInt(s.getAttribute("data-id")||"0");s.classList.toggle("active",n===t),e&&n===t&&s.scrollIntoView({block:"nearest"})}),p.innerHTML=`
- <article class="item-detail">
- <header>
- <h1><a href="${i.url}" target="_blank">${i.title}</a></h1>
- <div class="item-meta">
- From ${i.feed_title||"Unknown"} on ${new Date(i.publish_date).toLocaleString()}
- </div>
- <div class="item-actions">
- <button onclick="window.app.toggleStar(${i._id})">${i.starred?"★ Unstar":"☆ Star"}</button>
- <button onclick="window.app.toggleRead(${i._id})">${i.read?"Unread":"Read"}</button>
- </div>
- </header>
- <div id="full-content" class="full-content">
- ${i.description||"No description available."}
- </div>
- </article>
- `,i.read||f(i._id,{read:!0}),i.url&&(!i.full_content||i.full_content===i.description)))try{const s=await c(`/api/item/${i._id}/content`);if(s.ok){const n=await s.json();if(n.full_content){i.full_content=n.full_content;const r=document.getElementById("full-content");r&&(r.innerHTML=n.full_content)}}}catch(s){console.error("Failed to fetch full content",s)}}async function f(t,e){try{if((await c(`/api/item/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok){const s=a.items.find(n=>n._id===t);if(s){Object.assign(s,e);const n=l.querySelector(`.item-row[data-id="${t}"]`);if(n&&e.read!==void 0&&n.classList.toggle("read",e.read),o===t){const r=p.querySelector(".item-actions button");r&&e.starred!==void 0&&(r.textContent=e.starred?"★ Unstar":"☆ Star")}}}}catch(i){console.error("Failed to update item",i)}}function M(){h.textContent="Settings",l.innerHTML="",p.innerHTML=`
- <div class="settings-view">
- <h2>Settings</h2>
- <section class="settings-section">
- <h3>Theme</h3>
- <div class="theme-options">
- <button class="${a.theme==="light"?"active":""}" onclick="window.app.setTheme('light')">Light</button>
- <button class="${a.theme==="dark"?"active":""}" onclick="window.app.setTheme('dark')">Dark</button>
- </div>
- </section>
- <section class="settings-section">
- <h3>Font</h3>
- <select onchange="window.app.setFontTheme(this.value)">
- <option value="default" ${a.fontTheme==="default"?"selected":""}>Default</option>
- <option value="serif" ${a.fontTheme==="serif"?"selected":""}>Serif</option>
- <option value="mono" ${a.fontTheme==="mono"?"selected":""}>Monospace</option>
- </select>
- </section>
- </div>
- `}async function N(){try{const t=await c("/api/feed/");if(!t.ok)throw new Error("Failed to fetch feeds");const e=await t.json();a.setFeeds(e)}catch(t){console.error(t)}}async function A(){try{const t=await c("/api/tag");if(!t.ok)throw new Error("Failed to fetch tags");const e=await t.json();a.setTags(e)}catch(t){console.error(t)}}async function m(t,e,i=!1){a.setLoading(!0);try{let s="/api/stream";const n=new URLSearchParams;t&&n.append("feed_id",t),e&&n.append("tag",e),a.searchQuery&&n.append("q",a.searchQuery),a.filter==="unread"&&n.append("read","false"),a.filter==="starred"&&n.append("starred","true"),i&&a.items.length>0&&n.append("max_id",String(a.items[a.items.length-1]._id));const r=await c(`${s}?${n.toString()}`);if(!r.ok)throw new Error("Failed to fetch items");const d=await r.json();a.setHasMore(d.length>=50),a.setItems(d,i),i||(o=null,p.innerHTML='<div class="empty-state">Select an item to read</div>')}catch(s){console.error(s),i||a.setItems([])}finally{a.setLoading(!1)}}async function P(){const t=u.getCurrentRoute();m(t.params.feedId,t.params.tagName,!0)}function g(){const t=u.getCurrentRoute(),e=t.query.get("filter");e&&["unread","all","starred"].includes(e)&&a.setFilter(e);const i=t.query.get("q");if(i!==null&&a.setSearchQuery(i),t.path==="/settings"){M();return}if(t.path==="/feed"&&t.params.feedId){const s=parseInt(t.params.feedId);a.setActiveFeed(s);const n=a.feeds.find(r=>r._id===s);h.textContent=n?n.title:`Feed ${s}`,m(t.params.feedId)}else t.path==="/tag"&&t.params.tagName?(a.setActiveTag(t.params.tagName),h.textContent=`Tag: ${t.params.tagName}`,m(void 0,t.params.tagName)):(a.setActiveFeed(null),a.setActiveTag(null),h.textContent="All Items",m())}window.addEventListener("keydown",t=>{if(!["INPUT","TEXTAREA"].includes(t.target.tagName))switch(t.key){case"j":I(1);break;case"k":I(-1);break;case"r":if(o){const e=a.items.find(i=>i._id===o);e&&f(e._id,{read:!e.read})}break;case"s":if(o){const e=a.items.find(i=>i._id===o);e&&f(e._id,{starred:!e.starred})}break;case"/":t.preventDefault(),document.getElementById("search-input")?.focus();break}});function I(t){if(a.items.length===0)return;let e=a.items.findIndex(i=>i._id===o);e+=t,e>=0&&e<a.items.length&&b(a.items[e]._id,!0)}a.on("feeds-updated",$);a.on("tags-updated",E);a.on("active-feed-updated",$);a.on("active-tag-updated",E);a.on("filter-updated",()=>{L(),g()});a.on("search-updated",()=>{const t=document.getElementById("search-input");t&&t.value!==a.searchQuery&&(t.value=a.searchQuery),g()});a.on("theme-updated",()=>{v.className=`theme-${a.theme} font-${a.fontTheme}`});a.on("items-updated",S);a.on("loading-state-changed",S);u.addEventListener("route-changed",g);window.app={navigate:t=>u.navigate(t),setFilter:t=>u.updateQuery({filter:t}),setSearch:t=>{u.updateQuery({q:t})},setTheme:t=>a.setTheme(t),setFontTheme:t=>a.setFontTheme(t),toggleStar:t=>{const e=a.items.find(i=>i._id===t);e&&f(t,{starred:!e.starred})},toggleRead:t=>{const e=a.items.find(i=>i._id===t);e&&f(t,{read:!e.read})},logout:async()=>{await c("/api/logout",{method:"POST"}),window.location.href="/login/"}};async function U(){if((await c("/api/auth")).status===401){window.location.href="/login/";return}L(),await Promise.all([N(),A()]),g()}U();
diff --git a/web/dist/v3/assets/index-eg2Tn_DA.js b/web/dist/v3/assets/index-eg2Tn_DA.js
new file mode 100644
index 0000000..575654a
--- /dev/null
+++ b/web/dist/v3/assets/index-eg2Tn_DA.js
@@ -0,0 +1,102 @@
+(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function a(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=a(s);fetch(s.href,r)}})();function F(t){const a=`; ${document.cookie}`.split(`; ${t}=`);if(a.length===2)return a.pop()?.split(";").shift()}async function g(t,e){const a=e?.method?.toUpperCase()||"GET",i=["POST","PUT","DELETE"].includes(a),s=new Headers(e?.headers||{});if(i){const r=F("csrf_token");r&&s.set("X-CSRF-Token",r)}return fetch(t,{...e,headers:s,credentials:"include"})}class A extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";setFeeds(e){this.feeds=e,this.emit("feeds-updated")}setTags(e){this.tags=e,this.emit("tags-updated")}setItems(e,a=!1){a?this.items=[...this.items,...e]:this.items=e,this.emit("items-updated")}setActiveFeed(e){this.activeFeedId=e,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(e){this.activeTagName=e,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(e){this.filter!==e&&(this.filter=e,this.emit("filter-updated"))}setSearchQuery(e){this.searchQuery!==e&&(this.searchQuery=e,this.emit("search-updated"))}setLoading(e){this.loading=e,this.emit("loading-state-changed")}setHasMore(e){this.hasMore=e}setTheme(e){this.theme=e,localStorage.setItem("neko-theme",e),this.emit("theme-updated")}setFontTheme(e){this.fontTheme=e,localStorage.setItem("neko-font-theme",e),this.emit("theme-updated")}emit(e,a){this.dispatchEvent(new CustomEvent(e,{detail:a}))}on(e,a){this.addEventListener(e,a)}}const n=new A;class R extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const e=new URL(window.location.href),i=e.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let s="/";const r={};return i[0]==="feed"&&i[1]?(s="/feed",r.feedId=i[1]):i[0]==="tag"&&i[1]&&(s="/tag",r.tagName=decodeURIComponent(i[1])),{path:s,params:r,query:e.searchParams}}navigate(e,a){let i=`/v3${e}`;if(a){const s=new URLSearchParams(a);i+=`?${s.toString()}`}window.history.pushState({},"",i),this.handleRouteChange()}updateQuery(e){const a=new URL(window.location.href);for(const[i,s]of Object.entries(e))s?a.searchParams.set(i,s):a.searchParams.delete(i);window.history.pushState({},"",a.toString()),this.handleRouteChange()}}const d=new R;function B(t){const e=new Date(t.publish_date).toLocaleDateString();return`
+ <li class="feed-item ${t.read?"read":"unread"}" data-id="${t._id}">
+ <div class="item-header">
+ <a href="${t.url}" target="_blank" rel="noopener noreferrer" class="item-title" data-action="open">
+ ${t.title||"(No Title)"}
+ </a>
+ <button class="star-btn ${t.starred?"is-starred":"is-unstarred"}" title="${t.starred?"Unstar":"Star"}" data-action="toggle-star">
+ ★
+ </button>
+ </div>
+ <div class="dateline">
+ <a href="${t.url}" target="_blank" rel="noopener noreferrer">
+ ${e}
+ ${t.feed_title?` - ${t.feed_title}`:""}
+ </a>
+ <div class="item-actions" style="display: inline-block; float: right;">
+ ${t.full_content?"":`
+ <button class="scrape-btn" title="Load Full Content" data-action="scrape">
+ text
+ </button>
+ `}
+ </div>
+ </div>
+ ${t.full_content||t.description?`
+ <div class="item-description">
+ ${t.full_content||t.description}
+ </div>
+ `:""}
+ </li>
+ `}let c=null,f=null;function C(){f=document.querySelector("#app"),f&&(f.className=`theme-${n.theme} font-${n.fontTheme}`,f.innerHTML=`
+ <div class="layout">
+ <aside class="sidebar" id="sidebar">
+ <div class="sidebar-header">
+ <h2 id="logo-link">Neko v3</h2>
+ </div>
+ <div class="sidebar-search">
+ <input type="search" id="search-input" placeholder="Search..." value="${n.searchQuery}">
+ </div>
+ <div class="sidebar-scroll">
+ <section class="sidebar-section">
+ <h3>Filters</h3>
+ <ul id="filter-list">
+ <li class="filter-item" data-filter="unread"><a href="/v3/?filter=unread" data-nav="filter" data-value="unread">Unread</a></li>
+ <li class="filter-item" data-filter="all"><a href="/v3/?filter=all" data-nav="filter" data-value="all">All</a></li>
+ <li class="filter-item" data-filter="starred"><a href="/v3/?filter=starred" data-nav="filter" data-value="starred">Starred</a></li>
+ </ul>
+ </section>
+ <section class="sidebar-section">
+ <h3>Tags</h3>
+ <ul id="tag-list"></ul>
+ </section>
+ <section class="sidebar-section">
+ <h3>Feeds</h3>
+ <ul id="feed-list"></ul>
+ </section>
+ </div>
+ <div class="sidebar-footer">
+ <a href="/v3/settings" id="settings-link">Settings</a>
+ <a href="#" id="logout-button">Logout</a>
+ </div>
+ </aside>
+ <main class="main-content" id="main-content">
+ <div id="content-area"></div>
+ </main>
+ </div>
+ `,N())}function N(){document.getElementById("search-input")?.addEventListener("input",o=>{const h=o.target.value;d.updateQuery({q:h})}),document.getElementById("logo-link")?.addEventListener("click",()=>d.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",o=>{o.preventDefault(),U()}),document.getElementById("settings-link")?.addEventListener("click",o=>{o.preventDefault(),d.navigate("/settings")}),document.getElementById("sidebar")?.addEventListener("click",o=>{const l=o.target.closest("a");if(!l)return;const p=l.getAttribute("data-nav");if(p==="filter"){o.preventDefault();const m=l.getAttribute("data-value");d.updateQuery({filter:m})}else if(p==="tag"){o.preventDefault();const m=l.getAttribute("data-value");d.navigate(`/tag/${encodeURIComponent(m)}`)}else if(p==="feed"){o.preventDefault();const m=l.getAttribute("data-value");d.navigate(`/feed/${m}`)}}),document.getElementById("content-area")?.addEventListener("click",o=>{const h=o.target,l=h.closest('[data-action="toggle-star"]');if(l){const u=l.closest("[data-id]");if(u){const v=parseInt(u.getAttribute("data-id"));M(v)}return}const p=h.closest('[data-action="scrape"]');if(p){const u=p.closest("[data-id]");if(u){const v=parseInt(u.getAttribute("data-id"));P(v)}return}const m=h.closest('[data-action="open"]'),L=h.closest(".feed-item");if(L&&!m){const u=parseInt(L.getAttribute("data-id")),v=n.items.find(_=>_._id===u);v&&!v.read&&y(u,{read:!0})}})}function E(){const{feeds:t,activeFeedId:e}=n,a=document.getElementById("feed-list");a&&(a.innerHTML=t.map(i=>`
+ <li class="${i._id===e?"active":""}">
+ <a href="/v3/feed/${i._id}" data-nav="feed" data-value="${i._id}">
+ ${i.title||i.url}
+ </a>
+ </li>
+ `).join(""))}function $(){const{tags:t,activeTagName:e}=n,a=document.getElementById("tag-list");a&&(a.innerHTML=t.map(i=>`
+ <li class="${i.title===e?"active":""}">
+ <a href="/v3/tag/${encodeURIComponent(i.title)}" data-nav="tag" data-value="${i.title}">
+ ${i.title}
+ </a>
+ </li>
+ `).join(""))}function k(){const{filter:t}=n,e=document.getElementById("filter-list");e&&e.querySelectorAll("li").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-filter")===t)})}function w(){const{items:t,loading:e}=n,a=document.getElementById("content-area");if(!a||d.getCurrentRoute().path==="/settings")return;if(e&&t.length===0){a.innerHTML='<p class="loading">Loading items...</p>';return}if(t.length===0){a.innerHTML='<p class="empty">No items found.</p>';return}a.innerHTML=`
+ <ul class="item-list">
+ ${t.map(s=>B(s)).join("")}
+ </ul>
+ ${n.hasMore?'<div id="load-more-sentinel" class="loading-more">Loading more...</div>':""}
+ `;const i=document.getElementById("load-more-sentinel");i&&new IntersectionObserver(r=>{r[0].isIntersecting&&!n.loading&&n.hasMore&&O()},{threshold:.1}).observe(i)}function S(){const t=document.getElementById("content-area");if(!t)return;t.innerHTML=`
+ <div class="settings-view">
+ <h2>Settings</h2>
+ <section class="settings-section">
+ <h3>Theme</h3>
+ <div class="theme-options" id="theme-options">
+ <button class="${n.theme==="light"?"active":""}" data-theme="light">Light</button>
+ <button class="${n.theme==="dark"?"active":""}" data-theme="dark">Dark</button>
+ </div>
+ </section>
+ <section class="settings-section">
+ <h3>Font</h3>
+ <select id="font-selector">
+ <option value="default" ${n.fontTheme==="default"?"selected":""}>Default (Serif)</option>
+ <option value="serif" ${n.fontTheme==="serif"?"selected":""}>Serif (Georgia)</option>
+ <option value="mono" ${n.fontTheme==="mono"?"selected":""}>Monospace</option>
+ </select>
+ </section>
+ </div>
+ `,document.getElementById("theme-options")?.addEventListener("click",i=>{const s=i.target.closest("button");if(s){const r=s.getAttribute("data-theme");n.setTheme(r),S()}});const a=document.getElementById("font-selector");a?.addEventListener("change",()=>{n.setFontTheme(a.value)})}async function M(t){const e=n.items.find(a=>a._id===t);e&&y(t,{starred:!e.starred})}async function P(t){if(n.items.find(a=>a._id===t))try{const a=await g(`/api/item/${t}/content`);if(a.ok){const i=await a.json();i.full_content&&y(t,{full_content:i.full_content})}}catch(a){console.error("Failed to fetch full content",a)}}async function y(t,e){try{if((await g(`/api/item/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok){const i=n.items.find(s=>s._id===t);if(i){Object.assign(i,e);const s=document.querySelector(`.feed-item[data-id="${t}"]`);if(s){if(e.read!==void 0&&s.classList.toggle("read",e.read),e.starred!==void 0){const r=s.querySelector(".star-btn");r&&(r.classList.toggle("is-starred",e.starred),r.classList.toggle("is-unstarred",!e.starred),r.setAttribute("title",e.starred?"Unstar":"Star"))}e.full_content&&w()}}}}catch(a){console.error("Failed to update item",a)}}async function Q(){const t=await g("/api/feed/");if(t.ok){const e=await t.json();n.setFeeds(e)}}async function q(){const t=await g("/api/tag");if(t.ok){const e=await t.json();n.setTags(e)}}async function b(t,e,a=!1){n.setLoading(!0);try{const i=new URLSearchParams;t&&i.append("feed_id",t),e&&i.append("tag",e),n.searchQuery&&i.append("q",n.searchQuery),n.filter==="unread"&&i.append("read","false"),n.filter==="starred"&&i.append("starred","true"),a&&n.items.length>0&&i.append("max_id",String(n.items[n.items.length-1]._id));const s=await g(`/api/stream?${i.toString()}`);if(s.ok){const r=await s.json();n.setHasMore(r.length>=50),n.setItems(r,a)}}finally{n.setLoading(!1)}}async function O(){const t=d.getCurrentRoute();b(t.params.feedId,t.params.tagName,!0)}async function U(){await g("/api/logout",{method:"POST"}),window.location.href="/login/"}function I(){const t=d.getCurrentRoute(),e=t.query.get("filter");e&&["unread","all","starred"].includes(e)&&n.setFilter(e);const a=t.query.get("q");if(a!==null&&n.setSearchQuery(a),t.path==="/settings"){S();return}if(t.path==="/feed"&&t.params.feedId){const i=parseInt(t.params.feedId);n.setActiveFeed(i),b(t.params.feedId)}else t.path==="/tag"&&t.params.tagName?(n.setActiveTag(t.params.tagName),b(void 0,t.params.tagName)):(n.setActiveFeed(null),n.setActiveTag(null),b())}window.addEventListener("keydown",t=>{if(!["INPUT","TEXTAREA"].includes(t.target.tagName))switch(t.key){case"j":T(1);break;case"k":T(-1);break;case"r":if(c){const e=n.items.find(a=>a._id===c);e&&y(e._id,{read:!e.read})}break;case"s":if(c){const e=n.items.find(a=>a._id===c);e&&y(e._id,{starred:!e.starred})}break;case"/":t.preventDefault(),document.getElementById("search-input")?.focus();break}});function T(t){if(n.items.length===0)return;let e=n.items.findIndex(a=>a._id===c);if(e+=t,e>=0&&e<n.items.length){c=n.items[e]._id;const a=document.querySelector(`.feed-item[data-id="${c}"]`);a&&a.scrollIntoView({block:"nearest"}),n.items[e].read||y(c,{read:!0})}else if(e===-1){c=n.items[0]._id;const a=document.querySelector(`.feed-item[data-id="${c}"]`);a&&a.scrollIntoView({block:"nearest"})}}n.on("feeds-updated",E);n.on("tags-updated",$);n.on("active-feed-updated",E);n.on("active-tag-updated",$);n.on("filter-updated",()=>{k(),I()});n.on("search-updated",()=>{const t=document.getElementById("search-input");t&&t.value!==n.searchQuery&&(t.value=n.searchQuery),I()});n.on("theme-updated",()=>{f||(f=document.querySelector("#app")),f&&(f.className=`theme-${n.theme} font-${n.fontTheme}`)});n.on("items-updated",w);n.on("loading-state-changed",w);d.addEventListener("route-changed",I);window.app={navigate:t=>d.navigate(t)};async function j(){const t=await g("/api/auth");if(!t||t.status===401){window.location.href="/login/";return}C(),k();try{await Promise.all([Q(),q()])}catch(e){console.error("Initial fetch failed",e)}I()}typeof window<"u"&&!window.__VITEST__&&j();
diff --git a/web/dist/v3/index.html b/web/dist/v3/index.html
index 616f437..7705abf 100644
--- a/web/dist/v3/index.html
+++ b/web/dist/v3/index.html
@@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>frontend-vanilla</title>
- <script type="module" crossorigin src="/v3/assets/index-FNdWoCuA.js"></script>
- <link rel="stylesheet" crossorigin href="/v3/assets/index-CPnxXrEk.css">
+ <script type="module" crossorigin src="/v3/assets/index-eg2Tn_DA.js"></script>
+ <link rel="stylesheet" crossorigin href="/v3/assets/index-DWEqmxLr.css">
</head>
<body>
<div id="app"></div>