@absolutejs/beacon 0.6.53 → 0.6.55

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/README.md CHANGED
@@ -125,6 +125,9 @@ beacon.captureMessage("checkout started", "info");
125
125
  scroll containers, and absolutely positioned escapees (badges, popovers,
126
126
  drawers) are skipped by design; mark deliberate
127
127
  bleeds with `data-beacon-overflow="allow"`.
128
+ Geometry scans pause while the mobile visual viewport is horizontally
129
+ shifted or zoomed, so iOS keyboard/pan coordinates are not mistaken for
130
+ document overflow.
128
131
  - **Control-collision signals** — the same settled scan reports interactive
129
132
  controls from separate layout groups whose border boxes overlap or render
130
133
  with effectively no spacing. Same-parent rows, semantic control groups,
@@ -199,7 +202,10 @@ beacon.captureMessage("checkout started", "info");
199
202
  interactions and separates input delay, handler time, and presentation delay.
200
203
  Overlapping long animation frames include their worst script when the browser
201
204
  exposes it; missing browser attribution is labeled explicitly. Layout
202
- Instability names shifted elements. Successful HTTP responses can be
205
+ Instability names shifted elements. When the browser supplies no shifted
206
+ node, Beacon retains startup/runtime phase plus recent interaction type,
207
+ target, and age; stable provenance separates issue grouping while volatile
208
+ age remains diagnostic-only. Successful HTTP responses can be
203
209
  classified through the host-owned `instrument.classifyResponse` callback for
204
210
  GraphQL-style errors. Selected HTTP 4xx/5xx responses can be promoted through
205
211
  the opt-in `instrument.classifyErrorResponse` callback when application context
