@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.d.ts
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as HighlightAnnotation } from './highlighter-D0FpwCSU.js';
|
|
2
|
+
import { B as ButtonConfig, U as UserProfile, a as FeedbackResponse, C as CheckflowConfig } from './types-fCeePy5c.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Initialize Checkflow in a React/Next.js app.
|
|
5
6
|
* Call this in your root layout or _app file.
|
|
7
|
+
*
|
|
8
|
+
* @param config - SDK configuration including apiKey, user profile, and widget options
|
|
6
9
|
*/
|
|
7
10
|
declare function useCheckflowInit(config: CheckflowConfig): void;
|
|
11
|
+
/**
|
|
12
|
+
* Update the user profile after initialization.
|
|
13
|
+
* Useful when user logs in/out.
|
|
14
|
+
*/
|
|
15
|
+
declare function setUser(user: UserProfile | undefined): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Clear the user profile.
|
|
18
|
+
*/
|
|
19
|
+
declare function clearUser(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Open the feedback modal programmatically.
|
|
22
|
+
* Use this when you want to trigger the modal from a custom button.
|
|
23
|
+
*/
|
|
24
|
+
declare function openFeedbackModal(): Promise<void>;
|
|
8
25
|
/**
|
|
9
26
|
* Hook to send feedback programmatically from React components.
|
|
10
27
|
*/
|
|
@@ -19,10 +36,39 @@ declare function useCheckflowFeedback(): {
|
|
|
19
36
|
highlight: () => Promise<HighlightAnnotation[]>;
|
|
20
37
|
show: () => Promise<void>;
|
|
21
38
|
hide: () => Promise<void>;
|
|
39
|
+
openModal: typeof openFeedbackModal;
|
|
40
|
+
setUser: typeof setUser;
|
|
41
|
+
clearUser: typeof clearUser;
|
|
22
42
|
};
|
|
23
43
|
/**
|
|
24
44
|
* Cleanup function for React useEffect.
|
|
25
45
|
*/
|
|
26
46
|
declare function destroyCheckflow(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Props for the FeedbackButton component.
|
|
49
|
+
* All button styling can be customized via className, style, or button config.
|
|
50
|
+
*/
|
|
51
|
+
interface FeedbackButtonProps {
|
|
52
|
+
/** Button text content */
|
|
53
|
+
children?: string;
|
|
54
|
+
/** Custom CSS class */
|
|
55
|
+
className?: string;
|
|
56
|
+
/** Inline styles */
|
|
57
|
+
style?: Record<string, string | number>;
|
|
58
|
+
/** Button configuration for SDK styling */
|
|
59
|
+
buttonConfig?: ButtonConfig;
|
|
60
|
+
/** Click handler (called before opening modal) */
|
|
61
|
+
onClick?: () => void;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get the onClick handler for a feedback button.
|
|
65
|
+
* Use this to create your own custom button that opens the feedback modal.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <button onClick={getFeedbackButtonHandler()}>Report Bug</button>
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
declare function getFeedbackButtonHandler(onClick?: () => void): () => void;
|
|
27
73
|
|
|
28
|
-
export { destroyCheckflow, useCheckflowFeedback, useCheckflowInit };
|
|
74
|
+
export { type FeedbackButtonProps, clearUser, destroyCheckflow, getFeedbackButtonHandler, openFeedbackModal, setUser, useCheckflowFeedback, useCheckflowInit };
|