8 Commits

Author SHA1 Message Date
github-actions[bot]
ded71012f4 This build was committed by a bot. 2026-09-02 03:04:12 +00:00
0d7264eb29 Feat: Enable fuzzyLink for markdown-it v15
Co-authored-by: gemini-3.7-flash <noreply@google.com>
2026-09-01 20:03:55 -07:00
799baf2079 Fix: Correct markdown-it v15 UMD CDN path
Co-authored-by: gemini-3.7-flash <noreply@google.com>
2026-09-01 20:03:48 -07:00
github-actions[bot]
8db03da16f This build was committed by a bot. 2026-09-02 02:56:25 +00:00
487400d174 upgrade highlightjs to 11.12.0 2026-09-01 19:41:41 -07:00
github-actions[bot]
555ceedee9 This build was committed by a bot. 2026-09-02 02:30:11 +00:00
a0132cd48b upgrade gh css version 2026-09-01 19:29:54 -07:00
github-actions[bot]
8d9e6d6352 This build was committed by a bot. 2026-09-02 02:17:31 +00:00
6 changed files with 73 additions and 19 deletions

View File

@@ -324,7 +324,9 @@ var el = window.el = Object.fromEntries([
"threadRepoInput", "threadRepoInput",
"threadBackBtn", "threadBackBtn",
"threadFolderBtn", "threadFolderBtn",
"threadSyncBtn" "threadSyncBtn",
"suneRepoInput",
"suneSyncBtn"
].map((id) => [id, document.getElementById(id)])); ].map((id) => [id, document.getElementById(id)]));
//#endregion //#endregion
//#region src/utils.js //#region src/utils.js
@@ -600,6 +602,7 @@ var md = window.md = window.markdownit({
typographer: true, typographer: true,
breaks: true breaks: true
}).use(mathjax3); }).use(mathjax3);
md.linkify.set({ fuzzyLink: true });
function enhanceCodeBlocks(root, doHL = true) { function enhanceCodeBlocks(root, doHL = true) {
window.$(root).find("pre>code").each((i, code) => { window.$(root).find("pre>code").each((i, code) => {
if (code.textContent.length > 2e5) return; if (code.textContent.length > 2e5) return;
@@ -879,6 +882,7 @@ var SYSTEM_KEYS = new Set([
"sunes_v1", "sunes_v1",
"active_sune_id", "active_sune_id",
"thread_repo_url", "thread_repo_url",
"sune_repo_url",
"user_name", "user_name",
"user_avatar", "user_avatar",
"provider", "provider",
@@ -2035,8 +2039,9 @@ USER.logMany = async (msgs) => {
}; };
async function init() { async function init() {
gcStorage(); gcStorage();
const u = localStorage.getItem("thread_repo_url") || ""; const u = localStorage.getItem("thread_repo_url") || "", suR = localStorage.getItem("sune_repo_url") || "";
el.threadRepoInput.value = u; el.threadRepoInput.value = u;
el.suneRepoInput.value = suR;
el.threadFolderBtn.classList.toggle("hidden", !u.startsWith("gh://")); el.threadFolderBtn.classList.toggle("hidden", !u.startsWith("gh://"));
el.threadBackBtn.classList.toggle("hidden", !u.startsWith("gh://") || u.split("/").length <= 3); el.threadBackBtn.classList.toggle("hidden", !u.startsWith("gh://") || u.split("/").length <= 3);
await THREAD.load(); await THREAD.load();
@@ -2213,6 +2218,53 @@ $(el.threadSyncBtn).on("click", async () => {
alert("Sync failed: " + e.message); alert("Sync failed: " + e.message);
} }
}); });
$(el.suneRepoInput).on("change", () => {
localStorage.setItem("sune_repo_url", el.suneRepoInput.value.trim());
});
$(el.suneSyncBtn).on("click", async () => {
const u = el.suneRepoInput.value.trim();
if (!u.startsWith("gh://")) return;
const mode = confirm("Sync Sunes:\nOK = Upload (Push)\nCancel = Download (Pull)"), info = parseGhUrl(u);
try {
if (mode) {
const data = {
version: 1,
sunes: SUNE.list,
activeId: SUNE.id,
storage: {}
};
SUNE.list.forEach((s) => {
const p = `sune_${s.id}_`;
Object.keys(localStorage).forEach((k) => {
if (k.startsWith(p)) data.storage[k] = localStorage.getItem(k);
});
});
const x = await ghApi(`${info.apiPath}/sunes.json?ref=${info.branch}`);
await ghApi(`${info.apiPath}/sunes.json`, "PUT", {
message: "Sync Sunes",
content: utob(JSON.stringify(data, null, 2)),
branch: info.branch,
sha: x?.sha
});
alert("Sunes pushed.");
} else {
const text = await ghGetFileContent(info, "sunes.json");
if (!text) throw new Error("sunes.json not found");
const data = JSON.parse(text);
if (data.sunes) {
sunes = data.sunes.map(makeSune);
SUNE.save();
if (data.activeId) SUNE.setActive(data.activeId);
}
if (data.storage) Object.entries(data.storage).forEach(([k, v]) => localStorage.setItem(k, v));
renderSidebar();
await reflectActiveSune();
alert("Sunes pulled.");
}
} catch (e) {
alert("Sync failed: " + e.message);
}
});
init(); init();
var accountTabs = { var accountTabs = {
General: ["accountTabGeneral", "accountPanelGeneral"], General: ["accountTabGeneral", "accountPanelGeneral"],
@@ -2233,6 +2285,7 @@ function openAccountSettings() {
el.set_api_key_claude.value = USER.apiKeyClaude || ""; el.set_api_key_claude.value = USER.apiKeyClaude || "";
el.set_api_key_cf.value = USER.apiKeyCloudflare || ""; el.set_api_key_cf.value = USER.apiKeyCloudflare || "";
el.set_api_key_custom1.value = USER.customKey1 || ""; el.set_api_key_custom1.value = USER.customKey1 || "";
el.set_api_key_custom1.value = USER.customKey1 || "";
el.set_master_prompt.value = USER.masterPrompt || ""; el.set_master_prompt.value = USER.masterPrompt || "";
el.set_title_model.value = USER.titleModel; el.set_title_model.value = USER.titleModel;
el.set_gh_token.value = USER.githubToken || ""; el.set_gh_token.value = USER.githubToken || "";

21
dist/index.html vendored
View File

@@ -7,13 +7,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
<script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/tiny-ripple@0.2.0"></script> <script src="https://cdn.jsdelivr.net/npm/tiny-ripple@0.2.0"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5.8.1/github-markdown-light.min.css"/> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5.9.0/github-markdown-light.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.11.1/build/styles/github.min.css"/> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.12.0/build/styles/github.min.css"/>
<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-B9_XUvqP.js"></script> <script type="module" crossorigin src="/assets/index-CFtWZ3ac.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DUC1RW1F.css"> <link rel="stylesheet" crossorigin href="/assets/index-DUC1RW1F.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')">
@@ -44,7 +44,13 @@
</div> </div>
<div id="sidebarOverlayLeft" class="fixed inset-0 z-40 bg-black/20 hidden" @click="document.getElementById('sidebarLeft').classList.add('-translate-x-full');$el.classList.add('hidden');document.getElementById('sidebarRight').classList.add('translate-x-full');document.getElementById('sidebarOverlayRight').classList.add('hidden');hideThreadPopover();hideSunePopover()"></div> <div id="sidebarOverlayLeft" class="fixed inset-0 z-40 bg-black/20 hidden" @click="document.getElementById('sidebarLeft').classList.add('-translate-x-full');$el.classList.add('hidden');document.getElementById('sidebarRight').classList.add('translate-x-full');document.getElementById('sidebarOverlayRight').classList.add('hidden');hideThreadPopover();hideSunePopover()"></div>
<aside id="sidebarLeft" class="fixed inset-y-0 left-0 z-50 w-72 max-w-[85vw] bg-white border-r border-gray-200 shadow-xl transform -translate-x-full transition-transform duration-200 ease-out flex flex-col"> <aside id="sidebarLeft" class="fixed inset-y-0 left-0 z-50 w-72 max-w-[85vw] bg-white border-r border-gray-200 shadow-xl transform -translate-x-full transition-transform duration-200 ease-out flex flex-col">
<div class="p-3 border-b flex items-center gap-2"><button id="newSuneBtn" class="px-3 py-2 rounded-xl bg-black text-white text-sm hover:bg-black/90">New sune</button><span class="text-xs text-gray-500">Click name to equip</span></div> <div class="p-2 border-b flex flex-col gap-2">
<input id="suneRepoInput" type="text" placeholder="gh://owner/sunes" class="w-full h-9 rounded-lg border-0 bg-gray-100 px-3 text-xs font-mono focus:ring-2 focus:ring-black focus:bg-white"/>
<div class="flex items-center justify-between gap-2">
<button id="newSuneBtn" class="px-3 py-1.5 rounded-lg bg-black text-white text-[10px] font-bold uppercase tracking-wider hover:bg-black/90 transition">New Sune</button>
<button id="suneSyncBtn" class="px-3 py-1.5 rounded-lg bg-gray-100 text-gray-900 text-[10px] font-bold uppercase tracking-wider hover:bg-gray-200 transition flex items-center gap-1"><i data-lucide="refresh-cw" class="h-3 w-3"></i><span>Sync</span></button>
</div>
</div>
<div id="suneList" class="flex-1 overflow-y-auto divide-y"></div> <div id="suneList" class="flex-1 overflow-y-auto divide-y"></div>
<div class="p-3 border-t relative flex items-center gap-2"> <div class="p-3 border-t relative flex items-center gap-2">
<button id="userMenuBtn" class="flex-1 flex items-center justify-between px-3 py-2 rounded-xl bg-gray-100 hover:bg-gray-200 active:scale-[.99] transition" @click.stop="document.getElementById('userMenu').classList.toggle('hidden')"><span class="flex items-center gap-2"><span id="userMenuAvatar" class="h-6 w-6 rounded-full bg-gray-900 text-white flex items-center justify-center overflow-hidden shrink-0">👤</span><span class="text-sm">User</span></span><i data-lucide="chevron-down" class="h-4 w-4"></i></button> <button id="userMenuBtn" class="flex-1 flex items-center justify-between px-3 py-2 rounded-xl bg-gray-100 hover:bg-gray-200 active:scale-[.99] transition" @click.stop="document.getElementById('userMenu').classList.toggle('hidden')"><span class="flex items-center gap-2"><span id="userMenuAvatar" class="h-6 w-6 rounded-full bg-gray-900 text-white flex items-center justify-center overflow-hidden shrink-0">👤</span><span class="text-sm">User</span></span><i data-lucide="chevron-down" class="h-4 w-4"></i></button>
@@ -189,11 +195,8 @@
<input id="importAccountSettingsInput" type="file" class="hidden" accept="application/json,.json"> <input id="importAccountSettingsInput" type="file" class="hidden" accept="application/json,.json">
<script src="https://unpkg.com/lucide@latest"></script> <script src="https://unpkg.com/lucide@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/markdown-it@14.1.1/dist/markdown-it.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/markdown-it@15.0.1/dist/browser/markdown-it.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.11.1/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.12.0/build/highlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/localforage@1.10.0/dist/localforage.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/localforage@1.10.0/dist/localforage.min.js"></script>
</body> </body>
</html> </html>

2
dist/sw.js vendored
View File

@@ -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} didnt 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-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"ffc0102df9ec879074587fd90a2b13b0"},{url:"assets/index-DUC1RW1F.css",revision:null},{url:"assets/index-B9_XUvqP.js",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} didnt register its module`);return e}));self.define=(n,t)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const c=e=>i(e,r),l={module:{uri:r},exports:o,require:c};s[r]=Promise.all(n.map(e=>l[e]||c(e))).then(e=>(t(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"6cf89f14b8b1b835c1ce78df06770d25"},{url:"assets/index-DUC1RW1F.css",revision:null},{url:"assets/index-CFtWZ3ac.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});

View File

@@ -12,12 +12,9 @@
<load src="/src/parts/sidebars.html" /> <load src="/src/parts/sidebars.html" />
<load src="/src/parts/modals.html" /> <load src="/src/parts/modals.html" />
<script src="https://unpkg.com/lucide@latest"></script> <script src="https://unpkg.com/lucide@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/markdown-it@14.1.1/dist/markdown-it.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/markdown-it@15.0.1/dist/browser/markdown-it.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.11.1/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.12.0/build/highlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/localforage@1.10.0/dist/localforage.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/localforage@1.10.0/dist/localforage.min.js"></script>
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
</body> </body>
</html> </html>

View File

@@ -2,6 +2,7 @@ import mathjax3 from 'https://esm.sh/markdown-it-mathjax3';
import { copyToClipboard } from './utils.js'; import { copyToClipboard } from './utils.js';
export const md = window.md = window.markdownit({ html: false, linkify: true, typographer: true, breaks: true }).use(mathjax3); export const md = window.md = window.markdownit({ html: false, linkify: true, typographer: true, breaks: true }).use(mathjax3);
md.linkify.set({ fuzzyLink: true });
export function enhanceCodeBlocks(root, doHL = true) { export function enhanceCodeBlocks(root, doHL = true) {
window.$(root).find('pre>code').each((i, code) => { window.$(root).find('pre>code').each((i, code) => {

View File

@@ -4,8 +4,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
<script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/tiny-ripple@0.2.0"></script> <script src="https://cdn.jsdelivr.net/npm/tiny-ripple@0.2.0"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5.8.1/github-markdown-light.min.css"/> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5.9.0/github-markdown-light.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.11.1/build/styles/github.min.css"/> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.12.0/build/styles/github.min.css"/>
<link rel="stylesheet" href="/src/style.css"/> <link rel="stylesheet" href="/src/style.css"/>
<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>