@adobe/helix-rum-enhancer 1.9.1 → 1.10.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 +7 -0
- package/package.json +1 -1
- package/src/index.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.10.0](https://github.com/adobe/helix-rum-enhancer/compare/v1.9.1...v1.10.0) (2024-01-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **sourceselector:** highlight clicks on buttons and CTAs ([4cd62b8](https://github.com/adobe/helix-rum-enhancer/commit/4cd62b86eb08c496712deba42d3f011b8cbac5c6))
|
|
7
|
+
|
|
1
8
|
## [1.9.1](https://github.com/adobe/helix-rum-enhancer/compare/v1.9.0...v1.9.1) (2024-01-11)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -124,8 +124,8 @@ sampleRUM.sourceselector = (element) => {
|
|
|
124
124
|
formElementSelector = element.tagName === 'INPUT' ? `form input[type='${element.getAttribute('type')}']` : `form ${element.tagName.toLowerCase()}`;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
const blockName = element.closest('.block') ? element.closest('.block').getAttribute('data-block-name') : '';
|
|
127
128
|
if (element.id || formElementSelector) {
|
|
128
|
-
const blockName = element.closest('.block') ? element.closest('.block').getAttribute('data-block-name') : '';
|
|
129
129
|
const id = element.id ? `#${element.id}` : '';
|
|
130
130
|
return blockName ? `.${blockName} ${formElementSelector}${id}` : `${formElementSelector}${id}`;
|
|
131
131
|
}
|
|
@@ -133,6 +133,11 @@ sampleRUM.sourceselector = (element) => {
|
|
|
133
133
|
if (element.getAttribute('data-block-name')) {
|
|
134
134
|
return `.${element.getAttribute('data-block-name')}`;
|
|
135
135
|
}
|
|
136
|
+
|
|
137
|
+
if (Array.from(element.classList).some((className) => className.match(/button|cta/))) {
|
|
138
|
+
return blockName ? `.${blockName} .button` : '.button';
|
|
139
|
+
}
|
|
140
|
+
|
|
136
141
|
return sampleRUM.sourceselector(element.parentElement);
|
|
137
142
|
};
|
|
138
143
|
|