@rafaelbarross/feedback-widget 0.1.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/dist/chunk-DDAAVRWG.js +26 -0
- package/dist/chunk-DDAAVRWG.js.map +1 -0
- package/dist/chunk-FJBZBVPE.mjs +23 -0
- package/dist/chunk-FJBZBVPE.mjs.map +1 -0
- package/dist/index.d.mts +42 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +1078 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1072 -0
- package/dist/index.mjs.map +1 -0
- package/dist/next/index.d.mts +21 -0
- package/dist/next/index.d.ts +21 -0
- package/dist/next/index.js +78 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/index.mjs +76 -0
- package/dist/next/index.mjs.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
+
|
|
23
|
+
exports.__spreadProps = __spreadProps;
|
|
24
|
+
exports.__spreadValues = __spreadValues;
|
|
25
|
+
//# sourceMappingURL=chunk-DDAAVRWG.js.map
|
|
26
|
+
//# sourceMappingURL=chunk-DDAAVRWG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-DDAAVRWG.js"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
21
|
+
export { __spreadProps, __spreadValues };
|
|
22
|
+
//# sourceMappingURL=chunk-FJBZBVPE.mjs.map
|
|
23
|
+
//# sourceMappingURL=chunk-FJBZBVPE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-FJBZBVPE.mjs"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface FeedbackPayload {
|
|
4
|
+
screenshot: Blob;
|
|
5
|
+
summary: string;
|
|
6
|
+
description: string;
|
|
7
|
+
pageUrl: string;
|
|
8
|
+
pageTitle: string;
|
|
9
|
+
}
|
|
10
|
+
interface FeedbackWidgetProps {
|
|
11
|
+
/**
|
|
12
|
+
* Direct Jira mode — token is passed client-side.
|
|
13
|
+
* Acceptable for internal/dev tools. For production, use `onSubmit` instead.
|
|
14
|
+
*/
|
|
15
|
+
jiraHost?: string;
|
|
16
|
+
jiraProjectKey?: string;
|
|
17
|
+
jiraToken?: string;
|
|
18
|
+
jiraUserEmail?: string;
|
|
19
|
+
jiraIssueType?: string;
|
|
20
|
+
jiraLabels?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Proxy mode — call your own backend endpoint.
|
|
23
|
+
* Recommended for production to avoid exposing the Jira token client-side.
|
|
24
|
+
*/
|
|
25
|
+
onSubmit?: (payload: FeedbackPayload) => Promise<{
|
|
26
|
+
issueKey?: string;
|
|
27
|
+
issueUrl?: string;
|
|
28
|
+
} | void>;
|
|
29
|
+
/** Shorthand for Next.js — pass the route path and skip writing onSubmit entirely */
|
|
30
|
+
apiRoute?: string;
|
|
31
|
+
position?: 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
32
|
+
buttonLabel?: string;
|
|
33
|
+
onSuccess?: (result: {
|
|
34
|
+
issueKey?: string;
|
|
35
|
+
issueUrl?: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
onError?: (error: Error) => void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare function FeedbackWidget({ jiraHost, jiraProjectKey, jiraToken, jiraUserEmail, jiraIssueType, jiraLabels, onSubmit: onSubmitProp, apiRoute, position, buttonLabel, onSuccess, onError, }: FeedbackWidgetProps): React.ReactPortal | null;
|
|
41
|
+
|
|
42
|
+
export { type FeedbackPayload, FeedbackWidget, type FeedbackWidgetProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface FeedbackPayload {
|
|
4
|
+
screenshot: Blob;
|
|
5
|
+
summary: string;
|
|
6
|
+
description: string;
|
|
7
|
+
pageUrl: string;
|
|
8
|
+
pageTitle: string;
|
|
9
|
+
}
|
|
10
|
+
interface FeedbackWidgetProps {
|
|
11
|
+
/**
|
|
12
|
+
* Direct Jira mode — token is passed client-side.
|
|
13
|
+
* Acceptable for internal/dev tools. For production, use `onSubmit` instead.
|
|
14
|
+
*/
|
|
15
|
+
jiraHost?: string;
|
|
16
|
+
jiraProjectKey?: string;
|
|
17
|
+
jiraToken?: string;
|
|
18
|
+
jiraUserEmail?: string;
|
|
19
|
+
jiraIssueType?: string;
|
|
20
|
+
jiraLabels?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Proxy mode — call your own backend endpoint.
|
|
23
|
+
* Recommended for production to avoid exposing the Jira token client-side.
|
|
24
|
+
*/
|
|
25
|
+
onSubmit?: (payload: FeedbackPayload) => Promise<{
|
|
26
|
+
issueKey?: string;
|
|
27
|
+
issueUrl?: string;
|
|
28
|
+
} | void>;
|
|
29
|
+
/** Shorthand for Next.js — pass the route path and skip writing onSubmit entirely */
|
|
30
|
+
apiRoute?: string;
|
|
31
|
+
position?: 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
32
|
+
buttonLabel?: string;
|
|
33
|
+
onSuccess?: (result: {
|
|
34
|
+
issueKey?: string;
|
|
35
|
+
issueUrl?: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
onError?: (error: Error) => void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare function FeedbackWidget({ jiraHost, jiraProjectKey, jiraToken, jiraUserEmail, jiraIssueType, jiraLabels, onSubmit: onSubmitProp, apiRoute, position, buttonLabel, onSuccess, onError, }: FeedbackWidgetProps): React.ReactPortal | null;
|
|
41
|
+
|
|
42
|
+
export { type FeedbackPayload, FeedbackWidget, type FeedbackWidgetProps };
|