@dreamsengine/dreams-ad-engine 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/dist/dreams-ad-engine.js +1361 -436
- package/package.json +1 -1
- package/types/features/adblock/adblock.service.d.ts +45 -0
- package/types/features/adblock/adblock.types.d.ts +14 -0
- package/types/features/adblock/index.d.ts +2 -0
- package/types/features/config/config.types.d.ts +3 -1
- package/types/features/dreamsAdEngine/components/ad.component.d.ts +17 -0
- package/types/features/dreamsAdEngine/index.d.ts +1 -1
- package/types/features/dreamsAdEngine/types/interfaces.d.ts +5 -1
- package/types/features/index.d.ts +6 -0
- package/types/features/logging/index.d.ts +2 -0
- package/types/features/logging/logger.d.ts +56 -0
- package/types/features/refresh/index.d.ts +2 -0
- package/types/features/refresh/refresh.service.d.ts +46 -0
- package/types/features/refresh/refresh.types.d.ts +18 -0
- package/types/features/skeleton/index.d.ts +1 -0
- package/types/features/skeleton/skeleton.component.d.ts +20 -0
- package/types/features/sticky/index.d.ts +2 -0
- package/types/features/sticky/sticky.service.d.ts +38 -0
- package/types/features/sticky/sticky.types.d.ts +23 -0
- package/types/features/viewability/index.d.ts +2 -0
- package/types/features/viewability/viewability.service.d.ts +38 -0
- package/types/features/viewability/viewability.types.d.ts +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,70 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.3.0] - 2026-02-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Viewability Service (`ViewabilityService`)**: IAB-compliant viewability tracking
|
|
12
|
+
- Tracks 50% visibility for 2+ seconds (configurable)
|
|
13
|
+
- Uses IntersectionObserver for efficient tracking
|
|
14
|
+
- Emits `viewability:viewable`, `viewability:hidden`, `viewability:impression` events
|
|
15
|
+
- Methods: `track()`, `untrack()`, `getMetrics()`, `getAllMetrics()`, `configure()`
|
|
16
|
+
|
|
17
|
+
- **Skeleton Component (`DreamsAdSkeleton`)**: Loading placeholder with shimmer animation
|
|
18
|
+
- Responsive sizing based on slot type and viewport
|
|
19
|
+
- Helper function `getSkeletonDimensions()` for dynamic sizing
|
|
20
|
+
- Automatic show/hide based on ad slot render events
|
|
21
|
+
|
|
22
|
+
- **Ad Block Detector (`AdBlockDetector`)**: Three-method detection service
|
|
23
|
+
- Tests googletag availability, bait element injection, and fetch requests
|
|
24
|
+
- Returns confidence level and detection methods
|
|
25
|
+
- Configurable via `configure()` method
|
|
26
|
+
|
|
27
|
+
- **Refresh Manager (`RefreshManager`)**: Safe auto-refresh with safeguards
|
|
28
|
+
- Enforces 30-second minimum interval
|
|
29
|
+
- Checks page visibility before refresh
|
|
30
|
+
- Configurable slots and intervals
|
|
31
|
+
- Emits `adrefresh:before` and `adrefresh:after` events
|
|
32
|
+
|
|
33
|
+
- **Sticky Manager (`StickyManager`)**: Smart sticky ads
|
|
34
|
+
- Configurable positions, offsets, and transitions
|
|
35
|
+
- Dynamic header height detection
|
|
36
|
+
- Tracks sticky time metrics
|
|
37
|
+
- Emits `sticky:start` and `sticky:end` events
|
|
38
|
+
|
|
39
|
+
- **Logger (`Logger`)**: Production-aware logging utility
|
|
40
|
+
- Respects `window.DREAMS_AD_DEBUG` flag
|
|
41
|
+
- Auto-detects production environment (localhost detection)
|
|
42
|
+
- Configurable log levels and prefix
|
|
43
|
+
|
|
44
|
+
- **New component properties**:
|
|
45
|
+
- `trackViewability`: Enable IAB-compliant viewability tracking (default: false)
|
|
46
|
+
- `showSkeleton`: Show loading skeleton while ad loads (default: false)
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- **Promise resolution bug in DreamsTargetingService**: Added try-finally pattern to properly clear pending promise
|
|
51
|
+
- **Memory leaks**: Added `disconnectedCallback()` with proper cleanup for event listeners and observers
|
|
52
|
+
- **SPA navigation handling**: Added popstate, hashchange, and History API interception for proper slot cleanup
|
|
53
|
+
- **FirstImpression compatibility**: Check `pubadsReady` before calling `enableServices()` to avoid conflicts
|
|
54
|
+
- **APS race condition**: Added timeout fallback if APS bid never resolves
|
|
55
|
+
- **JSON parsing errors**: Added try-catch around JSON.parse for mapping, sizing, and targeting
|
|
56
|
+
- **Display logic**: Fixed dual-if to if/else to prevent conflicting display states
|
|
57
|
+
- **Lazy load scope**: Added global flag to prevent multiple lazy load configurations
|
|
58
|
+
- **Config re-initialization**: Added `force` option and warning for duplicate initialization
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
- Improved TypeScript interfaces with `pubadsReady` and `removeEventListener` on GPT types
|
|
63
|
+
- All new features are opt-in with disabled defaults for backward compatibility
|
|
64
|
+
|
|
65
|
+
## [0.2.1] - 2025-01-10
|
|
66
|
+
|
|
67
|
+
### Fixed
|
|
68
|
+
|
|
69
|
+
- Build configuration to include dist folder in repository
|
|
70
|
+
|
|
7
71
|
## [0.2.0] - 2025-01-09
|
|
8
72
|
|
|
9
73
|
### Added
|