package/dist/index.d.ts CHANGED
@@ -107,7 +107,7 @@ export declare const BEACON_ATTRIBUTE: {
107
107
  /** Response header used to correlate a browser signal with its server request. */
108
108
  export declare const BEACON_TRACE_HEADER = "x-absolute-trace-id";
109
109
  /** Beacon package version retained with every captured event. */
110
- export declare const BEACON_SDK_VERSION = "0.6.53";
110
+ export declare const BEACON_SDK_VERSION = "0.6.55";
111
111
  /** Arbitrary event tags, with Beacon's reserved `signal` tag type-checked. */
112
112
  export type BeaconTags = Record<string, string> & {
113
113
  signal?: BeaconSignal;
package/dist/index.js CHANGED
@@ -76,7 +76,7 @@ var BEACON_ATTRIBUTE = {
76
76
  THEME: "data-beacon-theme"
77
77
  };
78
78
  var BEACON_TRACE_HEADER = "x-absolute-trace-id";
79
- var BEACON_SDK_VERSION = "0.6.53";
79
+ var BEACON_SDK_VERSION = "0.6.55";
80
80
  var inBrowser = () => typeof window !== "undefined";
81
81
  var newId = () => {
82
82
  if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
@@ -494,6 +494,7 @@ var VOLATILE_SIGNAL_TAGS = new Set([
494
494
  "errorCount",
495
495
  "inputDelayMs",
496
496
  "interactionId",
497
+ "interactionAgeMs",
497
498
  "loadCount",
498
499
  "newestRelease",
499
500
  "obscuredPx",
@@ -799,6 +800,7 @@ var createBeacon = (options) => {
799
800
  const FORM_FRUSTRATION_THRESHOLD = 3;
800
801
  const FORM_FRUSTRATION_WINDOW_MS = 60000;
801
802
  const LAYOUT_SHIFT_RECENT_INTERACTION_MS = 500;
803
+ const LAYOUT_SHIFT_INTERACTION_PROVENANCE_MS = 1e4;
802
804
  const LAYOUT_SHIFT_VIEWPORT_RESIZE_SETTLE_MS = 500;
803
805
  const VIEWPORT_RESIZE_HISTORY_LIMIT = 8;
804
806
  const FORM_INVALID_BURST_GAP_MS = 100;
@@ -855,6 +857,14 @@ var createBeacon = (options) => {
855
857
  const visualViewport = window.visualViewport;
856
858
  return visualViewport !== undefined && visualViewport !== null && visualViewport.height > 0 && window.innerHeight > 0 && visualViewport.height < window.innerHeight * KEYBOARD_VIEWPORT_HEIGHT_RATIO_MAX && focusedEditable() !== null;
857
859
  };
860
+ const visualViewportHorizontallyShifted = () => {
861
+ const visualViewport = window.visualViewport;
862
+ if (visualViewport === undefined || visualViewport === null)
863
+ return false;
864
+ const layoutWidth = document.documentElement.clientWidth;
865
+ const tolerancePx = 2;
866
+ return Math.abs(visualViewport.offsetLeft) > tolerancePx || visualViewport.width > 0 && visualViewport.width < layoutWidth - tolerancePx || visualViewport.scale !== undefined && Math.abs(visualViewport.scale - 1) > 0.01;
867
+ };
858
868
  let overflowScanOnNavigation = null;
859
869
  let recordRequestForStorm = null;
860
870
  const OVERLAY_VIEWPORT_COVERAGE_MIN = 0.9;
@@ -2153,6 +2163,8 @@ var createBeacon = (options) => {
2153
2163
  if (overflowX === "auto" || overflowX === "scroll")
2154
2164
  return;
2155
2165
  if (overflowX === "hidden" || overflowX === "clip") {
2166
+ if (isMaterialIconGlyph(element))
2167
+ return;
2156
2168
  const horizontalContentWidth = Math.max(element.clientWidth, rect.width);
2157
2169
  const clipPx = element.scrollWidth - horizontalContentWidth;
2158
2170
  if (clipPx > LAYOUT_OVERFLOW_CONTAINER_TOLERANCE_PX && style.textOverflow !== "ellipsis") {
@@ -2684,7 +2696,7 @@ var createBeacon = (options) => {
2684
2696
  });
2685
2697
  };
2686
2698
  const runSettledScan = () => {
2687
- const geometryReady = documentStylesAreReady() && !mobileKeyboardViewportActive();
2699
+ const geometryReady = documentStylesAreReady() && !mobileKeyboardViewportActive() && !visualViewportHorizontallyShifted();
2688
2700
  if (detectOverflow && geometryReady)
2689
2701
  scanForOverflow();
2690
2702
  if (detectControlCollision && geometryReady)
@@ -2763,10 +2775,26 @@ var createBeacon = (options) => {
2763
2775
  continue;
2764
2776
  const targets = (entry.sources ?? []).map(({ node }) => node instanceof Element ? describeElement(node) : undefined).filter((target) => target !== undefined).slice(0, 5);
2765
2777
  const key = targets.join(",") || "unknown";
2766
- if (reported.has(key))
2778
+ const framePhase = entry.startTime < MAIN_THREAD_STALL_DEFAULT_WINDOW_MS ? "startup" : "runtime";
2779
+ const interactionProvenance = key === "unknown" && recentInteraction !== undefined && interactionAgeMs !== undefined && interactionAgeMs >= 0 && interactionAgeMs <= LAYOUT_SHIFT_INTERACTION_PROVENANCE_MS ? recentInteraction : undefined;
2780
+ const reportKey = key === "unknown" ? [
2781
+ key,
2782
+ framePhase,
2783
+ interactionProvenance?.type ?? "no-interaction",
2784
+ interactionProvenance?.target ?? "unknown"
2785
+ ].join("|") : key;
2786
+ if (reported.has(reportKey))
2767
2787
  continue;
2768
- reported.add(key);
2788
+ reported.add(reportKey);
2769
2789
  emitSignal(`Disruptive layout shift — ${key} — ${shortUrl(location.href)}`, {
2790
+ ...key === "unknown" ? {
2791
+ framePhase,
2792
+ ...interactionProvenance === undefined ? {} : {
2793
+ interactionAgeMs: String(Math.round(interactionAgeMs ?? 0)),
2794
+ interactionTarget: interactionProvenance.target,
2795
+ interactionType: interactionProvenance.type
2796
+ }
2797
+ } : {},
2770
2798
  shiftValue: String(entry.value ?? 0),
2771
2799
  signal: BEACON_SIGNAL.DISRUPTIVE_LAYOUT_SHIFT,
2772
2800
  target: key
@@ -4489,5 +4517,5 @@ export {
4489
4517
  BEACON_ATTRIBUTE
4490
4518
  };
4491
4519
 
4492
- //# debugId=EE83C567E5E182D764756E2164756E21
4520
+ //# debugId=11D74B10F3D1902364756E2164756E21
4493
4521
  //# sourceMappingURL=index.js.map