resolve issue with missing vite-plugin-node-polyfills

add LibreJS licenses to all demo JS
split browser build from node build
add copyright info to license files
update to use yarn v4.13.0
update to v0.9.2
This commit is contained in:
2026-03-07 20:47:14 -05:00
parent 475fcf6331
commit 1c06197be0
51 changed files with 259 additions and 56 deletions

View File

@@ -1,6 +1,10 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
document.addEventListener("DOMContentLoaded", () => {
// add default #overview route
if (!window.location.hash) {
window.location.hash = "overview";
}
});
// @license-end

View File

@@ -0,0 +1,7 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
const isGecko = !!navigator.userAgent.match(/gecko/i);
if (isGecko) document.body.classList.add("isGecko");
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
document.addEventListener("DOMContentLoaded", () => {
const currentHost = window.location.hostname;
@@ -10,3 +12,5 @@ document.addEventListener("DOMContentLoaded", () => {
}
});
});
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
export default function formatSource(source, panelId) {
source = (source ?? "").trim();
@@ -42,3 +44,5 @@ export default function formatSource(source, panelId) {
.getElementById(panelId)
.insertAdjacentHTML("beforeend", sourceHTML);
}
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
import { hashTwt } from "/dist-browser/twtxt-lib.js";
let wasHashTwtResultAppended = false;
@@ -61,3 +63,5 @@ formHash.addEventListener("submit", (e) => {
document.body.classList.add("isLoaded");
wasHashTwtResultAppended = true;
});
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
import formatSource from "./format-source.js";
formatSource(
@@ -38,3 +40,5 @@ formatSource(
`,
"tabHashTwt-panel",
);
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
import { loadAndParseTwtxtFile } from "/dist-browser/twtxt-lib.js";
const tabLoadAndParsePanel = document.getElementById("tabLoadAndParse-panel");
@@ -77,3 +79,5 @@ const loadAndParseClickHandler = (ev) => {
.getElementById(curr)
.addEventListener("click", loadAndParseClickHandler);
});
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
import formatSource from "./format-source.js";
formatSource(
@@ -23,3 +25,5 @@ formatSource(
`,
"tabLoadAndParse-panel",
);
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
import { loadAndParseTwtxtFile } from "/dist-browser/twtxt-lib.js";
// run in an IIFE (or event listener) to avoid issues with top-level await
@@ -34,3 +36,5 @@ import { loadAndParseTwtxtFile } from "/dist-browser/twtxt-lib.js";
console.error(err);
}
})();
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
import formatSource from "./format-source.js";
formatSource(
@@ -22,3 +24,5 @@ formatSource(
`,
"tabOverview-example",
);
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
import { parseTwtxt } from "/dist-browser/twtxt-lib.js";
const tabParsePanel = document.getElementById("tabParse-panel");
@@ -74,3 +76,5 @@ const parseClickHandler = (ev) => {
.addEventListener("click", parseClickHandler);
},
);
// @license-end

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
import formatSource from "./format-source.js";
formatSource(
@@ -25,3 +27,5 @@ formatSource(
`,
"tabParse-panel",
);
// @license-end

View File

@@ -365,24 +365,37 @@ body:not(:has(:target)) #tabOverview-link {
margin-top: -4.55rem;
}
.tab:target .tab-panel {
position: absolute;
z-index: 1;
}
body:not(:has(:target)) #tabOverview-panel {
display: block;
position: absolute;
z-index: 1;
}
.themeToggle-button {
bottom: auto;
position: absolute;
right: 1rem;
top: 1rem;
}
body:not(:has(:target)) #tabOverview-panel {
display: block;
position: absolute;
z-index: 1;
}
body.isGecko .tab-link {
margin-top: -4.65rem;
}
body.isGecko .tab-link:hover {
margin-top: -4.9rem;
}
body.isGecko .tab:target .tab-link,
body.isGecko .tab:target .tab-link:hover {
margin-top: -4.85rem;
}
}
/** State-Based Overrides */

View File

@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt
document.addEventListener("DOMContentLoaded", () => {
const toggle = document.createElement("button");
@@ -27,3 +29,5 @@ document.addEventListener("DOMContentLoaded", () => {
document.body.appendChild(toggle);
});
// @license-end