blocfeed 0.18.0 → 0.20.0
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/CHANGELOG.md +35 -0
- package/dist/chunk-VWILLYYY.js +884 -0
- package/dist/chunk-X4ON6DOW.cjs +884 -0
- package/dist/{controller-09cYt2qm.d.cts → controller-DrQ--KwA.d.cts} +13 -0
- package/dist/{controller-09cYt2qm.d.ts → controller-DrQ--KwA.d.ts} +13 -0
- package/dist/engine.cjs +1 -1
- package/dist/engine.d.cts +2 -2
- package/dist/engine.d.ts +2 -2
- package/dist/engine.js +1 -1
- package/dist/main.cjs +1 -884
- package/dist/main.d.cts +9 -3
- package/dist/main.d.ts +9 -3
- package/dist/main.js +1 -884
- package/package.json +1 -1
- package/dist/chunk-FBLTAHNW.cjs +0 -2
- package/dist/chunk-GNKDVHVD.js +0 -2
|
@@ -28,16 +28,29 @@ interface BehavioralEvent {
|
|
|
28
28
|
element_text: string | null;
|
|
29
29
|
event_data: Record<string, unknown> | null;
|
|
30
30
|
created_at: string;
|
|
31
|
+
/**
|
|
32
|
+
* A render-stable identifier for the element associated with the event.
|
|
33
|
+
* Built from `data-blocfeed-component`, then a `data-testid`-family
|
|
34
|
+
* attribute, then the element id (walking up to a few ancestors). When
|
|
35
|
+
* none of those are available the field is `null`. Used by the backend
|
|
36
|
+
* to dedupe events for the "same logical element" across re-renders, even
|
|
37
|
+
* when the CSS selector changes.
|
|
38
|
+
*
|
|
39
|
+
* See `buildStableElementKey` in `src/shared/dom.ts`.
|
|
40
|
+
*/
|
|
41
|
+
stable_key: string | null;
|
|
31
42
|
}
|
|
32
43
|
interface RageClickConfig {
|
|
33
44
|
enabled?: boolean;
|
|
34
45
|
threshold?: number;
|
|
35
46
|
windowMs?: number;
|
|
47
|
+
streakIdleMs?: number;
|
|
36
48
|
}
|
|
37
49
|
interface HttpFailConfig {
|
|
38
50
|
enabled?: boolean;
|
|
39
51
|
statusCodes?: number[];
|
|
40
52
|
ignoreUrls?: string[];
|
|
53
|
+
treatJsonErrorAsFail?: boolean;
|
|
41
54
|
}
|
|
42
55
|
interface RedirectLoopConfig {
|
|
43
56
|
enabled?: boolean;
|
|
@@ -28,16 +28,29 @@ interface BehavioralEvent {
|
|
|
28
28
|
element_text: string | null;
|
|
29
29
|
event_data: Record<string, unknown> | null;
|
|
30
30
|
created_at: string;
|
|
31
|
+
/**
|
|
32
|
+
* A render-stable identifier for the element associated with the event.
|
|
33
|
+
* Built from `data-blocfeed-component`, then a `data-testid`-family
|
|
34
|
+
* attribute, then the element id (walking up to a few ancestors). When
|
|
35
|
+
* none of those are available the field is `null`. Used by the backend
|
|
36
|
+
* to dedupe events for the "same logical element" across re-renders, even
|
|
37
|
+
* when the CSS selector changes.
|
|
38
|
+
*
|
|
39
|
+
* See `buildStableElementKey` in `src/shared/dom.ts`.
|
|
40
|
+
*/
|
|
41
|
+
stable_key: string | null;
|
|
31
42
|
}
|
|
32
43
|
interface RageClickConfig {
|
|
33
44
|
enabled?: boolean;
|
|
34
45
|
threshold?: number;
|
|
35
46
|
windowMs?: number;
|
|
47
|
+
streakIdleMs?: number;
|
|
36
48
|
}
|
|
37
49
|
interface HttpFailConfig {
|
|
38
50
|
enabled?: boolean;
|
|
39
51
|
statusCodes?: number[];
|
|
40
52
|
ignoreUrls?: string[];
|
|
53
|
+
treatJsonErrorAsFail?: boolean;
|
|
41
54
|
}
|
|
42
55
|
interface RedirectLoopConfig {
|
|
43
56
|
enabled?: boolean;
|
package/dist/engine.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkX4ON6DOW_cjs=require('./chunk-X4ON6DOW.cjs');function s(o){if(o?.aborted)throw new Error("Aborted")}async function v(o){return await new Promise((t,e)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>e(new Error("Failed to load generated screenshot")),r.src=o;})}async function l(o,t){let{width:e,height:r}=await v(o);return {dataUrl:o,mime:t,width:e,height:r}}function U(o){return {async captureElement(t,e){if(!chunkX4ON6DOW_cjs.a())throw new Error("captureElement can only run in the browser");s(e.signal);let r={scale:e.pixelRatio},n=e.mime==="image/jpeg"?await o.domToJpeg(t,{...r,quality:e.quality??.92}):await o.domToPng(t,r);return s(e.signal),await l(n,e.mime)},async captureFullPage(t){if(!chunkX4ON6DOW_cjs.a())throw new Error("captureFullPage can only run in the browser");s(t.signal);let e=document.documentElement,r=Math.max(e.scrollWidth,e.clientWidth),n=Math.max(e.scrollHeight,e.clientHeight),i=Math.min(1,t.maxDimension/Math.max(r,n)),c={width:Math.max(1,Math.round(r*i)),height:Math.max(1,Math.round(n*i)),scale:t.pixelRatio},a=t.mime==="image/jpeg"?await o.domToJpeg(e,{...c,quality:t.quality??.92}):await o.domToPng(e,c);return s(t.signal),await l(a,t.mime)}}}function O(o){let[t,e]=o.split(",",2);if(!t||!e)throw new Error("Invalid data URL");let n=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(e),c=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)c[a]=i.charCodeAt(a);return new Blob([c],{type:n})}Object.defineProperty(exports,"clearClickEvents",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.j}});Object.defineProperty(exports,"clearDiagnostics",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.y}});Object.defineProperty(exports,"clearQueue",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.g}});Object.defineProperty(exports,"clearSecurityFindings",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.B}});Object.defineProperty(exports,"collectMetadata",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.d}});Object.defineProperty(exports,"createBlocFeedController",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.t}});Object.defineProperty(exports,"createHtmlToImageAdapter",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.b}});Object.defineProperty(exports,"dequeueAll",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.f}});Object.defineProperty(exports,"drainClickEvents",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.i}});Object.defineProperty(exports,"drainDiagnostics",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.x}});Object.defineProperty(exports,"enqueue",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.e}});Object.defineProperty(exports,"getMyFeedbackUrl",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.p}});Object.defineProperty(exports,"getQueueSize",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.h}});Object.defineProperty(exports,"getSecurityFindings",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.A}});Object.defineProperty(exports,"getViewerToken",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.o}});Object.defineProperty(exports,"installDiagnostics",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.v}});Object.defineProperty(exports,"isRecordingSupported",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.k}});Object.defineProperty(exports,"isVoiceSupported",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.m}});Object.defineProperty(exports,"runCapture",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.c}});Object.defineProperty(exports,"runSecretScan",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.z}});Object.defineProperty(exports,"startRecording",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.l}});Object.defineProperty(exports,"startVoiceRecording",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.n}});Object.defineProperty(exports,"transcribeAudio",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.q}});Object.defineProperty(exports,"uninstallDiagnostics",{enumerable:true,get:function(){return chunkX4ON6DOW_cjs.w}});exports.createModernScreenshotAdapter=U;exports.dataUrlToBlob=O;
|
package/dist/engine.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as ScreenshotAdapter, C as CaptureConfig, k as CaptureResult, V as VideoAsset, R as RecordingConfig, L as ClickEvent, K as VoiceConfig, o as MetadataConfig, p as MetadataContext, i as BlocFeedUser, n as FeedbackPayload, x as SecuritySnapshot, v as SecurityConfig } from './controller-
|
|
2
|
-
export { B as BlocFeedConfig, c as BlocFeedController, g as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, h as BlocFeedStrings, l as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, m as FeedbackApiResponse, F as FeedbackCategory, O as HoverListener, I as ImageAsset, N as NetworkEntry, q as Rect, s as ScreenshotAdapterOptions, t as ScreenshotIntent, u as ScreenshotMime, w as SecurityFinding, y as SessionPhase, Q as StateListener, S as SubmitResult, T as ThemeConfig, z as TransportConfig, G as TriggerStyle, H as VideoIntent, J as VideoMime, W as WidgetPosition, U as createBlocFeedController } from './controller-
|
|
1
|
+
import { r as ScreenshotAdapter, C as CaptureConfig, k as CaptureResult, V as VideoAsset, R as RecordingConfig, L as ClickEvent, K as VoiceConfig, o as MetadataConfig, p as MetadataContext, i as BlocFeedUser, n as FeedbackPayload, x as SecuritySnapshot, v as SecurityConfig } from './controller-DrQ--KwA.cjs';
|
|
2
|
+
export { B as BlocFeedConfig, c as BlocFeedController, g as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, h as BlocFeedStrings, l as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, m as FeedbackApiResponse, F as FeedbackCategory, O as HoverListener, I as ImageAsset, N as NetworkEntry, q as Rect, s as ScreenshotAdapterOptions, t as ScreenshotIntent, u as ScreenshotMime, w as SecurityFinding, y as SessionPhase, Q as StateListener, S as SubmitResult, T as ThemeConfig, z as TransportConfig, G as TriggerStyle, H as VideoIntent, J as VideoMime, W as WidgetPosition, U as createBlocFeedController } from './controller-DrQ--KwA.cjs';
|
|
3
3
|
|
|
4
4
|
declare function createHtmlToImageAdapter(): ScreenshotAdapter;
|
|
5
5
|
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as ScreenshotAdapter, C as CaptureConfig, k as CaptureResult, V as VideoAsset, R as RecordingConfig, L as ClickEvent, K as VoiceConfig, o as MetadataConfig, p as MetadataContext, i as BlocFeedUser, n as FeedbackPayload, x as SecuritySnapshot, v as SecurityConfig } from './controller-
|
|
2
|
-
export { B as BlocFeedConfig, c as BlocFeedController, g as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, h as BlocFeedStrings, l as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, m as FeedbackApiResponse, F as FeedbackCategory, O as HoverListener, I as ImageAsset, N as NetworkEntry, q as Rect, s as ScreenshotAdapterOptions, t as ScreenshotIntent, u as ScreenshotMime, w as SecurityFinding, y as SessionPhase, Q as StateListener, S as SubmitResult, T as ThemeConfig, z as TransportConfig, G as TriggerStyle, H as VideoIntent, J as VideoMime, W as WidgetPosition, U as createBlocFeedController } from './controller-
|
|
1
|
+
import { r as ScreenshotAdapter, C as CaptureConfig, k as CaptureResult, V as VideoAsset, R as RecordingConfig, L as ClickEvent, K as VoiceConfig, o as MetadataConfig, p as MetadataContext, i as BlocFeedUser, n as FeedbackPayload, x as SecuritySnapshot, v as SecurityConfig } from './controller-DrQ--KwA.js';
|
|
2
|
+
export { B as BlocFeedConfig, c as BlocFeedController, g as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, h as BlocFeedStrings, l as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, m as FeedbackApiResponse, F as FeedbackCategory, O as HoverListener, I as ImageAsset, N as NetworkEntry, q as Rect, s as ScreenshotAdapterOptions, t as ScreenshotIntent, u as ScreenshotMime, w as SecurityFinding, y as SessionPhase, Q as StateListener, S as SubmitResult, T as ThemeConfig, z as TransportConfig, G as TriggerStyle, H as VideoIntent, J as VideoMime, W as WidgetPosition, U as createBlocFeedController } from './controller-DrQ--KwA.js';
|
|
3
3
|
|
|
4
4
|
declare function createHtmlToImageAdapter(): ScreenshotAdapter;
|
|
5
5
|
|
package/dist/engine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-VWILLYYY.js';export{j as clearClickEvents,y as clearDiagnostics,g as clearQueue,B as clearSecurityFindings,d as collectMetadata,t as createBlocFeedController,b as createHtmlToImageAdapter,f as dequeueAll,i as drainClickEvents,x as drainDiagnostics,e as enqueue,p as getMyFeedbackUrl,h as getQueueSize,A as getSecurityFindings,o as getViewerToken,v as installDiagnostics,k as isRecordingSupported,m as isVoiceSupported,c as runCapture,z as runSecretScan,l as startRecording,n as startVoiceRecording,q as transcribeAudio,w as uninstallDiagnostics}from'./chunk-VWILLYYY.js';function s(o){if(o?.aborted)throw new Error("Aborted")}async function v(o){return await new Promise((t,e)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>e(new Error("Failed to load generated screenshot")),r.src=o;})}async function l(o,t){let{width:e,height:r}=await v(o);return {dataUrl:o,mime:t,width:e,height:r}}function U(o){return {async captureElement(t,e){if(!a())throw new Error("captureElement can only run in the browser");s(e.signal);let r={scale:e.pixelRatio},n=e.mime==="image/jpeg"?await o.domToJpeg(t,{...r,quality:e.quality??.92}):await o.domToPng(t,r);return s(e.signal),await l(n,e.mime)},async captureFullPage(t){if(!a())throw new Error("captureFullPage can only run in the browser");s(t.signal);let e=document.documentElement,r=Math.max(e.scrollWidth,e.clientWidth),n=Math.max(e.scrollHeight,e.clientHeight),i=Math.min(1,t.maxDimension/Math.max(r,n)),c={width:Math.max(1,Math.round(r*i)),height:Math.max(1,Math.round(n*i)),scale:t.pixelRatio},a$1=t.mime==="image/jpeg"?await o.domToJpeg(e,{...c,quality:t.quality??.92}):await o.domToPng(e,c);return s(t.signal),await l(a$1,t.mime)}}}function O(o){let[t,e]=o.split(",",2);if(!t||!e)throw new Error("Invalid data URL");let n=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(e),c=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)c[a]=i.charCodeAt(a);return new Blob([c],{type:n})}export{U as createModernScreenshotAdapter,O as dataUrlToBlob};
|