@adobe/helix-rum-enhancer 2.24.0 → 2.25.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/modules/dom.js +9 -2
- package/package.json +5 -5
- package/src/index.js +9 -2
- package/src/index.md5 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [2.25.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.24.0...v2.25.0) (2024-10-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* capturing id of form and button type inside a form ([#293](https://github.com/adobe/helix-rum-enhancer/issues/293)) ([530572f](https://github.com/adobe/helix-rum-enhancer/commit/530572f7c441c72f8d5f7683bef7490d37186a9f))
|
|
7
|
+
|
|
1
8
|
# [2.24.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.23.0...v2.24.0) (2024-09-20)
|
|
2
9
|
|
|
3
10
|
|
package/modules/dom.js
CHANGED
|
@@ -61,7 +61,9 @@ function isButton(element) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function getSourceContext(element) {
|
|
64
|
-
if (element.closest('form'))
|
|
64
|
+
if (element.closest('form')) {
|
|
65
|
+
return `form${element.id ? `#${element.id}` : ''}`;
|
|
66
|
+
}
|
|
65
67
|
const block = element.closest('.block[data-block-name]');
|
|
66
68
|
if (block) return `.${block.getAttribute('data-block-name')}`;
|
|
67
69
|
if (walk(element, isDialog)) return 'dialog';
|
|
@@ -73,7 +75,12 @@ function getSourceContext(element) {
|
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
function getSourceElement(element) {
|
|
76
|
-
if (element.closest('form') && Array.from(element.closest('form').elements).includes(element))
|
|
78
|
+
if (element.closest('form') && Array.from(element.closest('form').elements).includes(element)) {
|
|
79
|
+
return (element.tagName.toLowerCase()
|
|
80
|
+
+ (['INPUT', 'BUTTON'].includes(element.tagName)
|
|
81
|
+
? `[type='${element.getAttribute('type') || ''}']`
|
|
82
|
+
: ''));
|
|
83
|
+
}
|
|
77
84
|
if (walk(element, isButton)) return 'button';
|
|
78
85
|
return element.tagName.toLowerCase().match(/^(a|img|video)$/) && element.tagName.toLowerCase();
|
|
79
86
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-rum-enhancer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"description": "Helix RUM Enhancer",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -49,16 +49,16 @@
|
|
|
49
49
|
"eslint-plugin-header": "3.1.1",
|
|
50
50
|
"eslint-plugin-import": "2.30.0",
|
|
51
51
|
"husky": "9.1.6",
|
|
52
|
-
"jsdoc-to-markdown": "9.0.
|
|
53
|
-
"junit-report-builder": "5.
|
|
52
|
+
"jsdoc-to-markdown": "9.0.2",
|
|
53
|
+
"junit-report-builder": "5.1.1",
|
|
54
54
|
"lint-staged": "15.2.10",
|
|
55
55
|
"mocha": "10.7.3",
|
|
56
56
|
"mocha-multi-reporters": "1.5.1",
|
|
57
|
-
"rollup": "4.
|
|
57
|
+
"rollup": "4.24.0",
|
|
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",
|
|
61
|
-
"semantic-release": "24.1.
|
|
61
|
+
"semantic-release": "24.1.2",
|
|
62
62
|
"semantic-release-slack-bot": "^4.0.2",
|
|
63
63
|
"web-vitals": "4.2.3"
|
|
64
64
|
},
|
package/src/index.js
CHANGED
|
@@ -80,7 +80,9 @@
|
|
|
80
80
|
return element.getAttribute('role') === 'button';
|
|
81
81
|
}
|
|
82
82
|
function getSourceContext(element) {
|
|
83
|
-
if (element.closest('form'))
|
|
83
|
+
if (element.closest('form')) {
|
|
84
|
+
return `form${element.id ? `#${element.id}` : ''}`;
|
|
85
|
+
}
|
|
84
86
|
const block = element.closest('.block[data-block-name]');
|
|
85
87
|
if (block) return `.${block.getAttribute('data-block-name')}`;
|
|
86
88
|
if (walk(element, isDialog)) return 'dialog';
|
|
@@ -91,7 +93,12 @@
|
|
|
91
93
|
return (walk(element, (e) => e.id && `#${e.id}`));
|
|
92
94
|
}
|
|
93
95
|
function getSourceElement(element) {
|
|
94
|
-
if (element.closest('form') && Array.from(element.closest('form').elements).includes(element))
|
|
96
|
+
if (element.closest('form') && Array.from(element.closest('form').elements).includes(element)) {
|
|
97
|
+
return (element.tagName.toLowerCase()
|
|
98
|
+
+ (['INPUT', 'BUTTON'].includes(element.tagName)
|
|
99
|
+
? `[type='${element.getAttribute('type') || ''}']`
|
|
100
|
+
: ''));
|
|
101
|
+
}
|
|
95
102
|
if (walk(element, isButton)) return 'button';
|
|
96
103
|
return element.tagName.toLowerCase().match(/^(a|img|video)$/) && element.tagName.toLowerCase();
|
|
97
104
|
}
|
package/src/index.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f87fdcb7d5c1e4526225b185d4f392fb
|