@adobe/helix-rum-enhancer 2.30.0 → 2.30.2
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 +14 -0
- package/README.md +3 -4
- package/modules/dom.js +9 -13
- package/modules/index.js +6 -4
- package/package.json +1 -1
- package/src/index.js +15 -16
- package/src/index.md5 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.30.2](https://github.com/adobe/helix-rum-enhancer/compare/v2.30.1...v2.30.2) (2025-01-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* do not trigger fill checkpoint for hidden fields ([f6f4c51](https://github.com/adobe/helix-rum-enhancer/commit/f6f4c519d38c48740ace4ba64f47cafc6cea2f47))
|
|
7
|
+
|
|
8
|
+
## [2.30.1](https://github.com/adobe/helix-rum-enhancer/compare/v2.30.0...v2.30.1) (2025-01-17)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* form elements having name/id as id breaks the sourceSelector logic. ([37bd0ab](https://github.com/adobe/helix-rum-enhancer/commit/37bd0ab4c6bb1aac1326bc9be0097a7ccf038870))
|
|
14
|
+
|
|
1
15
|
# [2.30.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.29.0...v2.30.0) (2025-01-15)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -62,10 +62,6 @@ All three parts are optional
|
|
|
62
62
|
Even if an `identifier` is provided, having a `context` and `element` is recommended, as it makes the `source` parameter more readable and easier to understand.
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
#### Examples
|
|
66
|
-
|
|
67
|
-
- ``
|
|
68
|
-
|
|
69
65
|
## Development
|
|
70
66
|
|
|
71
67
|
### Build
|
|
@@ -85,3 +81,6 @@ $ npm test
|
|
|
85
81
|
```bash
|
|
86
82
|
$ npm run lint
|
|
87
83
|
```
|
|
84
|
+
### Cutting a Pre-Release
|
|
85
|
+
|
|
86
|
+
Releases are handled by [semantic-release](https://github.com/semantic-release/semantic-release), and will happen automatically when a PR is merged into the `main` or the `1.x` branch. By merging into `beta`, a pre-release will be created.
|
package/modules/dom.js
CHANGED
|
@@ -41,12 +41,10 @@ function isDialog(el) {
|
|
|
41
41
|
// doing it well
|
|
42
42
|
if (el.tagName === 'DIALOG') return true;
|
|
43
43
|
// making the best of it
|
|
44
|
-
if (el.getAttribute('role') === 'dialog') return true;
|
|
45
|
-
if (el.getAttribute('role') === 'alertdialog') return true;
|
|
46
|
-
if (el.getAttribute('aria-modal') === 'true') return true;
|
|
47
|
-
// doing it wrong
|
|
48
44
|
const cs = window.getComputedStyle(el);
|
|
49
|
-
return (
|
|
45
|
+
return ['dialog', 'alertdialog'].find((r) => el.getAttribute('role') === r)
|
|
46
|
+
|| el.getAttribute('aria-modal') === 'true'
|
|
47
|
+
|| (cs && cs.position === 'fixed' && cs.zIndex > 100);
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
function isButton(el) {
|
|
@@ -62,16 +60,14 @@ function isButton(el) {
|
|
|
62
60
|
function getSourceContext(el) {
|
|
63
61
|
const formEl = el.closest('form');
|
|
64
62
|
if (formEl) {
|
|
65
|
-
|
|
63
|
+
const id = formEl.getAttribute('id');
|
|
64
|
+
return `form${id ? `#${id}` : ''}`;
|
|
66
65
|
}
|
|
67
66
|
const block = el.closest('.block[data-block-name]');
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (el.closest('footer')) return 'footer';
|
|
73
|
-
if (el.closest('aside')) return 'aside';
|
|
74
|
-
return (walk(el, (e) => e.id && `#${e.id}`));
|
|
67
|
+
return ((block && `.${block.getAttribute('data-block-name')}`)
|
|
68
|
+
|| (walk(el, isDialog) && 'dialog')
|
|
69
|
+
|| ['nav', 'header', 'footer', 'aside'].find((t) => el.closest(t))
|
|
70
|
+
|| walk(el, (e) => e.id && `#${e.id}`));
|
|
75
71
|
}
|
|
76
72
|
|
|
77
73
|
function getSourceElement(el) {
|
package/modules/index.js
CHANGED
|
@@ -258,10 +258,12 @@ function addFormTracking(parent) {
|
|
|
258
258
|
form.addEventListener('submit', (e) => sampleRUM('formsubmit', { target: targetSelector(e.target), source: sourceSelector(e.target) }), { once: true });
|
|
259
259
|
let lastSource;
|
|
260
260
|
form.addEventListener('change', (e) => {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
261
|
+
if (e.target.checkVisibility()) {
|
|
262
|
+
const source = sourceSelector(e.target);
|
|
263
|
+
if (source !== lastSource) {
|
|
264
|
+
sampleRUM('fill', { source });
|
|
265
|
+
lastSource = source;
|
|
266
|
+
}
|
|
265
267
|
}
|
|
266
268
|
});
|
|
267
269
|
form.addEventListener('focusin', (e) => {
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -63,11 +63,10 @@
|
|
|
63
63
|
}
|
|
64
64
|
function isDialog(el) {
|
|
65
65
|
if (el.tagName === 'DIALOG') return true;
|
|
66
|
-
if (el.getAttribute('role') === 'dialog') return true;
|
|
67
|
-
if (el.getAttribute('role') === 'alertdialog') return true;
|
|
68
|
-
if (el.getAttribute('aria-modal') === 'true') return true;
|
|
69
66
|
const cs = window.getComputedStyle(el);
|
|
70
|
-
return (
|
|
67
|
+
return ['dialog', 'alertdialog'].find((r) => el.getAttribute('role') === r)
|
|
68
|
+
|| el.getAttribute('aria-modal') === 'true'
|
|
69
|
+
|| (cs && cs.position === 'fixed' && cs.zIndex > 100);
|
|
71
70
|
}
|
|
72
71
|
function isButton(el) {
|
|
73
72
|
if (el.tagName === 'BUTTON') return true;
|
|
@@ -81,16 +80,14 @@
|
|
|
81
80
|
function getSourceContext(el) {
|
|
82
81
|
const formEl = el.closest('form');
|
|
83
82
|
if (formEl) {
|
|
84
|
-
|
|
83
|
+
const id = formEl.getAttribute('id');
|
|
84
|
+
return `form${id ? `#${id}` : ''}`;
|
|
85
85
|
}
|
|
86
86
|
const block = el.closest('.block[data-block-name]');
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (el.closest('footer')) return 'footer';
|
|
92
|
-
if (el.closest('aside')) return 'aside';
|
|
93
|
-
return (walk(el, (e) => e.id && `#${e.id}`));
|
|
87
|
+
return ((block && `.${block.getAttribute('data-block-name')}`)
|
|
88
|
+
|| (walk(el, isDialog) && 'dialog')
|
|
89
|
+
|| ['nav', 'header', 'footer', 'aside'].find((t) => el.closest(t))
|
|
90
|
+
|| walk(el, (e) => e.id && `#${e.id}`));
|
|
94
91
|
}
|
|
95
92
|
function getSourceElement(el) {
|
|
96
93
|
const f = el.closest('form');
|
|
@@ -390,10 +387,12 @@
|
|
|
390
387
|
form.addEventListener('submit', (e) => sampleRUM('formsubmit', { target: targetSelector(e.target), source: sourceSelector(e.target) }), { once: true });
|
|
391
388
|
let lastSource;
|
|
392
389
|
form.addEventListener('change', (e) => {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
390
|
+
if (e.target.checkVisibility()) {
|
|
391
|
+
const source = sourceSelector(e.target);
|
|
392
|
+
if (source !== lastSource) {
|
|
393
|
+
sampleRUM('fill', { source });
|
|
394
|
+
lastSource = source;
|
|
395
|
+
}
|
|
397
396
|
}
|
|
398
397
|
});
|
|
399
398
|
form.addEventListener('focusin', (e) => {
|
package/src/index.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
389f38e9847798177fc9bd3f8f9b763b
|