mirror of
https://github.com/multipleof4/sune.git
synced 2026-02-04 18:17:54 +00:00
This build was committed by a bot.
This commit is contained in:
@@ -484,7 +484,7 @@ const reflectActiveSune = async () => {
|
|||||||
await renderSuneHTML();
|
await renderSuneHTML();
|
||||||
icons();
|
icons();
|
||||||
};
|
};
|
||||||
const suneRow = (a) => `<div class="relative flex items-center gap-2 px-3 py-2 ${a.pinned ? "bg-yellow-50" : ""}"><button data-sune-id="${a.id}" class="flex-1 text-left flex items-center gap-2 ${a.id === SUNE.id ? "font-medium" : ""}">${a.avatar ? `<img src="${esc(a.avatar)}" alt="" class="h-6 w-6 rounded-full object-cover"/>` : `<span class="h-6 w-6 rounded-full bg-gray-200 flex items-center justify-center">✺</span>`}<span class="truncate">${a.pinned ? "📌 " : ""}${esc(a.name)}</span></button><button data-sune-menu="${a.id}" class="h-8 w-8 rounded hover:bg-gray-100 flex items-center justify-center" title="More"><i data-lucide="more-horizontal" class="h-4 w-4"></i></button></div>`;
|
const suneRow = (a) => `<div class="relative flex items-center gap-2 px-3 py-2 ${a.pinned ? "bg-yellow-50" : ""}"><button data-sune-id="${a.id}" class="flex-1 text-left flex items-center gap-2 ${a.id === SUNE.id ? "font-medium" : ""}">${a.avatar ? `<img src="${esc(a.avatar)}" alt="" class="h-8 w-8 rounded-full object-cover"/>` : `<span class="h-6 w-6 rounded-full bg-gray-200 flex items-center justify-center">✺</span>`}<span class="truncate">${a.pinned ? "📌 " : ""}${esc(a.name)}</span></button><button data-sune-menu="${a.id}" class="h-8 w-8 rounded hover:bg-gray-100 flex items-center justify-center" title="More"><i data-lucide="more-horizontal" class="h-4 w-4"></i></button></div>`;
|
||||||
const renderSidebar = window.renderSidebar = () => {
|
const renderSidebar = window.renderSidebar = () => {
|
||||||
const list = [...SUNE.list].sort((a, b) => b.pinned - a.pinned);
|
const list = [...SUNE.list].sort((a, b) => b.pinned - a.pinned);
|
||||||
el.suneList.innerHTML = list.map(suneRow).join("");
|
el.suneList.innerHTML = list.map(suneRow).join("");
|
||||||
@@ -668,7 +668,7 @@ const TKEY = "threads_v1", THREAD = window.THREAD = { list: [], load: async func
|
|||||||
await localforage.setItem(prefix + id, [...state.messages]);
|
await localforage.setItem(prefix + id, [...state.messages]);
|
||||||
if (full) {
|
if (full) {
|
||||||
meta.updatedAt = Date.now();
|
meta.updatedAt = Date.now();
|
||||||
if (u.startsWith("gh://")) meta.status = "modified";
|
if (u.startsWith("gh://") && meta.status !== "new") meta.status = "modified";
|
||||||
await this.save();
|
await this.save();
|
||||||
await renderThreads();
|
await renderThreads();
|
||||||
}
|
}
|
||||||
@@ -678,7 +678,7 @@ const TKEY = "threads_v1", THREAD = window.THREAD = { list: [], load: async func
|
|||||||
th.title = titleFrom(title);
|
th.title = titleFrom(title);
|
||||||
th.updatedAt = Date.now();
|
th.updatedAt = Date.now();
|
||||||
const u = el.threadRepoInput.value.trim();
|
const u = el.threadRepoInput.value.trim();
|
||||||
if (u.startsWith("gh://")) th.status = "modified";
|
if (u.startsWith("gh://") && th.status !== "new") th.status = "modified";
|
||||||
await this.save();
|
await this.save();
|
||||||
await renderThreads();
|
await renderThreads();
|
||||||
}, getLastAssistantMessageId: () => {
|
}, getLastAssistantMessageId: () => {
|
||||||
@@ -791,6 +791,8 @@ $(el.threadList).on("click", async (e) => {
|
|||||||
if (res && res.content) {
|
if (res && res.content) {
|
||||||
msgs = JSON.parse(btou(res.content));
|
msgs = JSON.parse(btou(res.content));
|
||||||
await localforage.setItem(prefix + id, msgs);
|
await localforage.setItem(prefix + id, msgs);
|
||||||
|
th.status = "synced";
|
||||||
|
await THREAD.save();
|
||||||
}
|
}
|
||||||
} catch (e2) {
|
} catch (e2) {
|
||||||
console.error("Remote fetch failed", e2);
|
console.error("Remote fetch failed", e2);
|
||||||
@@ -835,13 +837,13 @@ $(el.threadPopover).on("click", async (e) => {
|
|||||||
const u = el.threadRepoInput.value.trim(), prefix = u.startsWith("gh://") ? "rem_t_" : "t_";
|
const u = el.threadRepoInput.value.trim(), prefix = u.startsWith("gh://") ? "rem_t_" : "t_";
|
||||||
if (act === "pin") {
|
if (act === "pin") {
|
||||||
th.pinned = !th.pinned;
|
th.pinned = !th.pinned;
|
||||||
if (u.startsWith("gh://")) th.status = "modified";
|
if (u.startsWith("gh://") && th.status !== "new") th.status = "modified";
|
||||||
} else if (act === "rename") {
|
} else if (act === "rename") {
|
||||||
const nv = prompt("Rename to:", th.title);
|
const nv = prompt("Rename to:", th.title);
|
||||||
if (nv != null) {
|
if (nv != null) {
|
||||||
th.title = titleFrom(nv);
|
th.title = titleFrom(nv);
|
||||||
th.updatedAt = Date.now();
|
th.updatedAt = Date.now();
|
||||||
if (u.startsWith("gh://")) th.status = "modified";
|
if (u.startsWith("gh://") && th.status !== "new") th.status = "modified";
|
||||||
}
|
}
|
||||||
} else if (act === "delete") {
|
} else if (act === "delete") {
|
||||||
if (confirm("Delete this chat?")) {
|
if (confirm("Delete this chat?")) {
|
||||||
@@ -1420,7 +1422,6 @@ $(el.threadBackBtn).on("click", () => {
|
|||||||
if (p.length > 3) {
|
if (p.length > 3) {
|
||||||
p.pop();
|
p.pop();
|
||||||
el.threadRepoInput.value = p.join("/");
|
el.threadRepoInput.value = p.join("/");
|
||||||
el.threadRepoInput.value = p.join("/");
|
|
||||||
el.threadRepoInput.dispatchEvent(new Event("change"));
|
el.threadRepoInput.dispatchEvent(new Event("change"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1673,7 +1674,16 @@ async function syncActiveThread() {
|
|||||||
const display = partsToText({ content: [{ type: "text", text: finalText }], images: j.images });
|
const display = partsToText({ content: [{ type: "text", text: finalText }], images: j.images });
|
||||||
if (display) renderMarkdown(bubble, display, { enhance: false });
|
if (display) renderMarkdown(bubble, display, { enhance: false });
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
finalise(finalText, [{ type: "text", text: finalText }], j.images);
|
if (finalText !== localText) {
|
||||||
|
finalise(finalText, [{ type: "text", text: finalText }], j.images);
|
||||||
|
} else {
|
||||||
|
await cacheStore.setItem(id, "done");
|
||||||
|
if (state.busy) {
|
||||||
|
setBtnSend();
|
||||||
|
state.busy = false;
|
||||||
|
state.controller = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
await cacheStore.setItem(id, "busy");
|
await cacheStore.setItem(id, "busy");
|
||||||
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -12,7 +12,7 @@
|
|||||||
<script defer src="https://cdn.jsdelivr.net/npm/cash-dom/dist/cash.min.js"></script>
|
<script defer src="https://cdn.jsdelivr.net/npm/cash-dom/dist/cash.min.js"></script>
|
||||||
<script defer src="//unpkg.com/alpinejs"></script>
|
<script defer src="//unpkg.com/alpinejs"></script>
|
||||||
|
|
||||||
<script type="module" crossorigin src="/assets/index-ZFLC2W_P.js"></script>
|
<script type="module" crossorigin src="/assets/index-B_jJyKld.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-JLEDB1oP.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-JLEDB1oP.css">
|
||||||
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
||||||
<body class="bg-white text-gray-900 selection:bg-black/10" x-data @click.window="if($event.target.closest('button')) haptic(); if(!document.getElementById('threadPopover').contains($event.target)&&!$event.target.closest('[data-thread-menu]')) hideThreadPopover(); if(!document.getElementById('sunePopover').contains($event.target)&&!$event.target.closest('[data-sune-menu]')) hideSunePopover(); if(!document.getElementById('userMenu').contains($event.target)&&!document.getElementById('userMenuBtn').contains($event.target)) document.getElementById('userMenu').classList.add('hidden')">
|
<body class="bg-white text-gray-900 selection:bg-black/10" x-data @click.window="if($event.target.closest('button')) haptic(); if(!document.getElementById('threadPopover').contains($event.target)&&!$event.target.closest('[data-thread-menu]')) hideThreadPopover(); if(!document.getElementById('sunePopover').contains($event.target)&&!$event.target.closest('[data-sune-menu]')) hideSunePopover(); if(!document.getElementById('userMenu').contains($event.target)&&!document.getElementById('userMenuBtn').contains($event.target)) document.getElementById('userMenu').classList.add('hidden')">
|
||||||
|
|||||||
2
dist/sw.js
vendored
2
dist/sw.js
vendored
@@ -1 +1 @@
|
|||||||
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const d=e=>i(e,t),l={module:{uri:t},exports:o,require:d};s[t]=Promise.all(n.map(e=>l[e]||d(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"ee3a0cbe5bf8b1e5b886dbed2223626d"},{url:"assets/index-ZFLC2W_P.js",revision:null},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
|
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),c={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>c[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"e62fb0c404f4d8ff32418b5610c8fd66"},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"assets/index-B_jJyKld.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
|
||||||
|
|||||||
Reference in New Issue
Block a user