mirror of
https://github.com/sune-org/sune.git
synced 2026-04-07 07:52:13 +00:00
This build was committed by a bot.
This commit is contained in:
@@ -697,6 +697,53 @@ var deserializeThreadName = (n) => {
|
||||
};
|
||||
};
|
||||
//#endregion
|
||||
//#region src/sune-html.js
|
||||
var resolveSuneSrc = (src) => {
|
||||
if (!src) return null;
|
||||
if (src.startsWith("gh://")) {
|
||||
const parts = src.substring(5).split("/");
|
||||
if (parts.length < 3) return null;
|
||||
const [owner, repo, ...filePathParts] = parts;
|
||||
return `https://raw.githubusercontent.com/${owner}/${repo}/main/${filePathParts.join("/")}`;
|
||||
}
|
||||
return src;
|
||||
};
|
||||
var processSuneIncludes = async (html, depth = 0) => {
|
||||
if (depth > 5) return "<!-- Sune include depth limit reached -->";
|
||||
if (!html) return "";
|
||||
const c = document.createElement("div");
|
||||
c.innerHTML = html;
|
||||
for (const n of [...c.querySelectorAll("sune")]) if (n.hasAttribute("src")) {
|
||||
if (n.hasAttribute("private") && depth > 0) {
|
||||
n.remove();
|
||||
continue;
|
||||
}
|
||||
const s = n.getAttribute("src"), u = resolveSuneSrc(s);
|
||||
if (!u) {
|
||||
n.replaceWith(document.createComment(` Invalid src: ${esc(s)} `));
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
const r = await fetch(u);
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||
const d = await r.json(), o = Array.isArray(d) ? d[0] : d, h = [o?.settings?.extension_html || "", o?.settings?.html || ""].join("\n");
|
||||
n.replaceWith(document.createRange().createContextualFragment(await processSuneIncludes(h, depth + 1)));
|
||||
} catch (e) {
|
||||
n.replaceWith(document.createComment(` Fetch failed: ${esc(u)} `));
|
||||
}
|
||||
} else n.replaceWith(document.createRange().createContextualFragment(n.innerHTML));
|
||||
return c.innerHTML;
|
||||
};
|
||||
var renderSuneHTML = async () => {
|
||||
const SUNE = window.SUNE;
|
||||
const h = await processSuneIncludes([SUNE.extension_html, SUNE.html].map((x) => (x || "").trim()).join("\n"));
|
||||
const c = el.suneHtml;
|
||||
c.innerHTML = "";
|
||||
const t = h.trim();
|
||||
c.classList.toggle("hidden", !t);
|
||||
t && (c.appendChild(document.createRange().createContextualFragment(h)), window.Alpine?.initTree(c));
|
||||
};
|
||||
//#endregion
|
||||
//#region \0vite/preload-helper.js
|
||||
var scriptRel = "modulepreload";
|
||||
var assetsURL = function(dep) {
|
||||
@@ -1012,49 +1059,6 @@ var getModelShort = (m) => {
|
||||
const mm = m || SUNE.model || "";
|
||||
return mm.includes("/") ? mm.split("/").pop() : mm;
|
||||
};
|
||||
var resolveSuneSrc = (src) => {
|
||||
if (!src) return null;
|
||||
if (src.startsWith("gh://")) {
|
||||
const parts = src.substring(5).split("/");
|
||||
if (parts.length < 3) return null;
|
||||
const [owner, repo, ...filePathParts] = parts;
|
||||
return `https://raw.githubusercontent.com/${owner}/${repo}/main/${filePathParts.join("/")}`;
|
||||
}
|
||||
return src;
|
||||
};
|
||||
var processSuneIncludes = async (html, depth = 0) => {
|
||||
if (depth > 5) return "<!-- Sune include depth limit reached -->";
|
||||
if (!html) return "";
|
||||
const c = document.createElement("div");
|
||||
c.innerHTML = html;
|
||||
for (const n of [...c.querySelectorAll("sune")]) if (n.hasAttribute("src")) {
|
||||
if (n.hasAttribute("private") && depth > 0) {
|
||||
n.remove();
|
||||
continue;
|
||||
}
|
||||
const s = n.getAttribute("src"), u = resolveSuneSrc(s);
|
||||
if (!u) {
|
||||
n.replaceWith(document.createComment(` Invalid src: ${esc(s)} `));
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
const r = await fetch(u);
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||
const d = await r.json(), o = Array.isArray(d) ? d[0] : d, h = [o?.settings?.extension_html || "", o?.settings?.html || ""].join("\n");
|
||||
n.replaceWith(document.createRange().createContextualFragment(await processSuneIncludes(h, depth + 1)));
|
||||
} catch (e) {
|
||||
n.replaceWith(document.createComment(` Fetch failed: ${esc(u)} `));
|
||||
}
|
||||
} else n.replaceWith(document.createRange().createContextualFragment(n.innerHTML));
|
||||
return c.innerHTML;
|
||||
};
|
||||
var renderSuneHTML = async () => {
|
||||
const h = await processSuneIncludes([SUNE.extension_html, SUNE.html].map((x) => (x || "").trim()).join("\n")), c = el.suneHtml;
|
||||
c.innerHTML = "";
|
||||
const t = h.trim();
|
||||
c.classList.toggle("hidden", !t);
|
||||
t && (c.appendChild(document.createRange().createContextualFragment(h)), window.Alpine?.initTree(c));
|
||||
};
|
||||
var reflectActiveSune = async () => {
|
||||
const a = SUNE.active;
|
||||
el.suneBtnTop.title = `Settings — ${a.name}`;
|
||||
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -14,7 +14,7 @@
|
||||
<script defer src="https://c.planetrenox.com/tracker.js"></script>
|
||||
|
||||
|
||||
<script type="module" crossorigin src="/assets/index-6iOL7W2F.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-D--Vm2nX.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CLEI5Rwr.css">
|
||||
<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')">
|
||||
|
||||
2
dist/sw.js
vendored
2
dist/sw.js
vendored
@@ -1 +1 @@
|
||||
if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(i[t])return;let o={};const d=e=>s(e,t),l={module:{uri:t},exports:o,require:d};i[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:"ad949321931259a665ded77f3e344165"},{url:"assets/index-CLEI5Rwr.css",revision:null},{url:"assets/index-6iOL7W2F.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} 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 c=e=>i(e,t),d={module:{uri:t},exports:o,require:c};s[t]=Promise.all(n.map(e=>d[e]||c(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:"a0059044b315d59cd6d13e38ef20f73c"},{url:"assets/index-D--Vm2nX.js",revision:null},{url:"assets/index-CLEI5Rwr.css",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