@@ -41,7 +41,7 @@ const DEFAULT_THEME = 'default';
4141
4242export default class Bell {
4343 public _options : AppUserConfigNotifyButton ;
44- public _state : BellStateType = BellState . _Uninitialized ;
44+ public _state : BellStateValue = BellState . _Uninitialized ;
4545 public _ignoreSubscriptionState = false ;
4646 public _hovering = false ;
4747 public _initialized = false ;
@@ -188,7 +188,7 @@ export default class Bell {
188188 } )
189189 . then ( ( ) => {
190190 return this . _message . _display (
191- MesageType . _Message ,
191+ MessageType . _Message ,
192192 this . _options . text [ 'message.action.resubscribed' ] ,
193193 MESSAGE_TIMEOUT ,
194194 ) ;
@@ -224,7 +224,7 @@ export default class Bell {
224224 } )
225225 . then ( ( ) => {
226226 return this . _message . _display (
227- MesageType . _Message ,
227+ MessageType . _Message ,
228228 this . _options . text [ 'message.action.unsubscribed' ] ,
229229 MESSAGE_TIMEOUT ,
230230 ) ;
@@ -246,7 +246,7 @@ export default class Bell {
246246
247247 // If the message is a message and not a tip, don't show it (only show tips)
248248 // Messages will go away on their own
249- if ( this . _message . _contentType === MesageType . _Message ) {
249+ if ( this . _message . _contentType === MessageType . _Message ) {
250250 this . _hovering = false ;
251251 return ;
252252 }
@@ -256,14 +256,14 @@ export default class Bell {
256256 if ( this . _message . _queued . length > 0 ) {
257257 return this . _message . _dequeue ( ) . then ( ( msg : any ) => {
258258 this . _message . _content = msg ;
259- this . _message . _contentType = MesageType . _Queued ;
259+ this . _message . _contentType = MessageType . _Queued ;
260260 resolve ( ) ;
261261 } ) ;
262262 } else {
263263 this . _message . _content = decodeHtmlEntities (
264264 this . _message . _getTipForState ( ) ,
265265 ) ;
266- this . _message . _contentType = MesageType . _Tip ;
266+ this . _message . _contentType = MessageType . _Tip ;
267267 resolve ( ) ;
268268 }
269269 } )
@@ -280,7 +280,7 @@ export default class Bell {
280280
281281 OneSignal . _emitter . on ( BellEvent . _Hovered , ( ) => {
282282 // If a message is displayed (and not a tip), don't control it. Visitors have no control over messages
283- if ( this . _message . _contentType === MesageType . _Message ) {
283+ if ( this . _message . _contentType === MessageType . _Message ) {
284284 return ;
285285 }
286286
@@ -351,7 +351,10 @@ export default class Bell {
351351 }
352352 if ( state . to === BellState . _Subscribed ) {
353353 this . _launcher . _inactivate ( ) ;
354- } else if ( state . to === BellState . _Unsubscribed || state . to === BellState . _Blocked ) {
354+ } else if (
355+ state . to === BellState . _Unsubscribed ||
356+ state . to === BellState . _Blocked
357+ ) {
355358 this . _launcher . _activate ( ) ;
356359 }
357360 } ) ;
@@ -579,19 +582,19 @@ export default class Bell {
579582 const pulseRing = buttonElement ?. querySelector < HTMLElement > ( '.pulse-ring' ) ;
580583
581584 // Reset added styles first
582- const background = this . graphic ?. querySelector < HTMLElement > ( '.background' ) ;
585+ const background = this . _graphic ?. querySelector < HTMLElement > ( '.background' ) ;
583586 if ( background ) {
584587 background . style . cssText = '' ;
585588 }
586589 const foregroundElements =
587- this . graphic ?. querySelectorAll < HTMLElement > ( '.foreground' ) ?? [ ] ;
590+ this . _graphic ?. querySelectorAll < HTMLElement > ( '.foreground' ) ?? [ ] ;
588591 for ( let i = 0 ; i < foregroundElements . length ; i ++ ) {
589592 const element = foregroundElements [ i ] ;
590593 if ( element ) {
591594 element . style . cssText = '' ;
592595 }
593596 }
594- const stroke = this . graphic ?. querySelector < HTMLElement > ( '.stroke' ) ;
597+ const stroke = this . _graphic ?. querySelector < HTMLElement > ( '.stroke' ) ;
595598 if ( stroke ) {
596599 stroke . style . cssText = '' ;
597600 }
@@ -613,21 +616,21 @@ export default class Bell {
613616 const colors = this . _options . colors ;
614617 if ( colors [ 'circle.background' ] ) {
615618 const background =
616- this . graphic ?. querySelector < HTMLElement > ( '.background' ) ;
619+ this . _graphic ?. querySelector < HTMLElement > ( '.background' ) ;
617620 if ( background ) {
618621 background . style . cssText += `fill: ${ colors [ 'circle.background' ] } ` ;
619622 }
620623 }
621624 if ( colors [ 'circle.foreground' ] ) {
622625 const foregroundElements =
623- this . graphic ?. querySelectorAll < HTMLElement > ( '.foreground' ) ?? [ ] ;
626+ this . _graphic ?. querySelectorAll < HTMLElement > ( '.foreground' ) ?? [ ] ;
624627 for ( let i = 0 ; i < foregroundElements . length ; i ++ ) {
625628 const element = foregroundElements [ i ] ;
626629 if ( element ) {
627630 element . style . cssText += `fill: ${ colors [ 'circle.foreground' ] } ` ;
628631 }
629632 }
630- const stroke = this . graphic ?. querySelector < HTMLElement > ( '.stroke' ) ;
633+ const stroke = this . _graphic ?. querySelector < HTMLElement > ( '.stroke' ) ;
631634 if ( stroke ) {
632635 stroke . style . cssText += `stroke: ${ colors [ 'circle.foreground' ] } ` ;
633636 }
@@ -714,7 +717,7 @@ export default class Bell {
714717 * Updates the current state to the specified new state.
715718 * @param newState One of ['subscribed', 'unsubscribed'].
716719 */
717- _setState ( newState : BellStateType , silent = false ) {
720+ _setState ( newState : BellStateValue , silent = false ) {
718721 const lastState = this . _state ;
719722 this . _state = newState ;
720723 if ( lastState !== newState && ! silent ) {
@@ -733,7 +736,7 @@ export default class Bell {
733736 }
734737
735738 get _graphic ( ) {
736- return this . _button . _element ?. querySelector ( 'svg' ) ;
739+ return this . _buttonEl ? ._element ?. querySelector ( 'svg' ) ;
737740 }
738741
739742 get _launcher ( ) {
0 commit comments