solid-shim 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -284,5 +284,5 @@ const r=n(7526),i=n(251),a="function"==typeof Symbol&&"function"==typeof Symbol.
284
284
  </div>
285
285
  </div>
286
286
  </div>
287
- `:r.html``}}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return i[e].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}o.m=i,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,o.d(i,a),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,n)=>(o.f[n](e,t),t),[])),o.u=e=>e+".mashlib.min.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="Mashlib:",o.l=(e,t,i,a)=>{if(n[e])n[e].push(t);else{var s,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var p=c[u];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==r+i){s=p;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",r+i),s.src=e),n[e]=[t];var d=(t,r)=>{s.onerror=s.onload=null,clearTimeout(f);var i=n[e];if(delete n[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach(e=>e(r)),t)return t(r)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),l&&document.head.appendChild(s)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={792:0};o.f.j=(t,n)=>{var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise((n,i)=>r=e[t]=[n,i]);n.push(r[2]=i);var a=o.p+o.u(t),s=new Error;o.l(a,n=>{if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,r[1](s)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[a,s,l]=n,c=0;if(a.some(t=>0!==e[t])){for(r in s)o.o(s,r)&&(o.m[r]=s[r]);if(l)l(o)}for(t&&t(n);c<a.length;c++)i=a[c],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=this.webpackChunkMashlib=this.webpackChunkMashlib||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s={};return(()=>{"use strict";o.r(s),o.d(s,{$rdf:()=>e,UI:()=>r,authSession:()=>i.authSession,authn:()=>i.authn,panes:()=>n,parseJsonLdToStore:()=>f,renderView:()=>h,solidLogicSingleton:()=>i.solidLogicSingleton,store:()=>i.store,versionInfo:()=>a});var e=o(7364),t=o(7293),n=o(7291),r=o(3383),i=o(2404);const a={name:"solid-shim",version:"0.0.1",description:"Minimal Solid data browser with solid-oidc authentication",buildDate:(new Date).toISOString(),repository:"https://github.com/JavaScriptSolidServer/solid-shim"},l="#7C3AED",c="#2563EB";const u={dbLayout:"\n margin: 0;\n padding: 0;\n height: 100vh;\n display: flex;\n flex-direction: column;\n ".trim().replace(/\s+/g," "),dbLayoutHeader:`\n flex: 0 0 auto;\n background: linear-gradient(135deg, ${l}, ${c});\n color: white;\n padding: 12px 20px;\n `.trim().replace(/\s+/g," "),dbLayoutFooter:"\n flex: 0 0 auto;\n background: #f8fafc;\n border-top: 1px solid #e5e7eb;\n padding: 10px 20px;\n font-size: 12px;\n color: #6b7280;\n ".trim().replace(/\s+/g," "),dbLayoutContent:"\n flex: 1 1 auto;\n overflow: auto;\n padding: 20px;\n background: #fafafa;\n ".trim().replace(/\s+/g," ")},p=window,d="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function f(t,n,r){const i=n+(t["@id"]||"#thing");return function t(i,a){const o=e.sym(a);if(i["@type"]){const t=i["@type"].replace("schema:","http://schema.org/");r.add(o,e.sym(d),e.sym(t))}Object.entries(i).forEach(([i,s])=>{if(i.startsWith("@"))return;const l=e.sym(i.replace("schema:","http://schema.org/"));if(Array.isArray(s))s.forEach((s,c)=>{if("object"!=typeof s||s["@id"])if("object"==typeof s&&s["@id"]){const t=s["@id"].startsWith("http")?s["@id"]:n+s["@id"];r.add(o,l,e.sym(t))}else r.add(o,l,s);else{const n=`${a}_${i}_${c}`;r.add(o,l,e.sym(n)),t(s,n)}});else if("object"==typeof s&&s["@id"]){const t=s["@id"].startsWith("http")?s["@id"]:n+s["@id"];r.add(o,l,e.sym(t))}else if("object"==typeof s){const n=`${a}_${i}`;r.add(o,l,e.sym(n)),t(s,n)}else r.add(o,l,s)})}(t,i),e.sym(i)}async function h(t={}){const n=document.querySelector('script[type="application/ld+json"]');if(!n)return console.warn("[solid-shim] No JSON-LD found on page"),null;let r;try{r=JSON.parse(n.textContent||"")}catch(e){return console.error("[solid-shim] Invalid JSON-LD:",e),null}const a=window.location.href.split("#")[0],o=(t.subject||r["@id"],f(r,a,i.store)),s=t.subject?e.sym(a+t.subject):o;let l;if(r["@view"])try{console.log(`[solid-shim] Loading @view: ${r["@view"]}`);const e=await import(r["@view"]);l=e.default||e}catch(e){console.warn(`[solid-shim] Failed to load @view "${r["@view"]}":`,e)}if(!l&&t.fallbackPane&&(l=t.fallbackPane),!l)return console.warn("[solid-shim] No @view specified and no fallback pane provided"),{subject:s,store:i.store};let c=null;"string"==typeof t.target?c=document.querySelector(t.target):t.target&&(c=t.target),c||(c=document.createElement("div"),c.id="solid-shim-view",n.parentNode?.insertBefore(c,n.nextSibling));const u={dom:document,session:{store:i.store}};try{const e=l.render(s,u);c.appendChild(e)}catch(e){console.error("[solid-shim] Render error:",e),c.innerHTML=`<p style="color: #dc2626; padding: 1rem;">Error rendering: ${e.message}</p>`}return{subject:s,store:i.store}}if(function(){if("undefined"==typeof document)return;if(document.getElementById("jss-theme-styles"))return;const e=document.createElement("style");e.id="jss-theme-styles",e.textContent="\n/* ========================================\n JSS Theme - Soft & Minimal\n ======================================== */\n\n:root {\n --jss-primary: #7C3AED;\n --jss-primary-dark: #6D28D9;\n --jss-secondary: #2563EB;\n}\n\n/* System font stack */\nbody {\n font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;\n}\n\n/* Softer link colors */\na { color: var(--jss-primary-dark); }\n\n/* Selection */\n::selection { background: rgba(124, 58, 237, 0.15); }\n\n/* Focus states */\n:focus-visible {\n outline: 2px solid rgba(124, 58, 237, 0.4) !important;\n outline-offset: 2px !important;\n}\n\n/* Scrollbar */\n::-webkit-scrollbar { width: 8px; height: 8px; }\n::-webkit-scrollbar-track { background: transparent; }\n::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }\n::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }\n",document.head.appendChild(e)}(),p.$rdf=e,p.panes=n,p.UI=r,p.SolidLogic={authn:i.authn,authSession:i.authSession,store:i.store,solidLogicSingleton:i.solidLogicSingleton},p.mashlib={versionInfo:a},p.solidShim={renderView:h,parseJsonLdToStore:f},p.panes.runDataBrowser=function(e){document.getElementById("PageBody")?.setAttribute("style",u.dbLayout),document.getElementById("PageHeader")?.setAttribute("style",u.dbLayoutHeader),document.getElementById("PageFooter")?.setAttribute("style",u.dbLayoutFooter),document.getElementById("DummyUUID")?.setAttribute("style",u.dbLayoutContent);t.A.crossSiteProxyTemplate=window.origin+"/xss/?uri={uri}";try{const e=document.createElement("meta");e.setAttribute("name","monetization"),e.setAttribute("content",`$${window.location.host}`),document.head.appendChild(e)}catch(e){console.error("Failed to add web monetization tag to page header")}i.authn.checkUser().then(function(t){return n.initMainPage(i.solidLogicSingleton.store,e)})},window.onpopstate=function(t){p.document.outline?.GotoSubject?.(e.sym(window.document.location.href),!0,void 0,!0,void 0)},p.dump=function(e){console.log(e.slice(0,-1))},"undefined"!=typeof document){document.querySelectorAll('script[src*="solid-shim"], script[src*="mashlib"]').forEach(e=>{e.hasAttribute("data-auto-render")&&h()})}})(),s})());
287
+ `:r.html``}}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return i[e].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}o.m=i,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,o.d(i,a),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,n)=>(o.f[n](e,t),t),[])),o.u=e=>e+".mashlib.min.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="Mashlib:",o.l=(e,t,i,a)=>{if(n[e])n[e].push(t);else{var s,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var p=c[u];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==r+i){s=p;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",r+i),s.src=e),n[e]=[t];var d=(t,r)=>{s.onerror=s.onload=null,clearTimeout(f);var i=n[e];if(delete n[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach(e=>e(r)),t)return t(r)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),l&&document.head.appendChild(s)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={792:0};o.f.j=(t,n)=>{var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise((n,i)=>r=e[t]=[n,i]);n.push(r[2]=i);var a=o.p+o.u(t),s=new Error;o.l(a,n=>{if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,r[1](s)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[a,s,l]=n,c=0;if(a.some(t=>0!==e[t])){for(r in s)o.o(s,r)&&(o.m[r]=s[r]);if(l)l(o)}for(t&&t(n);c<a.length;c++)i=a[c],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=this.webpackChunkMashlib=this.webpackChunkMashlib||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s={};return(()=>{"use strict";o.r(s),o.d(s,{$rdf:()=>e,UI:()=>r,authSession:()=>i.authSession,authn:()=>i.authn,panes:()=>n,parseJsonLdToStore:()=>f,renderView:()=>h,solidLogicSingleton:()=>i.solidLogicSingleton,store:()=>i.store,versionInfo:()=>a});var e=o(7364),t=o(7293),n=o(7291),r=o(3383),i=o(2404);const a={name:"solid-shim",version:"0.0.1",description:"Minimal Solid data browser with solid-oidc authentication",buildDate:(new Date).toISOString(),repository:"https://github.com/JavaScriptSolidServer/solid-shim"},l="#7C3AED",c="#2563EB";const u={dbLayout:"\n margin: 0;\n padding: 0;\n height: 100vh;\n display: flex;\n flex-direction: column;\n ".trim().replace(/\s+/g," "),dbLayoutHeader:`\n flex: 0 0 auto;\n background: linear-gradient(135deg, ${l}, ${c});\n color: white;\n padding: 12px 20px;\n `.trim().replace(/\s+/g," "),dbLayoutFooter:"\n flex: 0 0 auto;\n background: #f8fafc;\n border-top: 1px solid #e5e7eb;\n padding: 10px 20px;\n font-size: 12px;\n color: #6b7280;\n ".trim().replace(/\s+/g," "),dbLayoutContent:"\n flex: 1 1 auto;\n overflow: auto;\n padding: 20px;\n background: #fafafa;\n ".trim().replace(/\s+/g," ")},p=window,d="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function f(t,n,r){const i=n+(t["@id"]||"#thing");return function t(i,a){const o=e.sym(a);if(i["@type"]){const t=i["@type"].replace("schema:","http://schema.org/");r.add(o,e.sym(d),e.sym(t))}Object.entries(i).forEach(([i,s])=>{if(i.startsWith("@"))return;const l=e.sym(i.replace("schema:","http://schema.org/"));if(Array.isArray(s))s.forEach((s,c)=>{if("object"!=typeof s||s["@id"])if("object"==typeof s&&s["@id"]){const t=s["@id"].startsWith("http")?s["@id"]:n+s["@id"];r.add(o,l,e.sym(t))}else r.add(o,l,s);else{const n=`${a}_${i}_${c}`;r.add(o,l,e.sym(n)),t(s,n)}});else if("object"==typeof s&&s["@id"]){const t=s["@id"].startsWith("http")?s["@id"]:n+s["@id"];r.add(o,l,e.sym(t))}else if("object"==typeof s){const n=`${a}_${i}`;r.add(o,l,e.sym(n)),t(s,n)}else r.add(o,l,s)})}(t,i),e.sym(i)}async function h(t={}){const n=document.querySelector('script[type="application/ld+json"]');if(!n)return console.warn("[solid-shim] No JSON-LD found on page"),null;let r;try{r=JSON.parse(n.textContent||"")}catch(e){return console.error("[solid-shim] Invalid JSON-LD:",e),null}const a=window.location.href.split("#")[0],o=(t.subject||r["@id"],f(r,a,i.store)),s=t.subject?e.sym(a+t.subject):o;let l;if(r["@view"])try{console.log(`[solid-shim] Loading @view: ${r["@view"]}`);const e=await import(r["@view"]);l=e.default||e}catch(e){console.warn(`[solid-shim] Failed to load @view "${r["@view"]}":`,e)}if(!l&&t.fallbackPane&&(l=t.fallbackPane),!l)return console.warn("[solid-shim] No @view specified and no fallback pane provided"),{subject:s,store:i.store};let c=null;"string"==typeof t.target?c=document.querySelector(t.target):t.target&&(c=t.target),c||(c=document.createElement("div"),c.id="solid-shim-view",n.parentNode?.insertBefore(c,n.nextSibling));const u={dom:document,session:{store:i.store}};try{const e=l.render(s,u);c.appendChild(e)}catch(e){console.error("[solid-shim] Render error:",e),c.innerHTML=`<p style="color: #dc2626; padding: 1rem;">Error rendering: ${e.message}</p>`}return{subject:s,store:i.store}}if(function(){if("undefined"==typeof document)return;if(document.getElementById("jss-theme-styles"))return;const e=document.createElement("style");e.id="jss-theme-styles",e.textContent="\n/* ========================================\n JSS Theme - Soft & Minimal\n ======================================== */\n\n:root {\n --jss-primary: #7C3AED;\n --jss-primary-dark: #6D28D9;\n --jss-secondary: #2563EB;\n}\n\n/* System font stack */\nbody {\n font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;\n}\n\n/* Softer link colors */\na { color: var(--jss-primary-dark); }\n\n/* Selection */\n::selection { background: rgba(124, 58, 237, 0.15); }\n\n/* Focus states */\n:focus-visible {\n outline: 2px solid rgba(124, 58, 237, 0.4) !important;\n outline-offset: 2px !important;\n}\n\n/* Scrollbar */\n::-webkit-scrollbar { width: 8px; height: 8px; }\n::-webkit-scrollbar-track { background: transparent; }\n::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }\n::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }\n",document.head.appendChild(e)}(),p.$rdf=e,p.panes=n,p.UI=r,p.SolidLogic={authn:i.authn,authSession:i.authSession,store:i.store,solidLogicSingleton:i.solidLogicSingleton},p.mashlib={versionInfo:a},p.solidShim={renderView:h,parseJsonLdToStore:f},p.panes.runDataBrowser=function(e){document.getElementById("PageBody")?.setAttribute("style",u.dbLayout),document.getElementById("PageHeader")?.setAttribute("style",u.dbLayoutHeader),document.getElementById("PageFooter")?.setAttribute("style",u.dbLayoutFooter),document.getElementById("DummyUUID")?.setAttribute("style",u.dbLayoutContent);t.A.crossSiteProxyTemplate=window.origin+"/xss/?uri={uri}";try{const e=document.createElement("meta");e.setAttribute("name","monetization"),e.setAttribute("content",`$${window.location.host}`),document.head.appendChild(e)}catch(e){console.error("Failed to add web monetization tag to page header")}i.authn.checkUser().then(function(t){return n.initMainPage(i.solidLogicSingleton.store,e)})},window.onpopstate=function(t){p.document.outline?.GotoSubject?.(e.sym(window.document.location.href),!0,void 0,!0,void 0)},p.dump=function(e){console.log(e.slice(0,-1))},"undefined"!=typeof document){const e=document.querySelector('script[type="application/ld+json"]');if(e)try{JSON.parse(e.textContent||"")["@view"]&&h()}catch(e){}}})(),s})());
288
288
  //# sourceMappingURL=mashlib.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-shim",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Minimal Solid data browser using solid-panes-jss with solid-oidc authentication",
5
5
  "type": "module",
6
6
  "main": "dist/solid-shim.js",
@@ -13,7 +13,9 @@
13
13
  }
14
14
  },
15
15
  "files": [
16
- "dist/",
16
+ "dist/*.js",
17
+ "dist/*.d.ts",
18
+ "dist/index.html",
17
19
  "README.md",
18
20
  "LICENSE"
19
21
  ],