@gemx-dev/clarity-visualize 0.8.65 → 0.8.67

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.
@@ -149,19 +149,16 @@ function get$1(input, type) {
149
149
  selectorMap[key].push(input.id);
150
150
  }
151
151
  selector = "".concat(key).concat("~" /* Constant.Tilde */).concat(selectorMap[key].indexOf(input.id));
152
- console.log("\uD83D\uDE80 \uD83D\uDC25 ~ get ~ selector:", selector);
153
152
  }
154
153
  else {
155
154
  // In Beta mode, we continue to look at query selectors in context of the full page
156
155
  selector = "".concat(prefix).concat(input.tag, ".").concat(classes).concat(suffix);
157
- console.log("\uD83D\uDE80 \uD83D\uDC25 ~ get ~ selector:", selector);
158
156
  }
159
157
  }
160
158
  // Update selector to use "id" field when available. There are two exceptions:
161
159
  // (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
162
160
  // (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
163
161
  selector = id && filter(id) ? "".concat(getDomPrefix(prefix)).concat("#" /* Constant.Hash */).concat(id) : selector;
164
- console.log("\uD83D\uDE80 \uD83D\uDC25 ~ get ~ selector:", selector);
165
162
  return selector;
166
163
  }
167
164
  }
@@ -189,7 +186,6 @@ function filter(value) {
189
186
  return false;
190
187
  } // Do not process empty strings
191
188
  var excludeClassNames = getExcludeClassNames();
192
- console.log("\uD83D\uDE80 \uD83D\uDC25 ~ filter ~ excludeClassNames:", excludeClassNames);
193
189
  if (excludeClassNames.some(function (x) { return value.toLowerCase().indexOf(x) >= 0; })) {
194
190
  return false;
195
191
  }
@@ -202,8 +198,6 @@ function filter(value) {
202
198
  return true;
203
199
  }
204
200
  function getExcludeClassNames() {
205
- console.log("\uD83D\uDE80 \uD83D\uDC25 ~ getExcludeClassNames ~ extraExcludeClassNames:", extraExcludeClassNames);
206
- console.log("\uD83D\uDE80 \uD83D\uDC25 ~ getExcludeClassNames ~ excludeClassNames:", excludeClassNames);
207
201
  return __spreadArray(__spreadArray([], excludeClassNames, true), extraExcludeClassNames, true);
208
202
  }
209
203
 
@@ -996,7 +990,9 @@ var HeatmapHelper = /** @class */ (function () {
996
990
  if (e.tagName === "CANVAS" /* Constant.Canvas */ || (e.id && e.id.indexOf("clarity-" /* Constant.ClarityPrefix */) === 0)) {
997
991
  continue;
998
992
  }
999
- visibility = e === el;
993
+ // Consider visible if the top element is the element itself OR a descendant of it
994
+ // (e.g. a BUTTON containing P/SPAN children — children will appear on top in elementsFromPoint)
995
+ visibility = e === el || el.contains(e);
1000
996
  shadowElement = e.shadowRoot && e.shadowRoot != doc ? e.shadowRoot : null;
1001
997
  break;
1002
998
  }
@@ -1056,7 +1052,7 @@ var HeatmapHelper = /** @class */ (function () {
1056
1052
  return canvas;
1057
1053
  }
1058
1054
  catch (error) {
1059
- console.error("\uD83D\uDE80 \uD83D\uDC25 ~ HeatmapHelper ~ createPortalCanvas:", error);
1055
+ console.error("[Heatmap] createPortalCanvas:", error);
1060
1056
  }
1061
1057
  return null;
1062
1058
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gemx-dev/clarity-visualize",
3
- "version": "0.8.65",
3
+ "version": "0.8.67",
4
4
  "description": "Clarity visualize",
5
5
  "author": "Microsoft Corp.",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "unpkg": "build/clarity.visualize.min.js",
10
10
  "types": "types/index.d.ts",
11
11
  "dependencies": {
12
- "@gemx-dev/clarity-decode": "^0.8.65"
12
+ "@gemx-dev/clarity-decode": "^0.8.67"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@rollup/plugin-commonjs": "^24.0.0",
package/src/heatmap.ts CHANGED
@@ -366,7 +366,9 @@ export class HeatmapHelper {
366
366
  for (let e of elements) {
367
367
  // Ignore if top element ends up being the canvas element we added for heatmap visualization
368
368
  if (e.tagName === Constant.Canvas || (e.id && e.id.indexOf(Constant.ClarityPrefix) === 0)) { continue; }
369
- visibility = e === el;
369
+ // Consider visible if the top element is the element itself OR a descendant of it
370
+ // (e.g. a BUTTON containing P/SPAN children — children will appear on top in elementsFromPoint)
371
+ visibility = e === el || el.contains(e);
370
372
  shadowElement = e.shadowRoot && e.shadowRoot != doc ? e.shadowRoot : null;
371
373
  break;
372
374
  }
@@ -420,7 +422,7 @@ export class HeatmapHelper {
420
422
  this.parentCanvasInfo.canvas = canvas;
421
423
  return canvas;
422
424
  } catch (error) {
423
- console.error(`🚀 🐥 ~ HeatmapHelper ~ createPortalCanvas:`, error);
425
+ console.error(`[Heatmap] createPortalCanvas:`, error);
424
426
  }
425
427
  return null;
426
428
  }