@absolutejs/beacon 0.6.60 → 0.6.62
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/dist/contracts.d.ts +73 -0
- package/dist/contracts.js +85 -0
- package/dist/contracts.js.map +10 -0
- package/dist/index.d.ts +4 -87
- package/dist/index.js +47 -23
- package/dist/index.js.map +5 -4
- package/dist/manifest.js +1 -1
- package/dist/manifest.js.map +1 -1
- package/package.json +7 -2
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** Stable names for Beacon's built-in UX and health signals. */
|
|
2
|
+
export declare const BEACON_SIGNAL: {
|
|
3
|
+
readonly AUTH_FAILURE_STORM: "auth_failure_storm";
|
|
4
|
+
readonly BROWSER_INTERVENTION: "browser_intervention";
|
|
5
|
+
readonly BROWSER_POLICY_VIOLATION: "browser_policy_violation";
|
|
6
|
+
readonly BFCACHE_BLOCKED: "bfcache_blocked";
|
|
7
|
+
readonly CAPABILITY_FAILURE: "capability_failure";
|
|
8
|
+
readonly BLANK_APP_ROOT: "blank_app_root";
|
|
9
|
+
readonly CONSOLE_ERROR: "console_error";
|
|
10
|
+
readonly CONTROL_COLLISION: "control_collision";
|
|
11
|
+
readonly CSP_VIOLATION: "csp_violation";
|
|
12
|
+
readonly CLIPBOARD_FAILURE: "clipboard_failure";
|
|
13
|
+
readonly DEAD_CLICK: "dead_click";
|
|
14
|
+
readonly DISRUPTIVE_LAYOUT_SHIFT: "disruptive_layout_shift";
|
|
15
|
+
readonly DOCUMENT_DISCARDED: "document_discarded";
|
|
16
|
+
readonly ERROR_CLICK: "error_click";
|
|
17
|
+
readonly FETCH_FAILED: "fetch_failed";
|
|
18
|
+
readonly FOCUS_LOST: "focus_lost";
|
|
19
|
+
readonly FONT_FAILURE: "font_failure";
|
|
20
|
+
readonly FORM_FRUSTRATION: "form_frustration";
|
|
21
|
+
readonly FORM_ABANDONMENT: "form_abandonment";
|
|
22
|
+
readonly FOCUSED_CONTROL_OFFSCREEN: "focused_control_offscreen";
|
|
23
|
+
readonly HTTP_5XX: "http_5xx";
|
|
24
|
+
readonly HTTP_RESPONSE_FAILURE: "http_response_failure";
|
|
25
|
+
readonly INVISIBLE_TEXT: "invisible_text";
|
|
26
|
+
readonly EMBEDDED_CONTENT_STALLED: "embedded_content_stalled";
|
|
27
|
+
readonly LAYOUT_OVERFLOW: "layout_overflow";
|
|
28
|
+
readonly MAIN_THREAD_STALL: "main_thread_stall";
|
|
29
|
+
readonly MEDIA_PLAYBACK_FAILED: "media_playback_failed";
|
|
30
|
+
readonly MEDIA_PLAYBACK_STALLED: "media_playback_stalled";
|
|
31
|
+
readonly MODAL_FOCUS_ESCAPE: "modal_focus_escape";
|
|
32
|
+
readonly OCCLUDED_CONTROL: "occluded_control";
|
|
33
|
+
readonly RAGE_CLICK: "rage_click";
|
|
34
|
+
readonly RATE_LIMITED: "rate_limited";
|
|
35
|
+
readonly NAVIGATION_STALLED: "navigation_stalled";
|
|
36
|
+
readonly RELOAD_LOOP: "reload_loop";
|
|
37
|
+
readonly REQUEST_STORM: "request_storm";
|
|
38
|
+
readonly SEMANTIC_RESPONSE_FAILURE: "semantic_response_failure";
|
|
39
|
+
readonly SCROLL_JAIL: "scroll_jail";
|
|
40
|
+
readonly SLOW_RESPONSE: "slow_response";
|
|
41
|
+
readonly SLOW_RESOURCE: "slow_resource";
|
|
42
|
+
readonly SLOW_INTERACTION: "slow_interaction";
|
|
43
|
+
readonly SOCKET_ABNORMAL_CLOSE: "socket_abnormal_close";
|
|
44
|
+
readonly SOCKET_FLAPPING: "socket_flapping";
|
|
45
|
+
readonly SSE_FLAPPING: "sse_flapping";
|
|
46
|
+
readonly STALE_RELEASE: "stale_release";
|
|
47
|
+
readonly STALLED_STREAM: "stalled_stream";
|
|
48
|
+
readonly STUCK_LOADING: "stuck_loading";
|
|
49
|
+
readonly THEME_MISMATCH: "theme_mismatch";
|
|
50
|
+
readonly THRASHED_CURSOR: "thrashed_cursor";
|
|
51
|
+
readonly STORAGE_FAILURE: "storage_failure";
|
|
52
|
+
readonly WEBGL_CONTEXT_LOST: "webgl_context_lost";
|
|
53
|
+
readonly SERVICE_WORKER_FAILURE: "service_worker_failure";
|
|
54
|
+
readonly WORKER_FAILURE: "worker_failure";
|
|
55
|
+
};
|
|
56
|
+
export type BeaconSignal = (typeof BEACON_SIGNAL)[keyof typeof BEACON_SIGNAL];
|
|
57
|
+
/** Stable DOM attributes understood by Beacon's instrumentation. */
|
|
58
|
+
export declare const BEACON_ATTRIBUTE: {
|
|
59
|
+
readonly APP_ROOT: "data-beacon-app-root";
|
|
60
|
+
readonly CONTROL_GROUP: "data-beacon-control-group";
|
|
61
|
+
readonly DEAD_CLICK: "data-beacon-dead-click";
|
|
62
|
+
readonly NAME: "data-beacon-name";
|
|
63
|
+
readonly EMBED: "data-beacon-embed";
|
|
64
|
+
readonly LOADING: "data-beacon-loading";
|
|
65
|
+
readonly LOADING_TIMEOUT: "data-beacon-loading-timeout";
|
|
66
|
+
readonly FORM: "data-beacon-form";
|
|
67
|
+
/** `="allow"` exempts an intentional dynamic subtree from layout-shift issues. */
|
|
68
|
+
readonly LAYOUT_SHIFT: "data-beacon-layout-shift";
|
|
69
|
+
readonly MEDIA: "data-beacon-media";
|
|
70
|
+
readonly OVERFLOW: "data-beacon-overflow";
|
|
71
|
+
readonly SCAN: "data-beacon-scan";
|
|
72
|
+
readonly THEME: "data-beacon-theme";
|
|
73
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// src/contracts.ts
|
|
10
|
+
var BEACON_SIGNAL = {
|
|
11
|
+
AUTH_FAILURE_STORM: "auth_failure_storm",
|
|
12
|
+
BROWSER_INTERVENTION: "browser_intervention",
|
|
13
|
+
BROWSER_POLICY_VIOLATION: "browser_policy_violation",
|
|
14
|
+
BFCACHE_BLOCKED: "bfcache_blocked",
|
|
15
|
+
CAPABILITY_FAILURE: "capability_failure",
|
|
16
|
+
BLANK_APP_ROOT: "blank_app_root",
|
|
17
|
+
CONSOLE_ERROR: "console_error",
|
|
18
|
+
CONTROL_COLLISION: "control_collision",
|
|
19
|
+
CSP_VIOLATION: "csp_violation",
|
|
20
|
+
CLIPBOARD_FAILURE: "clipboard_failure",
|
|
21
|
+
DEAD_CLICK: "dead_click",
|
|
22
|
+
DISRUPTIVE_LAYOUT_SHIFT: "disruptive_layout_shift",
|
|
23
|
+
DOCUMENT_DISCARDED: "document_discarded",
|
|
24
|
+
ERROR_CLICK: "error_click",
|
|
25
|
+
FETCH_FAILED: "fetch_failed",
|
|
26
|
+
FOCUS_LOST: "focus_lost",
|
|
27
|
+
FONT_FAILURE: "font_failure",
|
|
28
|
+
FORM_FRUSTRATION: "form_frustration",
|
|
29
|
+
FORM_ABANDONMENT: "form_abandonment",
|
|
30
|
+
FOCUSED_CONTROL_OFFSCREEN: "focused_control_offscreen",
|
|
31
|
+
HTTP_5XX: "http_5xx",
|
|
32
|
+
HTTP_RESPONSE_FAILURE: "http_response_failure",
|
|
33
|
+
INVISIBLE_TEXT: "invisible_text",
|
|
34
|
+
EMBEDDED_CONTENT_STALLED: "embedded_content_stalled",
|
|
35
|
+
LAYOUT_OVERFLOW: "layout_overflow",
|
|
36
|
+
MAIN_THREAD_STALL: "main_thread_stall",
|
|
37
|
+
MEDIA_PLAYBACK_FAILED: "media_playback_failed",
|
|
38
|
+
MEDIA_PLAYBACK_STALLED: "media_playback_stalled",
|
|
39
|
+
MODAL_FOCUS_ESCAPE: "modal_focus_escape",
|
|
40
|
+
OCCLUDED_CONTROL: "occluded_control",
|
|
41
|
+
RAGE_CLICK: "rage_click",
|
|
42
|
+
RATE_LIMITED: "rate_limited",
|
|
43
|
+
NAVIGATION_STALLED: "navigation_stalled",
|
|
44
|
+
RELOAD_LOOP: "reload_loop",
|
|
45
|
+
REQUEST_STORM: "request_storm",
|
|
46
|
+
SEMANTIC_RESPONSE_FAILURE: "semantic_response_failure",
|
|
47
|
+
SCROLL_JAIL: "scroll_jail",
|
|
48
|
+
SLOW_RESPONSE: "slow_response",
|
|
49
|
+
SLOW_RESOURCE: "slow_resource",
|
|
50
|
+
SLOW_INTERACTION: "slow_interaction",
|
|
51
|
+
SOCKET_ABNORMAL_CLOSE: "socket_abnormal_close",
|
|
52
|
+
SOCKET_FLAPPING: "socket_flapping",
|
|
53
|
+
SSE_FLAPPING: "sse_flapping",
|
|
54
|
+
STALE_RELEASE: "stale_release",
|
|
55
|
+
STALLED_STREAM: "stalled_stream",
|
|
56
|
+
STUCK_LOADING: "stuck_loading",
|
|
57
|
+
THEME_MISMATCH: "theme_mismatch",
|
|
58
|
+
THRASHED_CURSOR: "thrashed_cursor",
|
|
59
|
+
STORAGE_FAILURE: "storage_failure",
|
|
60
|
+
WEBGL_CONTEXT_LOST: "webgl_context_lost",
|
|
61
|
+
SERVICE_WORKER_FAILURE: "service_worker_failure",
|
|
62
|
+
WORKER_FAILURE: "worker_failure"
|
|
63
|
+
};
|
|
64
|
+
var BEACON_ATTRIBUTE = {
|
|
65
|
+
APP_ROOT: "data-beacon-app-root",
|
|
66
|
+
CONTROL_GROUP: "data-beacon-control-group",
|
|
67
|
+
DEAD_CLICK: "data-beacon-dead-click",
|
|
68
|
+
NAME: "data-beacon-name",
|
|
69
|
+
EMBED: "data-beacon-embed",
|
|
70
|
+
LOADING: "data-beacon-loading",
|
|
71
|
+
LOADING_TIMEOUT: "data-beacon-loading-timeout",
|
|
72
|
+
FORM: "data-beacon-form",
|
|
73
|
+
LAYOUT_SHIFT: "data-beacon-layout-shift",
|
|
74
|
+
MEDIA: "data-beacon-media",
|
|
75
|
+
OVERFLOW: "data-beacon-overflow",
|
|
76
|
+
SCAN: "data-beacon-scan",
|
|
77
|
+
THEME: "data-beacon-theme"
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
BEACON_ATTRIBUTE,
|
|
81
|
+
BEACON_SIGNAL
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
//# debugId=31E8F050CD18134164756E2164756E21
|
|
85
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/contracts.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/** Stable names for Beacon's built-in UX and health signals. */\nexport const BEACON_SIGNAL = {\n AUTH_FAILURE_STORM: \"auth_failure_storm\",\n BROWSER_INTERVENTION: \"browser_intervention\",\n BROWSER_POLICY_VIOLATION: \"browser_policy_violation\",\n BFCACHE_BLOCKED: \"bfcache_blocked\",\n CAPABILITY_FAILURE: \"capability_failure\",\n BLANK_APP_ROOT: \"blank_app_root\",\n CONSOLE_ERROR: \"console_error\",\n CONTROL_COLLISION: \"control_collision\",\n CSP_VIOLATION: \"csp_violation\",\n CLIPBOARD_FAILURE: \"clipboard_failure\",\n DEAD_CLICK: \"dead_click\",\n DISRUPTIVE_LAYOUT_SHIFT: \"disruptive_layout_shift\",\n DOCUMENT_DISCARDED: \"document_discarded\",\n ERROR_CLICK: \"error_click\",\n FETCH_FAILED: \"fetch_failed\",\n FOCUS_LOST: \"focus_lost\",\n FONT_FAILURE: \"font_failure\",\n FORM_FRUSTRATION: \"form_frustration\",\n FORM_ABANDONMENT: \"form_abandonment\",\n FOCUSED_CONTROL_OFFSCREEN: \"focused_control_offscreen\",\n HTTP_5XX: \"http_5xx\",\n HTTP_RESPONSE_FAILURE: \"http_response_failure\",\n INVISIBLE_TEXT: \"invisible_text\",\n EMBEDDED_CONTENT_STALLED: \"embedded_content_stalled\",\n LAYOUT_OVERFLOW: \"layout_overflow\",\n MAIN_THREAD_STALL: \"main_thread_stall\",\n MEDIA_PLAYBACK_FAILED: \"media_playback_failed\",\n MEDIA_PLAYBACK_STALLED: \"media_playback_stalled\",\n MODAL_FOCUS_ESCAPE: \"modal_focus_escape\",\n OCCLUDED_CONTROL: \"occluded_control\",\n RAGE_CLICK: \"rage_click\",\n RATE_LIMITED: \"rate_limited\",\n NAVIGATION_STALLED: \"navigation_stalled\",\n RELOAD_LOOP: \"reload_loop\",\n REQUEST_STORM: \"request_storm\",\n SEMANTIC_RESPONSE_FAILURE: \"semantic_response_failure\",\n SCROLL_JAIL: \"scroll_jail\",\n SLOW_RESPONSE: \"slow_response\",\n SLOW_RESOURCE: \"slow_resource\",\n SLOW_INTERACTION: \"slow_interaction\",\n SOCKET_ABNORMAL_CLOSE: \"socket_abnormal_close\",\n SOCKET_FLAPPING: \"socket_flapping\",\n SSE_FLAPPING: \"sse_flapping\",\n STALE_RELEASE: \"stale_release\",\n STALLED_STREAM: \"stalled_stream\",\n STUCK_LOADING: \"stuck_loading\",\n THEME_MISMATCH: \"theme_mismatch\",\n THRASHED_CURSOR: \"thrashed_cursor\",\n STORAGE_FAILURE: \"storage_failure\",\n WEBGL_CONTEXT_LOST: \"webgl_context_lost\",\n SERVICE_WORKER_FAILURE: \"service_worker_failure\",\n WORKER_FAILURE: \"worker_failure\",\n} as const;\n\nexport type BeaconSignal = (typeof BEACON_SIGNAL)[keyof typeof BEACON_SIGNAL];\n\n/** Stable DOM attributes understood by Beacon's instrumentation. */\nexport const BEACON_ATTRIBUTE = {\n APP_ROOT: \"data-beacon-app-root\",\n CONTROL_GROUP: \"data-beacon-control-group\",\n DEAD_CLICK: \"data-beacon-dead-click\",\n NAME: \"data-beacon-name\",\n EMBED: \"data-beacon-embed\",\n LOADING: \"data-beacon-loading\",\n LOADING_TIMEOUT: \"data-beacon-loading-timeout\",\n FORM: \"data-beacon-form\",\n /** `=\"allow\"` exempts an intentional dynamic subtree from layout-shift issues. */\n LAYOUT_SHIFT: \"data-beacon-layout-shift\",\n MEDIA: \"data-beacon-media\",\n OVERFLOW: \"data-beacon-overflow\",\n SCAN: \"data-beacon-scan\",\n THEME: \"data-beacon-theme\",\n} as const;\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;AACO,IAAM,gBAAgB;AAAA,EAC3B,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,gBAAgB;AAAA,EAChB,0BAA0B;AAAA,EAC1B,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,eAAe;AAAA,EACf,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,gBAAgB;AAClB;AAKO,IAAM,mBAAmB;AAAA,EAC9B,UAAU;AAAA,EACV,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,MAAM;AAAA,EAEN,cAAc;AAAA,EACd,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AACT;",
|
|
8
|
+
"debugId": "31E8F050CD18134164756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,96 +18,14 @@
|
|
|
18
18
|
* → batch
|
|
19
19
|
* → flush: POST envelope to /ingest via sendBeacon / fetch keepalive
|
|
20
20
|
*/
|
|
21
|
+
export { BEACON_ATTRIBUTE, BEACON_SIGNAL } from "./contracts";
|
|
22
|
+
export type { BeaconSignal } from "./contracts";
|
|
23
|
+
import type { BeaconSignal } from "./contracts";
|
|
21
24
|
export type BeaconLevel = "fatal" | "error" | "warning" | "info";
|
|
22
|
-
/** Stable names for Beacon's built-in UX and health signals. */
|
|
23
|
-
export declare const BEACON_SIGNAL: {
|
|
24
|
-
readonly AUTH_FAILURE_STORM: "auth_failure_storm";
|
|
25
|
-
readonly BROWSER_INTERVENTION: "browser_intervention";
|
|
26
|
-
readonly BROWSER_POLICY_VIOLATION: "browser_policy_violation";
|
|
27
|
-
readonly BFCACHE_BLOCKED: "bfcache_blocked";
|
|
28
|
-
readonly CAPABILITY_FAILURE: "capability_failure";
|
|
29
|
-
readonly BLANK_APP_ROOT: "blank_app_root";
|
|
30
|
-
readonly CONSOLE_ERROR: "console_error";
|
|
31
|
-
readonly CONTROL_COLLISION: "control_collision";
|
|
32
|
-
readonly CSP_VIOLATION: "csp_violation";
|
|
33
|
-
readonly CLIPBOARD_FAILURE: "clipboard_failure";
|
|
34
|
-
readonly DEAD_CLICK: "dead_click";
|
|
35
|
-
readonly DISRUPTIVE_LAYOUT_SHIFT: "disruptive_layout_shift";
|
|
36
|
-
readonly DOCUMENT_DISCARDED: "document_discarded";
|
|
37
|
-
readonly ERROR_CLICK: "error_click";
|
|
38
|
-
readonly FETCH_FAILED: "fetch_failed";
|
|
39
|
-
readonly FOCUS_LOST: "focus_lost";
|
|
40
|
-
readonly FONT_FAILURE: "font_failure";
|
|
41
|
-
readonly FORM_FRUSTRATION: "form_frustration";
|
|
42
|
-
readonly FORM_ABANDONMENT: "form_abandonment";
|
|
43
|
-
readonly FOCUSED_CONTROL_OFFSCREEN: "focused_control_offscreen";
|
|
44
|
-
readonly HTTP_5XX: "http_5xx";
|
|
45
|
-
readonly HTTP_RESPONSE_FAILURE: "http_response_failure";
|
|
46
|
-
readonly INVISIBLE_TEXT: "invisible_text";
|
|
47
|
-
readonly EMBEDDED_CONTENT_STALLED: "embedded_content_stalled";
|
|
48
|
-
readonly LAYOUT_OVERFLOW: "layout_overflow";
|
|
49
|
-
readonly MAIN_THREAD_STALL: "main_thread_stall";
|
|
50
|
-
readonly MEDIA_PLAYBACK_FAILED: "media_playback_failed";
|
|
51
|
-
readonly MEDIA_PLAYBACK_STALLED: "media_playback_stalled";
|
|
52
|
-
readonly MODAL_FOCUS_ESCAPE: "modal_focus_escape";
|
|
53
|
-
readonly OCCLUDED_CONTROL: "occluded_control";
|
|
54
|
-
readonly RAGE_CLICK: "rage_click";
|
|
55
|
-
readonly RATE_LIMITED: "rate_limited";
|
|
56
|
-
readonly NAVIGATION_STALLED: "navigation_stalled";
|
|
57
|
-
readonly RELOAD_LOOP: "reload_loop";
|
|
58
|
-
readonly REQUEST_STORM: "request_storm";
|
|
59
|
-
readonly SEMANTIC_RESPONSE_FAILURE: "semantic_response_failure";
|
|
60
|
-
readonly SCROLL_JAIL: "scroll_jail";
|
|
61
|
-
readonly SLOW_RESPONSE: "slow_response";
|
|
62
|
-
readonly SLOW_RESOURCE: "slow_resource";
|
|
63
|
-
readonly SLOW_INTERACTION: "slow_interaction";
|
|
64
|
-
readonly SOCKET_ABNORMAL_CLOSE: "socket_abnormal_close";
|
|
65
|
-
readonly SOCKET_FLAPPING: "socket_flapping";
|
|
66
|
-
readonly SSE_FLAPPING: "sse_flapping";
|
|
67
|
-
readonly STALE_RELEASE: "stale_release";
|
|
68
|
-
readonly STALLED_STREAM: "stalled_stream";
|
|
69
|
-
readonly STUCK_LOADING: "stuck_loading";
|
|
70
|
-
readonly THEME_MISMATCH: "theme_mismatch";
|
|
71
|
-
readonly THRASHED_CURSOR: "thrashed_cursor";
|
|
72
|
-
readonly STORAGE_FAILURE: "storage_failure";
|
|
73
|
-
readonly WEBGL_CONTEXT_LOST: "webgl_context_lost";
|
|
74
|
-
readonly SERVICE_WORKER_FAILURE: "service_worker_failure";
|
|
75
|
-
readonly WORKER_FAILURE: "worker_failure";
|
|
76
|
-
};
|
|
77
|
-
export type BeaconSignal = (typeof BEACON_SIGNAL)[keyof typeof BEACON_SIGNAL];
|
|
78
|
-
/** Stable DOM attributes understood by Beacon's instrumentation. */
|
|
79
|
-
export declare const BEACON_ATTRIBUTE: {
|
|
80
|
-
/** Names an application root whose settled empty state is a failure. */
|
|
81
|
-
readonly APP_ROOT: "data-beacon-app-root";
|
|
82
|
-
/** Groups controls whose intentional near-touching layout should not be
|
|
83
|
-
* reported as a collision. True border-box overlaps remain reportable. */
|
|
84
|
-
readonly CONTROL_GROUP: "data-beacon-control-group";
|
|
85
|
-
readonly DEAD_CLICK: "data-beacon-dead-click";
|
|
86
|
-
readonly NAME: "data-beacon-name";
|
|
87
|
-
/** Names an iframe whose initial load should be watched for a stall. */
|
|
88
|
-
readonly EMBED: "data-beacon-embed";
|
|
89
|
-
/** Marks loading UI that should participate in the stuck-loading watchdog. */
|
|
90
|
-
readonly LOADING: "data-beacon-loading";
|
|
91
|
-
/** Overrides the stuck-loading deadline for one loading element, in ms. */
|
|
92
|
-
readonly LOADING_TIMEOUT: "data-beacon-loading-timeout";
|
|
93
|
-
/** Names a form whose dirty navigation should be reported as abandonment. */
|
|
94
|
-
readonly FORM: "data-beacon-form";
|
|
95
|
-
/** Names media whose user-visible playback should be watched. */
|
|
96
|
-
readonly MEDIA: "data-beacon-media";
|
|
97
|
-
/** `="allow"` exempts an element AND its subtree from layout-overflow
|
|
98
|
-
* detection — for deliberate bleeds (decorative shapes, marquees). */
|
|
99
|
-
readonly OVERFLOW: "data-beacon-overflow";
|
|
100
|
-
/** `="allow"` exempts an element AND its subtree from the visual scan
|
|
101
|
-
* detectors (occluded controls, invisible text, stuck loading). */
|
|
102
|
-
readonly SCAN: "data-beacon-scan";
|
|
103
|
-
/** `="adaptive"` opts a subtree into theme-polarity checks; `="allow"`
|
|
104
|
-
* exempts an intentional opposite-theme surface and its subtree. */
|
|
105
|
-
readonly THEME: "data-beacon-theme";
|
|
106
|
-
};
|
|
107
25
|
/** Response header used to correlate a browser signal with its server request. */
|
|
108
26
|
export declare const BEACON_TRACE_HEADER = "x-absolute-trace-id";
|
|
109
27
|
/** Beacon package version retained with every captured event. */
|
|
110
|
-
export declare const BEACON_SDK_VERSION = "0.6.
|
|
28
|
+
export declare const BEACON_SDK_VERSION = "0.6.62";
|
|
111
29
|
/** Arbitrary event tags, with Beacon's reserved `signal` tag type-checked. */
|
|
112
30
|
export type BeaconTags = Record<string, string> & {
|
|
113
31
|
signal?: BeaconSignal;
|
|
@@ -640,4 +558,3 @@ export declare const addBreadcrumb: (crumb: {
|
|
|
640
558
|
}) => void;
|
|
641
559
|
/** Observe an application-owned browser capability against the global beacon. */
|
|
642
560
|
export declare const observeCapability: <T>(name: string, operation: Promise<T>) => Promise<T>;
|
|
643
|
-
export {};
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
6
6
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
// src/
|
|
9
|
+
// src/contracts.ts
|
|
10
10
|
var BEACON_SIGNAL = {
|
|
11
11
|
AUTH_FAILURE_STORM: "auth_failure_storm",
|
|
12
12
|
BROWSER_INTERVENTION: "browser_intervention",
|
|
@@ -70,13 +70,16 @@ var BEACON_ATTRIBUTE = {
|
|
|
70
70
|
LOADING: "data-beacon-loading",
|
|
71
71
|
LOADING_TIMEOUT: "data-beacon-loading-timeout",
|
|
72
72
|
FORM: "data-beacon-form",
|
|
73
|
+
LAYOUT_SHIFT: "data-beacon-layout-shift",
|
|
73
74
|
MEDIA: "data-beacon-media",
|
|
74
75
|
OVERFLOW: "data-beacon-overflow",
|
|
75
76
|
SCAN: "data-beacon-scan",
|
|
76
77
|
THEME: "data-beacon-theme"
|
|
77
78
|
};
|
|
79
|
+
|
|
80
|
+
// src/index.ts
|
|
78
81
|
var BEACON_TRACE_HEADER = "x-absolute-trace-id";
|
|
79
|
-
var BEACON_SDK_VERSION = "0.6.
|
|
82
|
+
var BEACON_SDK_VERSION = "0.6.62";
|
|
80
83
|
var inBrowser = () => typeof window !== "undefined";
|
|
81
84
|
var newId = () => {
|
|
82
85
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
@@ -502,18 +505,26 @@ var VOLATILE_SIGNAL_TAGS = new Set([
|
|
|
502
505
|
"presentationDelayMs",
|
|
503
506
|
"processingDurationMs",
|
|
504
507
|
"reportDelayMs",
|
|
508
|
+
"renderDurationMs",
|
|
505
509
|
"responseMs",
|
|
506
510
|
"shiftValue",
|
|
507
511
|
"signal",
|
|
512
|
+
"scriptCount",
|
|
513
|
+
"scriptDurationMs",
|
|
514
|
+
"scriptForcedStyleAndLayoutMs",
|
|
515
|
+
"scriptPauseDurationMs",
|
|
516
|
+
"scriptSourceCharPosition",
|
|
508
517
|
"spillPx",
|
|
509
518
|
"stallCount",
|
|
519
|
+
"styleAndLayoutDurationMs",
|
|
510
520
|
"thresholdMs",
|
|
511
521
|
"userAgent",
|
|
512
522
|
"viewportHeight",
|
|
513
523
|
"viewportWidth",
|
|
514
524
|
"windowMs"
|
|
515
525
|
]);
|
|
516
|
-
var
|
|
526
|
+
var BUILT_ASSET_HASH = /([/][A-Za-z0-9_-]+)\.[a-z0-9]{6,16}(\.(?:js|css))\b/giu;
|
|
527
|
+
var normalizeSignalIdentityPart = (value) => value.replace(BUILT_ASSET_HASH, "$1.:asset$2").replace(UUID_PATH_SEGMENT, ":id").replace(LONG_IDENTIFIER_SEGMENT, ":id").slice(0, SIGNAL_IDENTITY_PART_MAX);
|
|
517
528
|
var SIGNAL_IDENTITY_PART_MAX = 160;
|
|
518
529
|
var stableIdentityHash = (value, seed) => {
|
|
519
530
|
let hash = seed;
|
|
@@ -2781,7 +2792,11 @@ var createBeacon = (options) => {
|
|
|
2781
2792
|
});
|
|
2782
2793
|
if (entry.hadRecentInput === true || beaconSawRecentInput || resizeAdjacent || mobileKeyboardViewportActive() || (entry.value ?? 0) < minimum)
|
|
2783
2794
|
continue;
|
|
2784
|
-
const
|
|
2795
|
+
const sourceElements = (entry.sources ?? []).map(({ node }) => node instanceof Element ? node : undefined).filter((node) => node !== undefined);
|
|
2796
|
+
if (sourceElements.length > 0 && sourceElements.every((node) => node.closest(`[${BEACON_ATTRIBUTE.LAYOUT_SHIFT}="allow"]`) !== null)) {
|
|
2797
|
+
continue;
|
|
2798
|
+
}
|
|
2799
|
+
const targets = sourceElements.map((node) => describeElement(node)).slice(0, 5);
|
|
2785
2800
|
const key = targets.join(",") || "unknown";
|
|
2786
2801
|
const framePhase = entry.startTime < MAIN_THREAD_STALL_DEFAULT_WINDOW_MS ? "startup" : "runtime";
|
|
2787
2802
|
const interactionProvenance = key === "unknown" && recentInteraction !== undefined && interactionAgeMs !== undefined && interactionAgeMs >= 0 && interactionAgeMs <= LAYOUT_SHIFT_INTERACTION_PROVENANCE_MS ? recentInteraction : undefined;
|
|
@@ -3429,7 +3444,6 @@ var createBeacon = (options) => {
|
|
|
3429
3444
|
if (signals.focusLoss !== false || signals.modalFocusEscape !== false) {
|
|
3430
3445
|
const DIALOG_SELECTOR = '[role="dialog"], [aria-modal="true"], dialog';
|
|
3431
3446
|
const MODAL_SELECTOR = '[aria-modal="true"], dialog[open]';
|
|
3432
|
-
let lastDialogFocus = null;
|
|
3433
3447
|
const reportedFocusLoss = new Set;
|
|
3434
3448
|
const reportedModalEscapes = new WeakSet;
|
|
3435
3449
|
const modalTimers = new Set;
|
|
@@ -3510,10 +3524,10 @@ var createBeacon = (options) => {
|
|
|
3510
3524
|
modalTimers.add(timer2);
|
|
3511
3525
|
}
|
|
3512
3526
|
}
|
|
3513
|
-
lastDialogFocus = target instanceof Element && target.closest(DIALOG_SELECTOR) !== null ? target : null;
|
|
3514
3527
|
};
|
|
3515
|
-
const onFocusOut = () => {
|
|
3516
|
-
const
|
|
3528
|
+
const onFocusOut = (event) => {
|
|
3529
|
+
const target = event.target;
|
|
3530
|
+
const candidate = target instanceof Element && target.closest(DIALOG_SELECTOR) !== null ? target : null;
|
|
3517
3531
|
if (candidate === null)
|
|
3518
3532
|
return;
|
|
3519
3533
|
setTimeout(() => {
|
|
@@ -3837,8 +3851,12 @@ var createBeacon = (options) => {
|
|
|
3837
3851
|
if (signals.socketFlapping === false)
|
|
3838
3852
|
return;
|
|
3839
3853
|
const now = Date.now();
|
|
3840
|
-
const closes = (closesByUrl.get(label) ?? []).filter((
|
|
3841
|
-
closes.push(
|
|
3854
|
+
const closes = (closesByUrl.get(label) ?? []).filter((close) => now - close.at < SOCKET_FLAP_WINDOW_MS);
|
|
3855
|
+
closes.push({
|
|
3856
|
+
at: now,
|
|
3857
|
+
code: typeof CloseEvent !== "undefined" && event instanceof CloseEvent ? event.code : null,
|
|
3858
|
+
wasClean: typeof CloseEvent !== "undefined" && event instanceof CloseEvent ? event.wasClean : null
|
|
3859
|
+
});
|
|
3842
3860
|
closesByUrl.set(label, closes);
|
|
3843
3861
|
if (closes.length < SOCKET_FLAP_CYCLES || reportedSockets.has(label)) {
|
|
3844
3862
|
return;
|
|
@@ -3849,6 +3867,12 @@ var createBeacon = (options) => {
|
|
|
3849
3867
|
endpoint: label,
|
|
3850
3868
|
signal: BEACON_SIGNAL.SOCKET_FLAPPING,
|
|
3851
3869
|
windowMs: String(SOCKET_FLAP_WINDOW_MS)
|
|
3870
|
+
}, undefined, {
|
|
3871
|
+
closeSamples: closes.map((close) => ({
|
|
3872
|
+
ageMs: now - close.at,
|
|
3873
|
+
code: close.code,
|
|
3874
|
+
wasClean: close.wasClean
|
|
3875
|
+
}))
|
|
3852
3876
|
});
|
|
3853
3877
|
});
|
|
3854
3878
|
return socket;
|
|
@@ -4529,20 +4553,20 @@ var captureMessage = (message, level, context) => current?.captureMessage(messag
|
|
|
4529
4553
|
var addBreadcrumb = (crumb) => current?.addBreadcrumb(crumb);
|
|
4530
4554
|
var observeCapability = (name, operation) => current?.observeCapability(name, operation) ?? operation;
|
|
4531
4555
|
export {
|
|
4532
|
-
|
|
4533
|
-
observeCapability,
|
|
4534
|
-
isKnownBeaconNoise,
|
|
4535
|
-
initBeacon,
|
|
4536
|
-
getBeacon,
|
|
4537
|
-
createBeacon,
|
|
4538
|
-
captureMessage,
|
|
4539
|
-
captureException,
|
|
4540
|
-
addBreadcrumb,
|
|
4541
|
-
BEACON_TRACE_HEADER,
|
|
4542
|
-
BEACON_SIGNAL,
|
|
4556
|
+
BEACON_ATTRIBUTE,
|
|
4543
4557
|
BEACON_SDK_VERSION,
|
|
4544
|
-
|
|
4558
|
+
BEACON_SIGNAL,
|
|
4559
|
+
BEACON_TRACE_HEADER,
|
|
4560
|
+
addBreadcrumb,
|
|
4561
|
+
captureException,
|
|
4562
|
+
captureMessage,
|
|
4563
|
+
createBeacon,
|
|
4564
|
+
getBeacon,
|
|
4565
|
+
initBeacon,
|
|
4566
|
+
isKnownBeaconNoise,
|
|
4567
|
+
observeCapability,
|
|
4568
|
+
redactBeaconEvent
|
|
4545
4569
|
};
|
|
4546
4570
|
|
|
4547
|
-
//# debugId=
|
|
4571
|
+
//# debugId=265E265F233DD52C64756E2164756E21
|
|
4548
4572
|
//# sourceMappingURL=index.js.map
|