UNPKG

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,

1 lines 2.44 kB
{"version":3,"file":"primeng-license.mjs","sources":["../../src/license/licensebanner.ts","../../src/license/primeng-license.ts"],"sourcesContent":["/**\n * Inject a fixed-positioned banner into the bottom-right of the page when the\n * PrimeNG license cannot be verified.\n *\n * The banner content is rendered inside a closed-mode shadow root so page-level\n * CSS cannot reach into it. `all:initial` on the host element blocks inherited\n * styles. The host carries no semantically obvious id, slowing down trivial\n * hide-by-selector attempts.\n *\n * Idempotent — guarded by the host id, so multiple call sites (the providePrimeNG\n * initializer resolving, BaseComponent detecting a failed verify) cannot produce\n * more than one banner per page.\n *\n * SSR-safe — short-circuits when `document` is undefined.\n *\n * Note: client-side license enforcement is anti-honest-user signaling, not\n * anti-piracy. The cryptographic signature (Ed25519) is what actually prevents\n * forging valid tokens. This banner just makes the licensing problem visible\n * to a legitimate customer whose key needs attention.\n */\nexport function showInvalidLicenseBanner(): void {\n if (typeof document === 'undefined') return;\n if (document.getElementById('p-license-host')) return;\n\n const host = document.createElement('div');\n\n host.id = 'p-license-host';\n host.style.cssText = 'all:initial;position:fixed;bottom:16px;right:16px;z-index:2147483647;pointer-events:none;';\n\n const shadow = host.attachShadow({ mode: 'closed' });\n\n 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>';\n\n document.body.appendChild(host);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;AAmBG;SACa,wBAAwB,GAAA;IACpC,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE;AACrC,IAAA,IAAI,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC;QAAE;IAE/C,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AAE1C,IAAA,IAAI,CAAC,EAAE,GAAG,gBAAgB;AAC1B,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,2FAA2F;AAEhH,IAAA,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAEpD,MAAM,CAAC,SAAS,GAAG,0LAA0L,GAAG,yBAAyB,GAAG,QAAQ;AAEpP,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;AACnC;;AClCA;;AAEG;;;;"}