primeng
Version:
PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,
40 lines (37 loc) • 1.8 kB
JavaScript
/**
* Inject a fixed-positioned banner into the bottom-right of the page when the
* PrimeNG license cannot be verified.
*
* The banner content is rendered inside a closed-mode shadow root so page-level
* CSS cannot reach into it. `all:initial` on the host element blocks inherited
* styles. The host carries no semantically obvious id, slowing down trivial
* hide-by-selector attempts.
*
* Idempotent — guarded by the host id, so multiple call sites (the providePrimeNG
* initializer resolving, BaseComponent detecting a failed verify) cannot produce
* more than one banner per page.
*
* SSR-safe — short-circuits when `document` is undefined.
*
* Note: client-side license enforcement is anti-honest-user signaling, not
* anti-piracy. The cryptographic signature (Ed25519) is what actually prevents
* forging valid tokens. This banner just makes the licensing problem visible
* to a legitimate customer whose key needs attention.
*/
function showInvalidLicenseBanner() {
if (typeof document === 'undefined')
return;
if (document.getElementById('p-license-host'))
return;
const host = document.createElement('div');
host.id = 'p-license-host';
host.style.cssText = 'all:initial;position:fixed;bottom:16px;right:16px;z-index:2147483647;pointer-events:none;';
const shadow = host.attachShadow({ mode: 'closed' });
shadow.innerHTML = '<div role="alert" style="padding:10px 14px;background:#991b1b;color:#fff;font:600 13px/1.2 system-ui,-apple-system,sans-serif;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.2);">' + 'Invalid PrimeUI License' + '</div>';
document.body.appendChild(host);
}
/**
* Generated bundle index. Do not edit.
*/
export { showInvalidLicenseBanner };
//# sourceMappingURL=primeng-license.mjs.map