@@ -337,19 +337,16 @@ export function log(message, args) {
337
337
const HOST_ID = "blazorise-license-banner-host" ;
338
338
const GLOBAL = "__blazoriseBannerState__" ;
339
339
340
- // Global state (lives until full page refresh)
341
340
const st = ( window [ GLOBAL ] ||= {
342
341
dismissed : false ,
343
342
bodyObserver : null ,
344
343
attrObserver : null
345
344
} ) ;
346
345
347
- // If user already dismissed (in this page lifetime), don't show again
348
346
if ( st . dismissed ) {
349
347
return ;
350
348
}
351
349
352
- // Prepare message for HTML (strip %c and escape)
353
350
let cleanMessage = typeof message === "string" ? message . replace ( / % c / g, "" ) : String ( message ) ;
354
351
cleanMessage = cleanMessage
355
352
. replace ( / & / g, "&" )
@@ -358,20 +355,17 @@ export function log(message, args) {
358
355
. replace ( / " / g, """ )
359
356
. replace ( / ' / g, "'" ) ;
360
357
361
- // If banner exists, just update the message
362
358
let host = document . getElementById ( HOST_ID ) ;
363
359
if ( host && host . shadowRoot ) {
364
360
const msgEl = host . shadowRoot . querySelector ( ".msg" ) ;
365
361
if ( msgEl ) msgEl . innerHTML = cleanMessage ;
366
362
return ;
367
363
}
368
364
369
- // Create host + Shadow DOM (isolates styles)
370
365
host = document . createElement ( "div" ) ;
371
366
host . id = HOST_ID ;
372
367
const shadow = host . attachShadow ( { mode : "open" } ) ;
373
368
374
- // Styles: Blazorise purple, subtle sizing
375
369
const style = document . createElement ( "style" ) ;
376
370
style . textContent = `
377
371
:host { all: initial !important; }
@@ -382,7 +376,7 @@ export function log(message, args) {
382
376
bottom: 0 !important;
383
377
z-index: 2147483647 !important;
384
378
padding: 10px 14px !important;
385
- background: #6C63FF !important; /* Blazorise purple */
379
+ background: #6C63FF !important;
386
380
color: #FFFFFF !important;
387
381
font: 500 14px/1.4 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif !important;
388
382
box-shadow: 0 -4px 12px rgba(0,0,0,0.2) !important;
@@ -409,7 +403,6 @@ export function log(message, args) {
409
403
410
404
shadow . appendChild ( style ) ;
411
405
412
- // Markup
413
406
const wrapperElement = document . createElement ( "div" ) ;
414
407
wrapperElement . className = "wrapper" ;
415
408
@@ -422,7 +415,6 @@ export function log(message, args) {
422
415
button . type = "button" ;
423
416
button . textContent = "Dismiss" ;
424
417
button . addEventListener ( "click" , ( ) => {
425
- // Mark dismissed for current page lifetime and stop observers
426
418
st . dismissed = true ;
427
419
if ( st . bodyObserver ) try { st . bodyObserver . disconnect ( ) ; } catch { }
428
420
if ( st . attrObserver ) try { st . attrObserver . disconnect ( ) ; } catch { }
@@ -434,7 +426,6 @@ export function log(message, args) {
434
426
shadow . appendChild ( wrapperElement ) ;
435
427
document . body . appendChild ( host ) ;
436
428
437
- // Re-add if removed from body
438
429
if ( ! st . bodyObserver ) {
439
430
st . bodyObserver = new MutationObserver ( ( ) => {
440
431
if ( st . dismissed ) return ;
@@ -446,7 +437,6 @@ export function log(message, args) {
446
437
st . bodyObserver . observe ( document . body , { childList : true } ) ;
447
438
}
448
439
449
- // Undo display:none / hidden
450
440
if ( ! st . attrObserver ) {
451
441
st . attrObserver = new MutationObserver ( ( ) => {
452
442
if ( st . dismissed ) return ;
0 commit comments