@adobe/helix-rum-enhancer
Advanced tools
Comparing version
@@ -0,1 +1,8 @@ | ||
## [2.30.1](https://github.com/adobe/helix-rum-enhancer/compare/v2.30.0...v2.30.1) (2025-01-17) | ||
### Bug Fixes | ||
* form elements having name/id as id breaks the sourceSelector logic. ([37bd0ab](https://github.com/adobe/helix-rum-enhancer/commit/37bd0ab4c6bb1aac1326bc9be0097a7ccf038870)) | ||
# [2.30.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.29.0...v2.30.0) (2025-01-15) | ||
@@ -2,0 +9,0 @@ |
@@ -44,8 +44,6 @@ /* | ||
// making the best of it | ||
if (el.getAttribute('role') === 'dialog') return true; | ||
if (el.getAttribute('role') === 'alertdialog') return true; | ||
if (el.getAttribute('aria-modal') === 'true') return true; | ||
// doing it wrong | ||
const cs = window.getComputedStyle(el); | ||
return (cs && cs.position === 'fixed' && cs.zIndex > 100); | ||
return ['dialog', 'alertdialog'].find((r) => el.getAttribute('role') === r) | ||
|| el.getAttribute('aria-modal') === 'true' | ||
|| (cs && cs.position === 'fixed' && cs.zIndex > 100); | ||
} | ||
@@ -66,12 +64,10 @@ | ||
if (formEl) { | ||
return `form${formEl.id ? `#${formEl.id}` : ''}`; | ||
const id = formEl.getAttribute('id'); | ||
return `form${id ? `#${id}` : ''}`; | ||
} | ||
const block = el.closest('.block[data-block-name]'); | ||
if (block) return `.${block.getAttribute('data-block-name')}`; | ||
if (walk(el, isDialog)) return 'dialog'; | ||
if (el.closest('nav')) return 'nav'; | ||
if (el.closest('header')) return 'header'; | ||
if (el.closest('footer')) return 'footer'; | ||
if (el.closest('aside')) return 'aside'; | ||
return (walk(el, (e) => e.id && `#${e.id}`)); | ||
return ((block && `.${block.getAttribute('data-block-name')}`) | ||
|| (walk(el, isDialog) && 'dialog') | ||
|| ['nav', 'header', 'footer', 'aside'].find((t) => el.closest(t)) | ||
|| walk(el, (e) => e.id && `#${e.id}`)); | ||
} | ||
@@ -78,0 +74,0 @@ |
{ | ||
"name": "@adobe/helix-rum-enhancer", | ||
"version": "2.30.0", | ||
"version": "2.30.1", | ||
"description": "Helix RUM Enhancer", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -65,6 +65,2 @@ # Helix RUM Enhancer | ||
#### Examples | ||
- `` | ||
## Development | ||
@@ -89,1 +85,4 @@ | ||
``` | ||
### Cutting a Pre-Release | ||
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. |
@@ -66,7 +66,6 @@ /* | ||
if (el.tagName === 'DIALOG') return true; | ||
if (el.getAttribute('role') === 'dialog') return true; | ||
if (el.getAttribute('role') === 'alertdialog') return true; | ||
if (el.getAttribute('aria-modal') === 'true') return true; | ||
const cs = window.getComputedStyle(el); | ||
return (cs && cs.position === 'fixed' && cs.zIndex > 100); | ||
return ['dialog', 'alertdialog'].find((r) => el.getAttribute('role') === r) | ||
|| el.getAttribute('aria-modal') === 'true' | ||
|| (cs && cs.position === 'fixed' && cs.zIndex > 100); | ||
} | ||
@@ -85,12 +84,10 @@ function isButton(el) { | ||
if (formEl) { | ||
return `form${formEl.id ? `#${formEl.id}` : ''}`; | ||
const id = formEl.getAttribute('id'); | ||
return `form${id ? `#${id}` : ''}`; | ||
} | ||
const block = el.closest('.block[data-block-name]'); | ||
if (block) return `.${block.getAttribute('data-block-name')}`; | ||
if (walk(el, isDialog)) return 'dialog'; | ||
if (el.closest('nav')) return 'nav'; | ||
if (el.closest('header')) return 'header'; | ||
if (el.closest('footer')) return 'footer'; | ||
if (el.closest('aside')) return 'aside'; | ||
return (walk(el, (e) => e.id && `#${e.id}`)); | ||
return ((block && `.${block.getAttribute('data-block-name')}`) | ||
|| (walk(el, isDialog) && 'dialog') | ||
|| ['nav', 'header', 'footer', 'aside'].find((t) => el.closest(t)) | ||
|| walk(el, (e) => e.id && `#${e.id}`)); | ||
} | ||
@@ -97,0 +94,0 @@ function getSourceElement(el) { |
Sorry, the diff of this file is not supported yet
98328
0.24%1248
-0.56%86
-2.27%