@adobe/helix-rum-enhancer 1.8.1 → 1.9.1

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/.releaserc.cjs CHANGED
@@ -12,5 +12,5 @@ module.exports = {
12
12
  }],
13
13
  ["@semantic-release/github", {}]
14
14
  ],
15
- branches: ['main'],
15
+ branches: ['main', "1.x"],
16
16
  };
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.9.1](https://github.com/adobe/helix-rum-enhancer/compare/v1.9.0...v1.9.1) (2024-01-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * correct prefix check for relative urls in targets. fixes [#102](https://github.com/adobe/helix-rum-enhancer/issues/102) ([3df4132](https://github.com/adobe/helix-rum-enhancer/commit/3df413259cd0e71777328f738b81057f7f4e5520))
7
+
8
+ # [1.9.0](https://github.com/adobe/helix-rum-enhancer/compare/v1.8.1...v1.9.0) (2023-12-11)
9
+
10
+
11
+ ### Features
12
+
13
+ * add support for source/target data attributes ([27739c6](https://github.com/adobe/helix-rum-enhancer/commit/27739c660b41f84df4e20d38efcf00d5335c7f5d))
14
+
1
15
  ## [1.8.1](https://github.com/adobe/helix-rum-enhancer/compare/v1.8.0...v1.8.1) (2023-11-29)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-rum-enhancer",
3
- "version": "1.8.1",
3
+ "version": "1.9.1",
4
4
  "description": "Helix RUM Enhancer",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -31,19 +31,19 @@
31
31
  "@adobe/eslint-config-helix": "2.0.5",
32
32
  "@semantic-release/changelog": "6.0.3",
33
33
  "@semantic-release/git": "10.0.1",
34
- "@semantic-release/npm": "11.0.1",
35
- "c8": "8.0.1",
34
+ "@semantic-release/npm": "11.0.2",
35
+ "c8": "9.0.0",
36
36
  "codecov": "3.8.3",
37
- "eslint": "8.54.0",
37
+ "eslint": "8.56.0",
38
38
  "eslint-plugin-header": "3.1.1",
39
- "eslint-plugin-import": "2.29.0",
39
+ "eslint-plugin-import": "2.29.1",
40
40
  "husky": "8.0.3",
41
41
  "jsdoc-to-markdown": "8.0.0",
42
42
  "junit-report-builder": "3.1.0",
43
- "lint-staged": "15.1.0",
43
+ "lint-staged": "15.2.0",
44
44
  "mocha": "10.2.0",
45
45
  "mocha-multi-reporters": "1.5.1",
46
- "semantic-release": "22.0.8"
46
+ "semantic-release": "22.0.12"
47
47
  },
48
48
  "lint-staged": {
49
49
  "*.js": "eslint",
package/src/index.js CHANGED
@@ -67,9 +67,9 @@ new PerformanceObserver((list) => list
67
67
  .observe({ type: 'navigation', buffered: true });
68
68
 
69
69
  sampleRUM.targetselector = (element) => {
70
- let value = element.getAttribute('href') || element.currentSrc || element.getAttribute('src')
70
+ let value = element.getAttribute('data-rum-target') || element.getAttribute('href') || element.currentSrc || element.getAttribute('src')
71
71
  || element.dataset.action || element.action;
72
- if (value && value.startsWith('https://')) {
72
+ if (value && !value.startsWith('https://')) {
73
73
  // resolve relative links
74
74
  value = new URL(value, window.location).href;
75
75
  }
@@ -115,7 +115,9 @@ sampleRUM.sourceselector = (element) => {
115
115
  if (element === document.body || element === document.documentElement || !element) {
116
116
  return undefined;
117
117
  }
118
-
118
+ if (element.getAttribute('data-rum-source')) {
119
+ return element.getAttribute('data-rum-source');
120
+ }
119
121
  const form = element.closest('form');
120
122
  let formElementSelector = '';
121
123
  if (form && Array.from(form.elements).includes(element)) {