Skip to content

Conversation

@prosdev
Copy link
Contributor

@prosdev prosdev commented Dec 25, 2025

Implements Issue #7: Banner Plugin

Changes

  • Add bannerPlugin for rendering banner experiences
  • Creates fixed position banner at top or bottom of page
  • Supports dismissable close button with smooth interactions
  • Supports configurable position (top/bottom), dismissable, and zIndex
  • Auto-shows banners on experiences:evaluated event
  • Emits experiences:shown and experiences:dismissed events
  • Cleans up properly on sdk:destroy event
  • Full width responsive banner with flexbox layout
  • Inline styles for zero CSS dependencies

Testing

  • 24 comprehensive tests covering all functionality
  • Tests for banner creation and styling
  • Tests for dismissal behavior
  • Tests for event emission
  • Tests for lifecycle management
  • All tests passing with jsdom environment

Configuration

banner: {
  position: 'top' | 'bottom',  // Default: 'top'
  dismissable: boolean,         // Default: true
  zIndex: number                // Default: 10000
}

API

  • banner.show(experience) - Show a banner
  • banner.remove() - Remove active banner
  • banner.isShowing() - Check if banner is active

Closes #7

- Add bannerPlugin for rendering banner experiences
- Creates fixed position banner at top or bottom
- Supports dismissable close button
- Auto-shows on experiences:evaluated event
- Emits experiences:shown and experiences:dismissed events
- Cleans up on sdk:destroy
- Comprehensive test coverage (24 tests)
- Add jsdom for DOM testing support

Closes #7
@prosdev prosdev merged commit 720b38e into main Dec 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase 0] Task 3.3: Build Banner Plugin

2 participants