@adobe/helix-rum-enhancer 2.26.4 → 2.27.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,10 @@
1
+ # [2.27.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.26.4...v2.27.0) (2024-12-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * adding new checkpoint fill ([#336](https://github.com/adobe/helix-rum-enhancer/issues/336)) ([d3887f3](https://github.com/adobe/helix-rum-enhancer/commit/d3887f3b7eb073aa9f9e18f4d4a106bf7fa5b676))
7
+
1
8
  ## [2.26.4](https://github.com/adobe/helix-rum-enhancer/compare/v2.26.3...v2.26.4) (2024-12-20)
2
9
 
3
10
 
package/modules/index.js CHANGED
@@ -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.27.0",
4
4
  "description": "Helix RUM Enhancer",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -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
+ 04eb0119fbaa5f7d37e24a608bbb8195