smart-adsense 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +8 -5
  2. package/package.json +5 -1
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # smart-adsense
2
2
 
3
+ [![NPM Version](https://img.shields.io/npm/v/smart-adsense)](https://www.npmjs.com/package/smart-adsense)
4
+ [![License](https://img.shields.io/npm/l/smart-adsense)](https://github.com/dshovchko/smart-services/blob/main/packages/smart-adsense/LICENSE)
5
+
3
6
  A drop-in AdSense service configuration with a `<smart-adsense>` custom element for retry, refresh, and status tracking.
4
7
 
5
8
  ## Features
@@ -8,11 +11,11 @@ A drop-in AdSense service configuration with a `<smart-adsense>` custom element
8
11
  - **Retry + refresh orchestration**: configurable delay/count for unfilled slots and interval-based refresh when filled.
9
12
  - **Resize awareness**: if the `params` attribute sets `refreshOnResize=true`, a filled element re-renders whenever its width changes (attribute described in the Element API section).
10
13
  - **Mutation-based status detection** via `MutationObserver`, emitting `adsense:status` (`filled`, `unfilled`, `pending`, etc.).
11
- - **SSR/CSR safe service** built on `smart-load-manager` (mutexed script loading, early hints, debug logging support).
14
+ - **SSR/CSR safe service** built on [smart-load-manager](https://github.com/dshovchko/smart-services/tree/main/packages/smart-load-manager#readme) (mutexed script loading, early hints, debug logging support).
12
15
 
13
16
  ## Service vs. element
14
17
 
15
- - **Service (`SmartAdsense`)** - extends `SmartService` to own script loading, retries, refresh timers, and early-hint helpers. You can call it directly (`SmartAdsense.load()`, `SmartAdsense.preload()`, `SmartAdsense.setupEarlyHints()`) or wire it into `SmartLoad.queue()`.
18
+ - **Service (`SmartAdsense`)** - extends [SmartService](https://github.com/dshovchko/smart-services/tree/main/packages/smart-load-manager#smartload-usage) to own script loading, retries, refresh timers, and early-hint helpers. You can call it directly (`SmartAdsense.load()`, `SmartAdsense.preload()`, `SmartAdsense.setupEarlyHints()`) or wire it into `SmartLoad.queue()`.
16
19
  - **Element (`<smart-adsense>`)** - wraps the service so markup can express lazy/conditional activation (`loading`, `display`), resize awareness, and DOM events for status tracking.
17
20
 
18
21
  *Typical flow*: configure the service once (`SmartAdsense.config()`), register the element, and sprinkle `<smart-adsense>` components throughout templates. When you need bespoke orchestration, trigger the same service instance via `SmartLoad` or manual calls while the element reacts to `SmartAdsense.instance.load()` resolution.
@@ -27,7 +30,7 @@ A drop-in AdSense service configuration with a `<smart-adsense>` custom element
27
30
  npm install smart-adsense smart-load-manager @exadel/esl
28
31
  ```
29
32
 
30
- `smart-adsense` wraps `smart-load-manager` and re-exports pieces from it. Both packages expect [`@exadel/esl`](https://www.npmjs.com/package/@exadel/esl) as a peer dependency (you can learn more about ESL on the library [website](https://esl-ui.com/)). Your package manager will prompt if ESL is missing; if your project already ships a compatible ESL build, you can skip it from the install command above.
33
+ `smart-adsense` wraps [smart-load-manager](https://www.npmjs.com/package/smart-load-manager) and re-exports pieces from it. Both packages expect [`@exadel/esl`](https://www.npmjs.com/package/@exadel/esl) as a peer dependency (you can learn more about ESL on the library [website](https://esl-ui.com/)). Your package manager will prompt if ESL is missing; if your project already ships a compatible ESL build, you can skip it from the install command above.
31
34
 
32
35
  The CSS file `smart-adsense.css` ships in `dist/` folder - copy or import it wherever you register the element.
33
36
 
@@ -199,5 +202,5 @@ document.body.appendChild(el);
199
202
 
200
203
  ## Compatibility & performance
201
204
 
202
- - **Browser support**: Requires ES2019+ syntax (async/await, optional chaining, nullish coalescing), Custom Elements, IntersectionObserver, ResizeObserver, and AbortController (same as `smart-load-manager`). Add polyfills before registering the element if you target legacy browsers (e.g., [@webcomponents/custom-elements](https://github.com/webcomponents/polyfills/tree/master/packages/custom-elements), [intersection-observer](https://github.com/w3c/IntersectionObserver/tree/main/polyfill)).
203
- - **Performance impact**: The service defers AdSense execution via idle/interaction guards, reducing layout shifts and blocking time. Using `SmartLoad.queue()` serializes queued third-party script loads (not every resource), so only one ad/marketing script fetch runs at a time, which helps stabilize Core Web Vitals on ad-heavy pages.
205
+ - **Browser support**: Requires ES2019+ syntax (async/await, optional chaining, nullish coalescing), Custom Elements, IntersectionObserver, ResizeObserver, and AbortController (same as [smart-load-manager](https://github.com/dshovchko/smart-services/tree/main/packages/smart-load-manager#readme)). Add polyfills before registering the element if you target legacy browsers (e.g., [@webcomponents/custom-elements](https://github.com/webcomponents/polyfills/tree/master/packages/custom-elements), [intersection-observer](https://github.com/w3c/IntersectionObserver/tree/main/polyfill)).
206
+ - **Performance impact**: The service defers AdSense execution via idle/interaction guards, reducing layout shifts and blocking time. Using [SmartLoad.queue()](https://github.com/dshovchko/smart-services/tree/main/packages/smart-load-manager#smartload-usage) serializes queued third-party script loads (not every resource), so only one ad/marketing script fetch runs at a time, which helps stabilize Core Web Vitals on ad-heavy pages.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-adsense",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A service and web component for enhanced loading and management of AdSense ad blocks in your web application",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -23,6 +23,10 @@
23
23
  "url": "git+https://github.com/dshovchko/smart-services.git",
24
24
  "directory": "packages/smart-adsense"
25
25
  },
26
+ "homepage": "https://github.com/dshovchko/smart-services/tree/main/packages/smart-adsense#readme",
27
+ "bugs": {
28
+ "url": "https://github.com/dshovchko/smart-services/issues"
29
+ },
26
30
  "keywords": [
27
31
  "ads",
28
32
  "adsense",