@adobe/helix-rum-enhancer 2.26.4 → 2.28.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [2.28.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.27.0...v2.28.0) (2025-01-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * remove (deprecated) FID ex-CWV ([58e39ae](https://github.com/adobe/helix-rum-enhancer/commit/58e39ae3eae6315562ab9c7aec479e9da2737e7d))
7
+
8
+ # [2.27.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.26.4...v2.27.0) (2024-12-20)
9
+
10
+
11
+ ### Features
12
+
13
+ * adding new checkpoint fill ([#336](https://github.com/adobe/helix-rum-enhancer/issues/336)) ([d3887f3](https://github.com/adobe/helix-rum-enhancer/commit/d3887f3b7eb073aa9f9e18f4d4a106bf7fa5b676))
14
+
1
15
  ## [2.26.4](https://github.com/adobe/helix-rum-enhancer/compare/v2.26.3...v2.26.4) (2024-12-20)
2
16
 
3
17
 
package/modules/index.js CHANGED
@@ -90,7 +90,7 @@ function addCWVTracking() {
90
90
 
91
91
  // When loading `web-vitals` using a classic script, all the public
92
92
  // methods can be found on the `webVitals` global namespace.
93
- ['FID', 'INP', 'TTFB', 'CLS', 'LCP'].forEach((metric) => {
93
+ ['INP', 'TTFB', 'CLS', 'LCP'].forEach((metric) => {
94
94
  const metricFn = window.webVitals[`on${metric}`];
95
95
  if (typeof metricFn === 'function') {
96
96
  let opts = {};
@@ -251,21 +251,25 @@ function addViewMediaTracking(parent) {
251
251
  }
252
252
  }
253
253
 
254
- function addFocusTracking(parent) {
255
- parent.addEventListener('focusin', (event) => {
256
- if (['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'].includes(event.target.tagName)
257
- || event.target.getAttribute('contenteditable') === 'true') {
258
- sampleRUM('click', { source: sourceSelector(event.target) });
259
- }
260
- });
261
- }
262
-
263
254
  function addFormTracking(parent) {
264
255
  activateBlocksMO();
265
256
  activateMediaMO();
266
257
  parent.querySelectorAll('form').forEach((form) => {
267
258
  form.addEventListener('submit', (e) => sampleRUM('formsubmit', { target: targetSelector(e.target), source: sourceSelector(e.target) }), { once: true });
268
- addFocusTracking(form);
259
+ let lastSource;
260
+ form.addEventListener('change', (e) => {
261
+ const source = sourceSelector(e.target);
262
+ if (source !== lastSource) {
263
+ sampleRUM('fill', { source });
264
+ lastSource = source;
265
+ }
266
+ });
267
+ form.addEventListener('focusin', (e) => {
268
+ if (['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'].includes(e.target.tagName)
269
+ || e.target.getAttribute('contenteditable') === 'true') {
270
+ sampleRUM('click', { source: sourceSelector(e.target) });
271
+ }
272
+ });
269
273
  });
270
274
  }
271
275
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-rum-enhancer",
3
- "version": "2.26.4",
3
+ "version": "2.28.0",
4
4
  "description": "Helix RUM Enhancer",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -51,10 +51,10 @@
51
51
  "husky": "9.1.7",
52
52
  "jsdoc-to-markdown": "9.1.1",
53
53
  "junit-report-builder": "5.1.1",
54
- "lint-staged": "15.2.11",
54
+ "lint-staged": "15.3.0",
55
55
  "mocha": "11.0.1",
56
56
  "mocha-multi-reporters": "1.5.1",
57
- "rollup": "4.28.1",
57
+ "rollup": "4.29.1",
58
58
  "rollup-plugin-checksum": "1.0.1",
59
59
  "rollup-plugin-cleanup": "3.2.1",
60
60
  "rollup-plugin-eslint-bundle": "9.0.0",
package/src/index.js CHANGED
@@ -248,7 +248,7 @@
248
248
  sampleRUM('cwv', data);
249
249
  };
250
250
  const isEager = (metric) => ['CLS', 'LCP'].includes(metric);
251
- ['FID', 'INP', 'TTFB', 'CLS', 'LCP'].forEach((metric) => {
251
+ ['INP', 'TTFB', 'CLS', 'LCP'].forEach((metric) => {
252
252
  const metricFn = window.webVitals[`on${metric}`];
253
253
  if (typeof metricFn === 'function') {
254
254
  let opts = {};
@@ -384,20 +384,25 @@
384
384
  });
385
385
  }
386
386
  }
387
- function addFocusTracking(parent) {
388
- parent.addEventListener('focusin', (event) => {
389
- if (['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'].includes(event.target.tagName)
390
- || event.target.getAttribute('contenteditable') === 'true') {
391
- sampleRUM('click', { source: sourceSelector(event.target) });
392
- }
393
- });
394
- }
395
387
  function addFormTracking(parent) {
396
388
  activateBlocksMO();
397
389
  activateMediaMO();
398
390
  parent.querySelectorAll('form').forEach((form) => {
399
391
  form.addEventListener('submit', (e) => sampleRUM('formsubmit', { target: targetSelector(e.target), source: sourceSelector(e.target) }), { once: true });
400
- addFocusTracking(form);
392
+ let lastSource;
393
+ form.addEventListener('change', (e) => {
394
+ const source = sourceSelector(e.target);
395
+ if (source !== lastSource) {
396
+ sampleRUM('fill', { source });
397
+ lastSource = source;
398
+ }
399
+ });
400
+ form.addEventListener('focusin', (e) => {
401
+ if (['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'].includes(e.target.tagName)
402
+ || e.target.getAttribute('contenteditable') === 'true') {
403
+ sampleRUM('click', { source: sourceSelector(e.target) });
404
+ }
405
+ });
401
406
  });
402
407
  }
403
408
  function addObserver(ck, fn, block) {
package/src/index.md5 CHANGED
@@ -1 +1 @@
1
- 80a42e2816eebe0efae335ce49fe1225
1
+ 2b54b4b328b08aa2e60c2ffb42edd06b