feedbackkit-web 1.0.47 → 1.0.49
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/feedbackkit.iife.js +10 -10
- package/dist/feedbackkit.iife.js.map +1 -1
- package/dist/feedbackkit.js +113 -23
- package/dist/feedbackkit.js.map +1 -1
- package/dist/types/global.d.ts +1 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/types.d.ts +20 -2
- package/dist/types/ui/widget.d.ts +19 -0
- package/package.json +1 -1
package/dist/types/global.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare const _default: {
|
|
|
3
3
|
currentScreen: string | null;
|
|
4
4
|
theme: import("./types").FeedbackTheme | null;
|
|
5
5
|
captureOptions: import("./types").CaptureOptions;
|
|
6
|
+
includeScreenshot: boolean;
|
|
6
7
|
DEFAULT_ENDPOINT: string;
|
|
7
8
|
configure(config: import("./types").FeedbackKitConfiguration | null): void;
|
|
8
9
|
readonly isConfigured: boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,12 +12,26 @@ export { drawAnnotation, drawAnnotations, hitTest, readPoint, textBubbleRect, ST
|
|
|
12
12
|
export interface PresentOptions {
|
|
13
13
|
/** Called with the finished report when the user taps Send. */
|
|
14
14
|
onReport?: (report: FeedbackReport) => void | Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to capture and include a screenshot for this report.
|
|
17
|
+
* Set to `false` to open the feedback dialog without a screenshot.
|
|
18
|
+
*/
|
|
19
|
+
captureScreenshot?: boolean;
|
|
20
|
+
/** Alias for `captureScreenshot`. */
|
|
21
|
+
includeScreenshot?: boolean;
|
|
15
22
|
}
|
|
16
23
|
export interface PresentAndSubmitOptions {
|
|
17
24
|
/** Called after the report has been accepted by the ingestion endpoint. */
|
|
18
25
|
onSubmitted?: (report: FeedbackReport) => void;
|
|
19
26
|
/** Called when a submit attempt fails (the dialog stays open for a retry). */
|
|
20
27
|
onError?: (error: unknown) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Whether to capture and include a screenshot for this report.
|
|
30
|
+
* Set to `false` to open the feedback dialog without a screenshot.
|
|
31
|
+
*/
|
|
32
|
+
captureScreenshot?: boolean;
|
|
33
|
+
/** Alias for `captureScreenshot`. */
|
|
34
|
+
includeScreenshot?: boolean;
|
|
21
35
|
}
|
|
22
36
|
export interface ShortcutOptions {
|
|
23
37
|
/** Key to combine with ⌘ (macOS) / Ctrl (elsewhere) + Shift. Default "F" — e.g. ⌘⇧F. */
|
|
@@ -39,6 +53,8 @@ export declare const FeedbackKit: {
|
|
|
39
53
|
theme: FeedbackTheme | null;
|
|
40
54
|
/** Screenshot capture settings. See `CaptureOptions`. */
|
|
41
55
|
captureOptions: CaptureOptions;
|
|
56
|
+
/** Whether screenshots should be captured and included in reports by default. Default `true`. */
|
|
57
|
+
includeScreenshot: boolean;
|
|
42
58
|
/** The hosted dashboard's ingestion endpoint, used when `configure` gets no `endpoint`. */
|
|
43
59
|
DEFAULT_ENDPOINT: string;
|
|
44
60
|
/**
|
package/dist/types/types.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ export interface FeedbackTheme {
|
|
|
120
120
|
/** Cancel and attach buttons. */
|
|
121
121
|
secondaryColorHex?: string;
|
|
122
122
|
}
|
|
123
|
-
export type CaptureMode = "dom" | "display";
|
|
123
|
+
export type CaptureMode = "dom" | "display" | "off";
|
|
124
124
|
export interface FeedbackKitConfiguration {
|
|
125
125
|
/** The project key from the dashboard's project settings. A routing key, not a secret. */
|
|
126
126
|
projectKey: string;
|
|
@@ -142,6 +142,15 @@ export interface FeedbackKitConfiguration {
|
|
|
142
142
|
* report). Default `true`; pass options to tune, or `false` to disable.
|
|
143
143
|
*/
|
|
144
144
|
captureLogs?: boolean | LogCaptureOptions;
|
|
145
|
+
/**
|
|
146
|
+
* Screenshot capture settings, or `false` to disable screenshot capture entirely.
|
|
147
|
+
* Default `true`. Set to `false` or pass options with `enabled: false` to omit screenshots.
|
|
148
|
+
*/
|
|
149
|
+
captureScreenshot?: boolean | CaptureOptions;
|
|
150
|
+
/**
|
|
151
|
+
* Alias for `captureScreenshot: false` — omit screenshot capture.
|
|
152
|
+
*/
|
|
153
|
+
includeScreenshot?: boolean;
|
|
145
154
|
/**
|
|
146
155
|
* Where fix updates for this browser's reports come from (the
|
|
147
156
|
* `reporter-updates` function). Defaults to the sibling of `endpoint`.
|
|
@@ -187,11 +196,20 @@ export interface FixUpdate {
|
|
|
187
196
|
}[];
|
|
188
197
|
}
|
|
189
198
|
export interface CaptureOptions {
|
|
199
|
+
/**
|
|
200
|
+
* Whether screenshot capture is enabled. Default `true`.
|
|
201
|
+
* Set to `false` (or set `mode: "off"`) to omit screenshots from reports.
|
|
202
|
+
*/
|
|
203
|
+
enabled?: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Alias for `enabled: false` when set to `false`.
|
|
206
|
+
*/
|
|
207
|
+
includeScreenshot?: boolean;
|
|
190
208
|
/**
|
|
191
209
|
* `"dom"` (default): re-render the page into an image — silent, no
|
|
192
210
|
* permission prompt. `"display"`: the browser's Screen Capture API —
|
|
193
211
|
* pixel-exact but shows a picker every time; falls back to `"dom"` where
|
|
194
|
-
* unsupported or declined.
|
|
212
|
+
* unsupported or declined. `"off"`: do not capture a screenshot.
|
|
195
213
|
*/
|
|
196
214
|
mode?: CaptureMode;
|
|
197
215
|
/** Upper bound on the capture's pixel ratio, to keep uploads small on dense displays. Default 2. */
|
|
@@ -7,6 +7,7 @@ export interface WidgetDeps {
|
|
|
7
7
|
defaultProductKey(): string | undefined;
|
|
8
8
|
logs(): FeedbackLogEntry[];
|
|
9
9
|
captureOptions(): CaptureOptions;
|
|
10
|
+
includeScreenshot?(): boolean;
|
|
10
11
|
currentScreen(): string | null;
|
|
11
12
|
/** Reporter identity attached to submitted reports (fixes.ts). */
|
|
12
13
|
identity(): {
|
|
@@ -29,6 +30,10 @@ export interface OpenOptions {
|
|
|
29
30
|
deliver?: (report: FeedbackReport) => Promise<void>;
|
|
30
31
|
/** Dialog wording overrides (e.g. "What's still wrong?" for a reopen). */
|
|
31
32
|
copy?: DialogCopy;
|
|
33
|
+
/** Whether to capture a screenshot for this report. Overrides global settings. */
|
|
34
|
+
captureScreenshot?: boolean;
|
|
35
|
+
/** Alias for `captureScreenshot`. */
|
|
36
|
+
includeScreenshot?: boolean;
|
|
32
37
|
}
|
|
33
38
|
export interface DialogCopy {
|
|
34
39
|
title?: string;
|
|
@@ -43,6 +48,19 @@ export interface TriggerOptions {
|
|
|
43
48
|
label?: string;
|
|
44
49
|
/** Icon-only round button. */
|
|
45
50
|
compact?: boolean;
|
|
51
|
+
/** Whether to capture a screenshot when triggered. */
|
|
52
|
+
captureScreenshot?: boolean;
|
|
53
|
+
/** Alias for `captureScreenshot`. */
|
|
54
|
+
includeScreenshot?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Keyboard shortcut to trigger feedback (defaults to true: ⌘⇧F on macOS, Ctrl+Shift+F elsewhere).
|
|
57
|
+
* Pass options to customize the key, or false to disable.
|
|
58
|
+
*/
|
|
59
|
+
keyboardShortcut?: boolean | {
|
|
60
|
+
key?: string;
|
|
61
|
+
};
|
|
62
|
+
/** Alias for `keyboardShortcut`. */
|
|
63
|
+
enableKeyboardShortcut?: boolean;
|
|
46
64
|
}
|
|
47
65
|
/**
|
|
48
66
|
* Owns the widget's Shadow DOM host: the floating trigger button and the
|
|
@@ -72,6 +90,7 @@ export declare class Widget {
|
|
|
72
90
|
open(options: OpenOptions): Promise<FeedbackReport | null>;
|
|
73
91
|
private mount;
|
|
74
92
|
private applyTheme;
|
|
93
|
+
private shouldCaptureScreenshot;
|
|
75
94
|
private run;
|
|
76
95
|
}
|
|
77
96
|
export declare function uuid(): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feedbackkit-web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
4
4
|
"description": "Drop-in in-app feedback for websites: capture a screenshot, annotate it, describe the problem, and get a structured FeedbackKit report.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/feedbackkit.js",
|