@checkflow/sdk 1.1.3 → 1.1.5
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/chunk-NRA75GGU.mjs +1737 -0
- package/dist/highlighter-D0FpwCSU.d.mts +18 -0
- package/dist/highlighter-D0FpwCSU.d.ts +18 -0
- package/dist/{chunk-CD33QAA6.mjs → highlighter-EMSU6IYQ.mjs} +2 -3
- package/dist/index.d.mts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.js +1578 -370
- package/dist/index.mjs +56 -504
- package/dist/react.d.mts +48 -2
- package/dist/react.d.ts +48 -2
- package/dist/react.js +1568 -217
- package/dist/react.mjs +33 -2
- package/dist/types-fCeePy5c.d.mts +101 -0
- package/dist/types-fCeePy5c.d.ts +101 -0
- package/dist/vue.d.mts +2 -1
- package/dist/vue.d.ts +2 -1
- package/dist/vue.js +1532 -216
- package/dist/vue.mjs +1 -1
- package/dist/widget-LD24NDDL.mjs +10 -0
- package/package.json +1 -1
- package/dist/highlighter-Dx2zURb6.d.mts +0 -73
- package/dist/highlighter-Dx2zURb6.d.ts +0 -73
- package/dist/highlighter-W4XDALRE.mjs +0 -8
package/dist/react.mjs
CHANGED
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
// src/react.ts
|
|
2
2
|
var _initialized = false;
|
|
3
|
+
var _config = null;
|
|
3
4
|
function useCheckflowInit(config) {
|
|
4
5
|
if (typeof window === "undefined") return;
|
|
5
6
|
if (_initialized) return;
|
|
6
7
|
_initialized = true;
|
|
8
|
+
_config = config;
|
|
7
9
|
import("./index.mjs").then(({ init }) => {
|
|
8
10
|
init(config);
|
|
9
11
|
});
|
|
10
12
|
}
|
|
13
|
+
async function setUser(user) {
|
|
14
|
+
if (typeof window === "undefined") return;
|
|
15
|
+
const { setUser: sdkSetUser } = await import("./index.mjs");
|
|
16
|
+
sdkSetUser(user);
|
|
17
|
+
}
|
|
18
|
+
async function clearUser() {
|
|
19
|
+
if (typeof window === "undefined") return;
|
|
20
|
+
const { clearUser: sdkClearUser } = await import("./index.mjs");
|
|
21
|
+
sdkClearUser();
|
|
22
|
+
}
|
|
23
|
+
async function openFeedbackModal() {
|
|
24
|
+
if (typeof window === "undefined") return;
|
|
25
|
+
const { openFeedbackModal: sdkOpenModal } = await import("./index.mjs");
|
|
26
|
+
sdkOpenModal();
|
|
27
|
+
}
|
|
11
28
|
function useCheckflowFeedback() {
|
|
12
29
|
return {
|
|
13
30
|
send: async (data) => {
|
|
@@ -22,7 +39,7 @@ function useCheckflowFeedback() {
|
|
|
22
39
|
},
|
|
23
40
|
highlight: async () => {
|
|
24
41
|
if (typeof window === "undefined") return [];
|
|
25
|
-
const { startHighlighting } = await import("./highlighter-
|
|
42
|
+
const { startHighlighting } = await import("./highlighter-EMSU6IYQ.mjs");
|
|
26
43
|
return startHighlighting();
|
|
27
44
|
},
|
|
28
45
|
show: async () => {
|
|
@@ -34,7 +51,10 @@ function useCheckflowFeedback() {
|
|
|
34
51
|
if (typeof window === "undefined") return;
|
|
35
52
|
const { hideWidget } = await import("./index.mjs");
|
|
36
53
|
hideWidget();
|
|
37
|
-
}
|
|
54
|
+
},
|
|
55
|
+
openModal: openFeedbackModal,
|
|
56
|
+
setUser,
|
|
57
|
+
clearUser
|
|
38
58
|
};
|
|
39
59
|
}
|
|
40
60
|
function destroyCheckflow() {
|
|
@@ -42,10 +62,21 @@ function destroyCheckflow() {
|
|
|
42
62
|
import("./index.mjs").then(({ destroy }) => {
|
|
43
63
|
destroy();
|
|
44
64
|
_initialized = false;
|
|
65
|
+
_config = null;
|
|
45
66
|
});
|
|
46
67
|
}
|
|
68
|
+
function getFeedbackButtonHandler(onClick) {
|
|
69
|
+
return () => {
|
|
70
|
+
onClick?.();
|
|
71
|
+
openFeedbackModal();
|
|
72
|
+
};
|
|
73
|
+
}
|
|
47
74
|
export {
|
|
75
|
+
clearUser,
|
|
48
76
|
destroyCheckflow,
|
|
77
|
+
getFeedbackButtonHandler,
|
|
78
|
+
openFeedbackModal,
|
|
79
|
+
setUser,
|
|
49
80
|
useCheckflowFeedback,
|
|
50
81
|
useCheckflowInit
|
|
51
82
|
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
interface UserProfile {
|
|
2
|
+
name?: string;
|
|
3
|
+
email?: string;
|
|
4
|
+
avatar?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ButtonConfig {
|
|
8
|
+
/** Button text (default: 'Report Bug') */
|
|
9
|
+
text?: string;
|
|
10
|
+
/** Background color */
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
/** Text color */
|
|
13
|
+
textColor?: string;
|
|
14
|
+
/** Border radius (e.g., '8px', '50px', '0') */
|
|
15
|
+
borderRadius?: string;
|
|
16
|
+
/** Padding (e.g., '10px 20px') */
|
|
17
|
+
padding?: string;
|
|
18
|
+
/** Font size (e.g., '14px') */
|
|
19
|
+
fontSize?: string;
|
|
20
|
+
/** Font weight (e.g., '500', 'bold') */
|
|
21
|
+
fontWeight?: string;
|
|
22
|
+
/** Border (e.g., '1px solid #ccc', 'none') */
|
|
23
|
+
border?: string;
|
|
24
|
+
/** Box shadow */
|
|
25
|
+
boxShadow?: string;
|
|
26
|
+
/** Custom CSS class to apply */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Show icon (default: true) */
|
|
29
|
+
showIcon?: boolean;
|
|
30
|
+
/** Size preset: 'xs' | 'sm' | 'default' | 'lg' */
|
|
31
|
+
size?: 'xs' | 'sm' | 'default' | 'lg';
|
|
32
|
+
/** Variant preset: 'default' | 'outline' | 'ghost' | 'link' */
|
|
33
|
+
variant?: 'default' | 'outline' | 'ghost' | 'link';
|
|
34
|
+
}
|
|
35
|
+
interface CheckflowConfig {
|
|
36
|
+
apiKey: string;
|
|
37
|
+
endpoint?: string;
|
|
38
|
+
projectId?: string;
|
|
39
|
+
environment?: string;
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
widget?: WidgetConfig;
|
|
42
|
+
/** User profile to pre-fill reporter info (hides name/email fields if provided) */
|
|
43
|
+
user?: UserProfile;
|
|
44
|
+
/** Auto-load html2canvas for screenshot support (default: true) */
|
|
45
|
+
enableScreenshots?: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface WidgetConfig {
|
|
48
|
+
/** @deprecated Use button.text instead */
|
|
49
|
+
text?: string;
|
|
50
|
+
/** @deprecated Use button.backgroundColor instead */
|
|
51
|
+
color?: string;
|
|
52
|
+
/** Button customization options */
|
|
53
|
+
button?: ButtonConfig;
|
|
54
|
+
/** Show floating button on init (default: true). Set to false for manual trigger only. */
|
|
55
|
+
showOnInit?: boolean;
|
|
56
|
+
/** @deprecated Position is now controlled by where you place the button */
|
|
57
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'center';
|
|
58
|
+
}
|
|
59
|
+
interface FeedbackPayload {
|
|
60
|
+
title: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
type?: 'BUG' | 'FEATURE' | 'IMPROVEMENT' | 'QUESTION';
|
|
63
|
+
priority?: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
64
|
+
url?: string;
|
|
65
|
+
environment?: string;
|
|
66
|
+
viewport?: {
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
device: string;
|
|
70
|
+
};
|
|
71
|
+
/** User ID from injected profile */
|
|
72
|
+
user_id?: string;
|
|
73
|
+
/** User avatar URL from injected profile */
|
|
74
|
+
user_avatar?: string;
|
|
75
|
+
user_agent?: string;
|
|
76
|
+
browser?: string;
|
|
77
|
+
os?: string;
|
|
78
|
+
locale?: string;
|
|
79
|
+
timezone?: string;
|
|
80
|
+
console_logs?: any[];
|
|
81
|
+
network_logs?: any[];
|
|
82
|
+
performance_metrics?: Record<string, number>;
|
|
83
|
+
javascript_errors?: any[];
|
|
84
|
+
screenshot_url?: string;
|
|
85
|
+
sdk_version?: string;
|
|
86
|
+
reporter_name?: string;
|
|
87
|
+
reporter_email?: string;
|
|
88
|
+
}
|
|
89
|
+
interface FeedbackResponse {
|
|
90
|
+
success: boolean;
|
|
91
|
+
data?: {
|
|
92
|
+
id: string;
|
|
93
|
+
short_id: string;
|
|
94
|
+
};
|
|
95
|
+
error?: {
|
|
96
|
+
message: string;
|
|
97
|
+
code: string;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type { ButtonConfig as B, CheckflowConfig as C, FeedbackPayload as F, UserProfile as U, WidgetConfig as W, FeedbackResponse as a };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
interface UserProfile {
|
|
2
|
+
name?: string;
|
|
3
|
+
email?: string;
|
|
4
|
+
avatar?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ButtonConfig {
|
|
8
|
+
/** Button text (default: 'Report Bug') */
|
|
9
|
+
text?: string;
|
|
10
|
+
/** Background color */
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
/** Text color */
|
|
13
|
+
textColor?: string;
|
|
14
|
+
/** Border radius (e.g., '8px', '50px', '0') */
|
|
15
|
+
borderRadius?: string;
|
|
16
|
+
/** Padding (e.g., '10px 20px') */
|
|
17
|
+
padding?: string;
|
|
18
|
+
/** Font size (e.g., '14px') */
|
|
19
|
+
fontSize?: string;
|
|
20
|
+
/** Font weight (e.g., '500', 'bold') */
|
|
21
|
+
fontWeight?: string;
|
|
22
|
+
/** Border (e.g., '1px solid #ccc', 'none') */
|
|
23
|
+
border?: string;
|
|
24
|
+
/** Box shadow */
|
|
25
|
+
boxShadow?: string;
|
|
26
|
+
/** Custom CSS class to apply */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Show icon (default: true) */
|
|
29
|
+
showIcon?: boolean;
|
|
30
|
+
/** Size preset: 'xs' | 'sm' | 'default' | 'lg' */
|
|
31
|
+
size?: 'xs' | 'sm' | 'default' | 'lg';
|
|
32
|
+
/** Variant preset: 'default' | 'outline' | 'ghost' | 'link' */
|
|
33
|
+
variant?: 'default' | 'outline' | 'ghost' | 'link';
|
|
34
|
+
}
|
|
35
|
+
interface CheckflowConfig {
|
|
36
|
+
apiKey: string;
|
|
37
|
+
endpoint?: string;
|
|
38
|
+
projectId?: string;
|
|
39
|
+
environment?: string;
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
widget?: WidgetConfig;
|
|
42
|
+
/** User profile to pre-fill reporter info (hides name/email fields if provided) */
|
|
43
|
+
user?: UserProfile;
|
|
44
|
+
/** Auto-load html2canvas for screenshot support (default: true) */
|
|
45
|
+
enableScreenshots?: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface WidgetConfig {
|
|
48
|
+
/** @deprecated Use button.text instead */
|
|
49
|
+
text?: string;
|
|
50
|
+
/** @deprecated Use button.backgroundColor instead */
|
|
51
|
+
color?: string;
|
|
52
|
+
/** Button customization options */
|
|
53
|
+
button?: ButtonConfig;
|
|
54
|
+
/** Show floating button on init (default: true). Set to false for manual trigger only. */
|
|
55
|
+
showOnInit?: boolean;
|
|
56
|
+
/** @deprecated Position is now controlled by where you place the button */
|
|
57
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'center';
|
|
58
|
+
}
|
|
59
|
+
interface FeedbackPayload {
|
|
60
|
+
title: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
type?: 'BUG' | 'FEATURE' | 'IMPROVEMENT' | 'QUESTION';
|
|
63
|
+
priority?: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
64
|
+
url?: string;
|
|
65
|
+
environment?: string;
|
|
66
|
+
viewport?: {
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
device: string;
|
|
70
|
+
};
|
|
71
|
+
/** User ID from injected profile */
|
|
72
|
+
user_id?: string;
|
|
73
|
+
/** User avatar URL from injected profile */
|
|
74
|
+
user_avatar?: string;
|
|
75
|
+
user_agent?: string;
|
|
76
|
+
browser?: string;
|
|
77
|
+
os?: string;
|
|
78
|
+
locale?: string;
|
|
79
|
+
timezone?: string;
|
|
80
|
+
console_logs?: any[];
|
|
81
|
+
network_logs?: any[];
|
|
82
|
+
performance_metrics?: Record<string, number>;
|
|
83
|
+
javascript_errors?: any[];
|
|
84
|
+
screenshot_url?: string;
|
|
85
|
+
sdk_version?: string;
|
|
86
|
+
reporter_name?: string;
|
|
87
|
+
reporter_email?: string;
|
|
88
|
+
}
|
|
89
|
+
interface FeedbackResponse {
|
|
90
|
+
success: boolean;
|
|
91
|
+
data?: {
|
|
92
|
+
id: string;
|
|
93
|
+
short_id: string;
|
|
94
|
+
};
|
|
95
|
+
error?: {
|
|
96
|
+
message: string;
|
|
97
|
+
code: string;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type { ButtonConfig as B, CheckflowConfig as C, FeedbackPayload as F, UserProfile as U, WidgetConfig as W, FeedbackResponse as a };
|
package/dist/vue.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as HighlightAnnotation } from './highlighter-D0FpwCSU.mjs';
|
|
2
|
+
import { C as CheckflowConfig, a as FeedbackResponse } from './types-fCeePy5c.mjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Vue 3 plugin factory.
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as HighlightAnnotation } from './highlighter-D0FpwCSU.js';
|
|
2
|
+
import { C as CheckflowConfig, a as FeedbackResponse } from './types-fCeePy5c.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Vue 3 plugin factory.
|