@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/hooks/useLogout.d.ts +1 -0
- package/dist/index.es.js +3778 -3746
- package/dist/index.es2.js +61 -39
- package/dist/index.js +68 -68
- package/dist/index2.js +6 -3
- package/dist/preMountSplash.iife.js +6 -3
- package/package.json +1 -1
package/dist/index2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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}({});
|