@crystaltech/hsms-shared-ui 0.6.7-alpha-0 → 0.6.7-alpha-0.0.1

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.
package/dist/index2.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function y(t,e){try{let a=t.replace("#","");a.length===3&&(a=a.split("").map(s=>s+s).join(""));const r=s=>Math.min(255,Math.max(0,s)),n=r(parseInt(a.slice(0,2),16)+e),i=r(parseInt(a.slice(2,4),16)+e),p=r(parseInt(a.slice(4,6),16)+e),o=s=>{const d=s.toString(16);return(d.length===1?"0":"")+d};return"#"+o(n)+o(i)+o(p)}catch{return t}}function f(){try{const t=localStorage.getItem("theme"),e=t?JSON.parse(t):null,a=e&&e.mode||"light",r=e&&e.themeColor||"#2c5282",n=y(r,24),i=a==="light"?"#ffffff":"#121212",p=a==="light"?"#0f172a":"#e5e7eb",o=document.documentElement;o.style.setProperty("--app-bg",i),o.style.setProperty("--app-fg",p),o.style.setProperty("--app-primary",r),o.style.setProperty("--app-primary-2",n)}catch{const e=document.documentElement;e.style.setProperty("--app-bg","#ffffff"),e.style.setProperty("--app-fg","#0f172a"),e.style.setProperty("--app-primary","#2c5282"),e.style.setProperty("--app-primary-2","#3b82f6")}}function b(){try{const t=localStorage.getItem("organization_name")||"",e=localStorage.getItem("organization_logo_full_url")||"";return{orgName:t,orgLogo:e}}catch{return{orgName:"",orgLogo:""}}}function v(){if(document.getElementById("hsms-pre-splash-style"))return;const t=document.createElement("style");t.id="hsms-pre-splash-style",t.textContent=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function E(t,e){try{let a=t.replace("#","");a.length===3&&(a=a.split("").map(i=>i+i).join(""));const r=i=>Math.min(255,Math.max(0,i)),n=r(parseInt(a.slice(0,2),16)+e),o=r(parseInt(a.slice(2,4),16)+e),d=r(parseInt(a.slice(4,6),16)+e),s=i=>{const m=i.toString(16);return(m.length===1?"0":"")+m};return"#"+s(n)+s(o)+s(d)}catch{return t}}function x(){try{const t=localStorage.getItem("theme"),e=t?JSON.parse(t):null,a=e&&e.mode||"light",r=e&&e.themeColor||"#2c5282",n=E(r,24),o=a==="light"?"#ffffff":"#121212",d=a==="light"?"#0f172a":"#e5e7eb",s=document.documentElement;s.style.setProperty("--app-bg",o),s.style.setProperty("--app-fg",d),s.style.setProperty("--app-primary",r),s.style.setProperty("--app-primary-2",n)}catch{const e=document.documentElement;e.style.setProperty("--app-bg","#ffffff"),e.style.setProperty("--app-fg","#0f172a"),e.style.setProperty("--app-primary","#2c5282"),e.style.setProperty("--app-primary-2","#3b82f6")}}function u(){try{const t=localStorage.getItem("organization_name")||"",e=localStorage.getItem("organization_logo_full_url")||"";return{orgName:t,orgLogo:e}}catch{return{orgName:"",orgLogo:""}}}function L(){if(document.getElementById("hsms-pre-splash-style"))return;const t=document.createElement("style");t.id="hsms-pre-splash-style",t.textContent=`
2
2
  html, body { height: 100%; }
3
3
  body { margin: 0; background: var(--app-bg); color: var(--app-fg); }
4
4
  .app-splash {
@@ -38,11 +38,14 @@
38
38
  animation: hsms-spin 1s linear infinite;
39
39
  }
40
40
  @keyframes hsms-spin { to { transform: rotate(360deg); } }
41
- `,document.head.appendChild(t)}function E(t){if(t!=null&&t.rootId){const e=document.getElementById(t.rootId);if(e)return e}return document.getElementById("app")||document.getElementById("root")||document.body}function l(t){try{const e=document.getElementById("hsms-pre-splash");if(!e)return;const a=t||e.parentElement||document.body;if(a&&Array.from(a.children).some(n=>n!==e)||document.readyState==="complete")try{e.classList.add("app-splash-hide");const n=()=>{e.removeEventListener("transitionend",n),e&&e.parentElement&&e.remove();try{document.documentElement.classList.remove("app-loading"),document.documentElement.classList.add("app-ready"),window.__APP_READY__=!0,window.dispatchEvent(new Event("app-ready"))}catch{}};e.addEventListener("transitionend",n),setTimeout(n,340)}catch{e.remove()}}catch{}}function c(t){try{if(document.getElementById("hsms-pre-splash"))return;try{document.documentElement.classList.add("app-loading"),document.documentElement.classList.remove("app-ready"),window.__APP_READY__=!1}catch{}f(),v();const{orgName:e,orgLogo:a}=b(),r=E(t),n=document.createElement("div");n.id="hsms-pre-splash",n.className="app-splash",n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.innerHTML=`
41
+ `,document.head.appendChild(t)}function S(t){if(t!=null&&t.rootId){const e=document.getElementById(t.rootId);if(e)return e}return document.getElementById("app")||document.getElementById("root")||document.body}function l(t){try{const e=document.getElementById("hsms-pre-splash");if(!e)return;const a=t||e.parentElement||document.body;if(a&&Array.from(a.children).some(n=>n!==e)||document.readyState==="complete")try{e.classList.add("app-splash-hide");const n=()=>{e.removeEventListener("transitionend",n),e&&e.parentElement&&e.remove();try{document.documentElement.classList.remove("app-loading"),document.documentElement.classList.add("app-ready"),window.__APP_READY__=!0,window.dispatchEvent(new Event("app-ready"))}catch{}};e.addEventListener("transitionend",n),setTimeout(n,340)}catch{e.remove()}}catch{}}function h(t){try{if(document.getElementById("hsms-pre-splash"))return;try{document.documentElement.classList.add("app-loading"),document.documentElement.classList.remove("app-ready"),window.__APP_READY__=!1}catch{}x(),L();const{orgName:e,orgLogo:a}=u(),r=S(t),n=document.createElement("div");n.id="hsms-pre-splash",n.className="app-splash",n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.innerHTML=`
42
42
  <div class="brand">
43
43
  <img id="hsms-splash-logo" src="/logo.png" alt="Organization Logo"
44
44
  style="height:40px;width:auto;border-radius:6px" />
45
45
  <div id="hsms-splash-name" class="splash-title">Loading HSMS UI…</div>
46
46
  </div>
47
47
  <div class="splash-spinner" aria-hidden="true"></div>
48
- `,r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n);const i=n.querySelector("#hsms-splash-logo"),p=n.querySelector("#hsms-splash-name");i&&a&&(i.src=a),p&&e&&(p.textContent=e);const o=new MutationObserver(()=>{l(r),document.getElementById("hsms-pre-splash")||o.disconnect()});o.observe(r,{childList:!0,subtree:!1});const s=()=>l(r);window.addEventListener("load",s,{once:!0});const d=()=>l(r);window.addEventListener("hsms-app-mounted",d);const u=()=>l(r);document.addEventListener("DOMContentLoaded",u,{once:!0});const g=()=>l(r);window.addEventListener("app-ready",g)}catch{}}function m(){l()}function h(){try{window.__APP_READY__=!0,window.dispatchEvent(new Event("app-ready"))}catch{}}try{c()}catch{}try{window.HSMSPreMountSplash={initPreMountSplash:c,hidePreMountSplash:m,markAppReady:h}}catch{}exports.hidePreMountSplash=m;exports.initPreMountSplash=c;exports.markAppReady=h;
48
+ `,r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n);const o=n.querySelector("#hsms-splash-logo"),d=n.querySelector("#hsms-splash-name");if(o&&a&&(o.src=a),d&&e&&(d.textContent=e),o){const c="/logo.png",p="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="40">
49
+ <rect width="100%" height="100%" rx="6" fill="rgba(255,255,255,0.18)"/>
50
+ <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" fill="white" font-family="sans-serif" font-size="12">HSMS</text>
51
+ </svg>`);o.addEventListener("error",()=>{try{const g=o.getAttribute("src")||"";g!==c?o.src=c:g!==p&&(o.src=p)}catch{}})}const s=()=>{try{const{orgName:c,orgLogo:p}=u();o&&p&&(o.src=p),d&&c&&(d.textContent=c)}catch{}};window.addEventListener("hsms-organization-updated",s);const i=new MutationObserver(()=>{l(r),document.getElementById("hsms-pre-splash")||i.disconnect()});i.observe(r,{childList:!0,subtree:!1});const m=()=>l(r);window.addEventListener("load",m,{once:!0});const v=()=>l(r);window.addEventListener("hsms-app-mounted",v);const b=()=>l(r);document.addEventListener("DOMContentLoaded",b,{once:!0});const w=()=>l(r);window.addEventListener("app-ready",w)}catch{}}function y(){l()}function f(){try{window.__APP_READY__=!0,window.dispatchEvent(new Event("app-ready"))}catch{}}try{h()}catch{}try{window.HSMSPreMountSplash={initPreMountSplash:h,hidePreMountSplash:y,markAppReady:f}}catch{}exports.hidePreMountSplash=y;exports.initPreMountSplash=h;exports.markAppReady=f;
@@ -1,4 +1,4 @@
1
- var HSMSPreMountSplash=function(d){"use strict";function g(t,e){try{let a=t.replace("#","");a.length===3&&(a=a.split("").map(s=>s+s).join(""));const r=s=>Math.min(255,Math.max(0,s)),n=r(parseInt(a.slice(0,2),16)+e),p=r(parseInt(a.slice(2,4),16)+e),l=r(parseInt(a.slice(4,6),16)+e),o=s=>{const c=s.toString(16);return(c.length===1?"0":"")+c};return"#"+o(n)+o(p)+o(l)}catch{return t}}function y(){try{const t=localStorage.getItem("theme"),e=t?JSON.parse(t):null,a=e&&e.mode||"light",r=e&&e.themeColor||"#2c5282",n=g(r,24),p=a==="light"?"#ffffff":"#121212",l=a==="light"?"#0f172a":"#e5e7eb",o=document.documentElement;o.style.setProperty("--app-bg",p),o.style.setProperty("--app-fg",l),o.style.setProperty("--app-primary",r),o.style.setProperty("--app-primary-2",n)}catch{const e=document.documentElement;e.style.setProperty("--app-bg","#ffffff"),e.style.setProperty("--app-fg","#0f172a"),e.style.setProperty("--app-primary","#2c5282"),e.style.setProperty("--app-primary-2","#3b82f6")}}function f(){try{const t=localStorage.getItem("organization_name")||"",e=localStorage.getItem("organization_logo_full_url")||"";return{orgName:t,orgLogo:e}}catch{return{orgName:"",orgLogo:""}}}function v(){if(document.getElementById("hsms-pre-splash-style"))return;const t=document.createElement("style");t.id="hsms-pre-splash-style",t.textContent=`
1
+ var HSMSPreMountSplash=function(c){"use strict";function b(t,e){try{let a=t.replace("#","");a.length===3&&(a=a.split("").map(i=>i+i).join(""));const r=i=>Math.min(255,Math.max(0,i)),n=r(parseInt(a.slice(0,2),16)+e),o=r(parseInt(a.slice(2,4),16)+e),d=r(parseInt(a.slice(4,6),16)+e),s=i=>{const h=i.toString(16);return(h.length===1?"0":"")+h};return"#"+s(n)+s(o)+s(d)}catch{return t}}function w(){try{const t=localStorage.getItem("theme"),e=t?JSON.parse(t):null,a=e&&e.mode||"light",r=e&&e.themeColor||"#2c5282",n=b(r,24),o=a==="light"?"#ffffff":"#121212",d=a==="light"?"#0f172a":"#e5e7eb",s=document.documentElement;s.style.setProperty("--app-bg",o),s.style.setProperty("--app-fg",d),s.style.setProperty("--app-primary",r),s.style.setProperty("--app-primary-2",n)}catch{const e=document.documentElement;e.style.setProperty("--app-bg","#ffffff"),e.style.setProperty("--app-fg","#0f172a"),e.style.setProperty("--app-primary","#2c5282"),e.style.setProperty("--app-primary-2","#3b82f6")}}function u(){try{const t=localStorage.getItem("organization_name")||"",e=localStorage.getItem("organization_logo_full_url")||"";return{orgName:t,orgLogo:e}}catch{return{orgName:"",orgLogo:""}}}function E(){if(document.getElementById("hsms-pre-splash-style"))return;const t=document.createElement("style");t.id="hsms-pre-splash-style",t.textContent=`
2
2
  html, body { height: 100%; }
3
3
  body { margin: 0; background: var(--app-bg); color: var(--app-fg); }
4
4
  .app-splash {
@@ -38,11 +38,14 @@ var HSMSPreMountSplash=function(d){"use strict";function g(t,e){try{let a=t.repl
38
38
  animation: hsms-spin 1s linear infinite;
39
39
  }
40
40
  @keyframes hsms-spin { to { transform: rotate(360deg); } }
41
- `,document.head.appendChild(t)}function b(t){if(t!=null&&t.rootId){const e=document.getElementById(t.rootId);if(e)return e}return document.getElementById("app")||document.getElementById("root")||document.body}function i(t){try{const e=document.getElementById("hsms-pre-splash");if(!e)return;const a=t||e.parentElement||document.body;if(a&&Array.from(a.children).some(n=>n!==e)||document.readyState==="complete")try{e.classList.add("app-splash-hide");const n=()=>{e.removeEventListener("transitionend",n),e&&e.parentElement&&e.remove();try{document.documentElement.classList.remove("app-loading"),document.documentElement.classList.add("app-ready"),window.__APP_READY__=!0,window.dispatchEvent(new Event("app-ready"))}catch{}};e.addEventListener("transitionend",n),setTimeout(n,340)}catch{e.remove()}}catch{}}function m(t){try{if(document.getElementById("hsms-pre-splash"))return;try{document.documentElement.classList.add("app-loading"),document.documentElement.classList.remove("app-ready"),window.__APP_READY__=!1}catch{}y(),v();const{orgName:e,orgLogo:a}=f(),r=b(t),n=document.createElement("div");n.id="hsms-pre-splash",n.className="app-splash",n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.innerHTML=`
41
+ `,document.head.appendChild(t)}function S(t){if(t!=null&&t.rootId){const e=document.getElementById(t.rootId);if(e)return e}return document.getElementById("app")||document.getElementById("root")||document.body}function l(t){try{const e=document.getElementById("hsms-pre-splash");if(!e)return;const a=t||e.parentElement||document.body;if(a&&Array.from(a.children).some(n=>n!==e)||document.readyState==="complete")try{e.classList.add("app-splash-hide");const n=()=>{e.removeEventListener("transitionend",n),e&&e.parentElement&&e.remove();try{document.documentElement.classList.remove("app-loading"),document.documentElement.classList.add("app-ready"),window.__APP_READY__=!0,window.dispatchEvent(new Event("app-ready"))}catch{}};e.addEventListener("transitionend",n),setTimeout(n,340)}catch{e.remove()}}catch{}}function g(t){try{if(document.getElementById("hsms-pre-splash"))return;try{document.documentElement.classList.add("app-loading"),document.documentElement.classList.remove("app-ready"),window.__APP_READY__=!1}catch{}w(),E();const{orgName:e,orgLogo:a}=u(),r=S(t),n=document.createElement("div");n.id="hsms-pre-splash",n.className="app-splash",n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.innerHTML=`
42
42
  <div class="brand">
43
43
  <img id="hsms-splash-logo" src="/logo.png" alt="Organization Logo"
44
44
  style="height:40px;width:auto;border-radius:6px" />
45
45
  <div id="hsms-splash-name" class="splash-title">Loading HSMS UI…</div>
46
46
  </div>
47
47
  <div class="splash-spinner" aria-hidden="true"></div>
48
- `,r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n);const p=n.querySelector("#hsms-splash-logo"),l=n.querySelector("#hsms-splash-name");p&&a&&(p.src=a),l&&e&&(l.textContent=e);const o=new MutationObserver(()=>{i(r),document.getElementById("hsms-pre-splash")||o.disconnect()});o.observe(r,{childList:!0,subtree:!1});const s=()=>i(r);window.addEventListener("load",s,{once:!0});const c=()=>i(r);window.addEventListener("hsms-app-mounted",c);const E=()=>i(r);document.addEventListener("DOMContentLoaded",E,{once:!0});const w=()=>i(r);window.addEventListener("app-ready",w)}catch{}}function h(){i()}function u(){try{window.__APP_READY__=!0,window.dispatchEvent(new Event("app-ready"))}catch{}}try{m()}catch{}try{window.HSMSPreMountSplash={initPreMountSplash:m,hidePreMountSplash:h,markAppReady:u}}catch{}return d.hidePreMountSplash=h,d.initPreMountSplash=m,d.markAppReady=u,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),d}({});
48
+ `,r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n);const o=n.querySelector("#hsms-splash-logo"),d=n.querySelector("#hsms-splash-name");if(o&&a&&(o.src=a),d&&e&&(d.textContent=e),o){const p="/logo.png",m="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="40">
49
+ <rect width="100%" height="100%" rx="6" fill="rgba(255,255,255,0.18)"/>
50
+ <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" fill="white" font-family="sans-serif" font-size="12">HSMS</text>
51
+ </svg>`);o.addEventListener("error",()=>{try{const v=o.getAttribute("src")||"";v!==p?o.src=p:v!==m&&(o.src=m)}catch{}})}const s=()=>{try{const{orgName:p,orgLogo:m}=u();o&&m&&(o.src=m),d&&p&&(d.textContent=p)}catch{}};window.addEventListener("hsms-organization-updated",s);const i=new MutationObserver(()=>{l(r),document.getElementById("hsms-pre-splash")||i.disconnect()});i.observe(r,{childList:!0,subtree:!1});const h=()=>l(r);window.addEventListener("load",h,{once:!0});const x=()=>l(r);window.addEventListener("hsms-app-mounted",x);const L=()=>l(r);document.addEventListener("DOMContentLoaded",L,{once:!0});const P=()=>l(r);window.addEventListener("app-ready",P)}catch{}}function y(){l()}function f(){try{window.__APP_READY__=!0,window.dispatchEvent(new Event("app-ready"))}catch{}}try{g()}catch{}try{window.HSMSPreMountSplash={initPreMountSplash:g,hidePreMountSplash:y,markAppReady:f}}catch{}return c.hidePreMountSplash=y,c.initPreMountSplash=g,c.markAppReady=f,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),c}({});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@crystaltech/hsms-shared-ui",
3
3
  "private": false,
4
- "version": "0.6.7-alpha-0",
4
+ "version": "0.6.7-alpha-0.0.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",