@absolutejs/beacon 0.6.54 → 0.6.56

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
@@ -146,7 +146,8 @@ beacon.captureMessage("checkout started", "info");
146
146
  stalled `EventSource` streams, WebSocket connect/close flapping, request
147
147
  storms (one endpoint hammered in seconds), reload loops, stale releases (a
148
148
  service worker serving a build older than one this browser already ran),
149
- font-face load failures, focus dropped to `<body>` when a dialog unmounts,
149
+ required font-face load failures (excluding intentional optional fallback),
150
+ focus dropped to `<body>` when a dialog unmounts,
150
151
  focus escaping or never entering an explicit modal, browser interventions,
151
152
  enforced CSP violations, repeated visible-page main-thread stalls, and form
152
153
  frustration (identical resubmits / repeated native-validation failures).
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.54";
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.54";
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") {
@@ -2163,6 +2163,8 @@ var createBeacon = (options) => {
2163
2163
  if (overflowX === "auto" || overflowX === "scroll")
2164
2164
  return;
2165
2165
  if (overflowX === "hidden" || overflowX === "clip") {
2166
+ if (isMaterialIconGlyph(element))
2167
+ return;
2166
2168
  const horizontalContentWidth = Math.max(element.clientWidth, rect.width);
2167
2169
  const clipPx = element.scrollWidth - horizontalContentWidth;
2168
2170
  if (clipPx > LAYOUT_OVERFLOW_CONTAINER_TOLERANCE_PX && style.textOverflow !== "ellipsis") {
@@ -4135,7 +4137,8 @@ var createBeacon = (options) => {
4135
4137
  const reportedFonts = new Set;
4136
4138
  const checkingFonts = new Set;
4137
4139
  const confirmationMs = Math.max(0, signals.fontFailureConfirmMs ?? FONT_FAILURE_CONFIRM_DEFAULT_MS);
4138
- const normalizedFamily = (family) => family.trim().replace(/^(['"])(.*)\1$/u, "$2").toLowerCase();
4140
+ const canonicalFontFamily = (family) => family.trim().replace(/^(['"])(.*)\1$/u, "$2");
4141
+ const normalizedFamily = (family) => canonicalFontFamily(family).toLowerCase();
4139
4142
  const isRendered = (element) => {
4140
4143
  for (let current = element;current !== null; current = current.parentElement) {
4141
4144
  const style = window.getComputedStyle(current);
@@ -4159,9 +4162,10 @@ var createBeacon = (options) => {
4159
4162
  return null;
4160
4163
  };
4161
4164
  const reportFontFailure = (face, element, key) => {
4165
+ const family = canonicalFontFamily(face.family);
4162
4166
  reportedFonts.add(key);
4163
- emitSignal(`Font failure — ${face.family} failed to load — ${shortUrl(location.href)}`, {
4164
- fontFamily: face.family,
4167
+ emitSignal(`Font failure — ${family} failed to load — ${shortUrl(location.href)}`, {
4168
+ fontFamily: family,
4165
4169
  fontStretch: face.stretch,
4166
4170
  fontStyle: face.style,
4167
4171
  fontWeight: face.weight,
@@ -4170,16 +4174,19 @@ var createBeacon = (options) => {
4170
4174
  });
4171
4175
  };
4172
4176
  const verifyFontFailure = async (face) => {
4173
- const key = [face.family, face.style, face.weight, face.stretch].join("|");
4177
+ if (face.display === "optional")
4178
+ return;
4179
+ const family = canonicalFontFamily(face.family);
4180
+ const key = [family, face.style, face.weight, face.stretch].join("|");
4174
4181
  if (reportedFonts.has(key) || checkingFonts.has(key))
4175
4182
  return;
4176
- const element = affectedElement(face.family);
4183
+ const element = affectedElement(family);
4177
4184
  if (element === null)
4178
4185
  return;
4179
4186
  checkingFonts.add(key);
4180
4187
  const fontAvailable = async (consumer) => {
4181
4188
  const sample = consumer.textContent?.trim().slice(0, 64) || "BESbswy";
4182
- const font = `${face.style} ${face.weight} ${face.stretch} 16px ${JSON.stringify(face.family)}`;
4189
+ const font = `${face.style} ${face.weight} ${face.stretch} 16px ${JSON.stringify(family)}`;
4183
4190
  try {
4184
4191
  await document.fonts.load(font, sample);
4185
4192
  return document.fonts.check(font, sample);
@@ -4197,7 +4204,7 @@ var createBeacon = (options) => {
4197
4204
  });
4198
4205
  if (document.visibilityState === "hidden")
4199
4206
  return;
4200
- const confirmedElement = affectedElement(face.family);
4207
+ const confirmedElement = affectedElement(family);
4201
4208
  if (confirmedElement === null)
4202
4209
  return;
4203
4210
  if (await fontAvailable(confirmedElement))
@@ -4515,5 +4522,5 @@ export {
4515
4522
  BEACON_ATTRIBUTE
4516
4523
  };
4517
4524
 
4518
- //# debugId=AF2331F2AE3F654164756E2164756E21
4525
+ //# debugId=536F3C8DC6F6492764756E2164756E21
4519
4526
  //# sourceMappingURL=index.js.map