diff --git a/data-browser.css b/data-browser.css index ecb4fc2..eff53cb 100644 --- a/data-browser.css +++ b/data-browser.css @@ -1,6 +1,4 @@ -/* jspod minimal data-browser styles. Auto-loaded by JSS as the .css - sibling of data-browser.js (see generateModuleDatabrowserHtml). */ -body{font:14px/1.6 system-ui,-apple-system,sans-serif;margin:2em;color:#222;background:#fafaf8} -#mashlib pre{padding:1em;background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.06);overflow:auto;white-space:pre-wrap;word-break:break-all} -a{color:#0366d6;text-decoration:none} -a:hover{text-decoration:underline} +/* Intentionally empty. Styles live inside data-browser.js so the + browser is a single file. JSS auto-fetches this sibling URL + (mashlib/index.js:307); shipping an empty 200 keeps the console + warning-free until JSS makes the .css fetch optional. */ diff --git a/data-browser.js b/data-browser.js index 522537d..70258cd 100644 --- a/data-browser.js +++ b/data-browser.js @@ -1,5 +1,9 @@ // jspod minimal data browser — the page is the data. JSS embeds the -// resource as JSON-LD in #dataisland; this module just makes it visible -// in #mashlib with clickable URIs. See data-browser.css for the styling. -const d=document.getElementById('dataisland'),m=document.getElementById('mashlib'); -m.innerHTML=`
${d.textContent.replace(/https?:\/\/[^"\s]+/g,'$&')}
` +// resource as JSON-LD in #dataisland; this single module: +// 1. Injects its own ') +const d=JSON.parse(document.getElementById('dataisland').textContent) +document.getElementById('mashlib').innerHTML='
'+JSON.stringify(d,null,2).replace(/https?:\/\/[^"\s]+/g,'$&')+'
' diff --git a/package.json b/package.json index 72c8470..da82dd2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jspod", - "version": "0.0.11", + "version": "0.0.12", "description": "JavaScript Solid Pod - Just works, batteries included", "type": "module", "main": "index.js",