@matija2209/payload-plugin-admin-feedback 1.0.0 → 1.0.4
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 +29 -0
- package/README.md +108 -59
- package/dist/client/index.cjs +1638 -0
- package/dist/client/index.d.cts +64 -0
- package/dist/client/index.d.ts +64 -0
- package/dist/client/index.js +1630 -0
- package/dist/index.cjs +580 -0
- package/dist/index.d.cts +60 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +576 -0
- package/package.json +28 -4
- package/public/payload-admin-plugin-header.png +0 -0
- package/src/client/AdminFeedbackWidget.tsx +0 -63
- package/src/client/FeedbackWidget.tsx +0 -1438
- package/src/client/FrontendFeedbackWidget.tsx +0 -100
- package/src/client/index.ts +0 -4
- package/src/client/routeMatcher.ts +0 -18
- package/src/collections/AdminFeedback.ts +0 -325
- package/src/index.ts +0 -108
- package/src/server/sendFeedbackEmail.ts +0 -141
- package/src/types.ts +0 -73
- package/tsconfig.build.json +0 -14
- package/tsconfig.json +0 -19
- package/tsup.config.ts +0 -29
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type CapturePolicy = 'current-tab-first' | 'strict-current-tab' | 'any-surface';
|
|
4
|
+
type SubmitPayload = {
|
|
5
|
+
message: string;
|
|
6
|
+
pagePath: string;
|
|
7
|
+
selector?: string;
|
|
8
|
+
selectedText?: string;
|
|
9
|
+
screenshotId?: number | null;
|
|
10
|
+
meta?: {
|
|
11
|
+
userAgent?: string;
|
|
12
|
+
locale?: string;
|
|
13
|
+
viewport?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
type SubmitResult = {
|
|
17
|
+
success: true;
|
|
18
|
+
} | {
|
|
19
|
+
success: false;
|
|
20
|
+
error: string;
|
|
21
|
+
};
|
|
22
|
+
type UploadResult = {
|
|
23
|
+
success: true;
|
|
24
|
+
mediaId: number;
|
|
25
|
+
} | {
|
|
26
|
+
success: false;
|
|
27
|
+
error: string;
|
|
28
|
+
};
|
|
29
|
+
type DeleteResult = {
|
|
30
|
+
success: true;
|
|
31
|
+
} | {
|
|
32
|
+
success: false;
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
type FeedbackWidgetProps = {
|
|
36
|
+
title?: string;
|
|
37
|
+
submitLabel?: string;
|
|
38
|
+
uploadLabel?: string;
|
|
39
|
+
allowScreenshotUpload?: boolean;
|
|
40
|
+
screenshotMaxFileSizeBytes?: number;
|
|
41
|
+
screenshotAllowedMimeTypes?: string[];
|
|
42
|
+
capturePolicy?: CapturePolicy;
|
|
43
|
+
onSubmit: (payload: SubmitPayload) => Promise<SubmitResult>;
|
|
44
|
+
onUpload?: (formData: FormData) => Promise<UploadResult>;
|
|
45
|
+
onDeleteScreenshot?: (mediaId: number) => Promise<DeleteResult>;
|
|
46
|
+
};
|
|
47
|
+
declare function FeedbackWidget({ title, submitLabel, uploadLabel, allowScreenshotUpload, screenshotMaxFileSizeBytes, screenshotAllowedMimeTypes, capturePolicy, onSubmit, onUpload, onDeleteScreenshot, }: FeedbackWidgetProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
49
|
+
declare function AdminFeedbackWidget(): react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
type FrontendFeedbackWidgetProps = {
|
|
52
|
+
include: string[];
|
|
53
|
+
locales?: string[];
|
|
54
|
+
title?: string;
|
|
55
|
+
submitLabel?: string;
|
|
56
|
+
uploadLabel?: string;
|
|
57
|
+
/** URL markers (`pisarna`, `narocilnica`, …) — tenant slug is the segment before the marker. */
|
|
58
|
+
tenantPathMarkers?: string[];
|
|
59
|
+
/** FormData key for tenant slug on upload (default `tenant`). */
|
|
60
|
+
tenantFormDataKey?: string;
|
|
61
|
+
};
|
|
62
|
+
declare function FrontendFeedbackWidget({ include, locales, title, submitLabel, uploadLabel, tenantPathMarkers, tenantFormDataKey, }: FrontendFeedbackWidgetProps): react_jsx_runtime.JSX.Element | null;
|
|
63
|
+
|
|
64
|
+
export { AdminFeedbackWidget, FeedbackWidget, FrontendFeedbackWidget };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type CapturePolicy = 'current-tab-first' | 'strict-current-tab' | 'any-surface';
|
|
4
|
+
type SubmitPayload = {
|
|
5
|
+
message: string;
|
|
6
|
+
pagePath: string;
|
|
7
|
+
selector?: string;
|
|
8
|
+
selectedText?: string;
|
|
9
|
+
screenshotId?: number | null;
|
|
10
|
+
meta?: {
|
|
11
|
+
userAgent?: string;
|
|
12
|
+
locale?: string;
|
|
13
|
+
viewport?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
type SubmitResult = {
|
|
17
|
+
success: true;
|
|
18
|
+
} | {
|
|
19
|
+
success: false;
|
|
20
|
+
error: string;
|
|
21
|
+
};
|
|
22
|
+
type UploadResult = {
|
|
23
|
+
success: true;
|
|
24
|
+
mediaId: number;
|
|
25
|
+
} | {
|
|
26
|
+
success: false;
|
|
27
|
+
error: string;
|
|
28
|
+
};
|
|
29
|
+
type DeleteResult = {
|
|
30
|
+
success: true;
|
|
31
|
+
} | {
|
|
32
|
+
success: false;
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
type FeedbackWidgetProps = {
|
|
36
|
+
title?: string;
|
|
37
|
+
submitLabel?: string;
|
|
38
|
+
uploadLabel?: string;
|
|
39
|
+
allowScreenshotUpload?: boolean;
|
|
40
|
+
screenshotMaxFileSizeBytes?: number;
|
|
41
|
+
screenshotAllowedMimeTypes?: string[];
|
|
42
|
+
capturePolicy?: CapturePolicy;
|
|
43
|
+
onSubmit: (payload: SubmitPayload) => Promise<SubmitResult>;
|
|
44
|
+
onUpload?: (formData: FormData) => Promise<UploadResult>;
|
|
45
|
+
onDeleteScreenshot?: (mediaId: number) => Promise<DeleteResult>;
|
|
46
|
+
};
|
|
47
|
+
declare function FeedbackWidget({ title, submitLabel, uploadLabel, allowScreenshotUpload, screenshotMaxFileSizeBytes, screenshotAllowedMimeTypes, capturePolicy, onSubmit, onUpload, onDeleteScreenshot, }: FeedbackWidgetProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
49
|
+
declare function AdminFeedbackWidget(): react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
type FrontendFeedbackWidgetProps = {
|
|
52
|
+
include: string[];
|
|
53
|
+
locales?: string[];
|
|
54
|
+
title?: string;
|
|
55
|
+
submitLabel?: string;
|
|
56
|
+
uploadLabel?: string;
|
|
57
|
+
/** URL markers (`pisarna`, `narocilnica`, …) — tenant slug is the segment before the marker. */
|
|
58
|
+
tenantPathMarkers?: string[];
|
|
59
|
+
/** FormData key for tenant slug on upload (default `tenant`). */
|
|
60
|
+
tenantFormDataKey?: string;
|
|
61
|
+
};
|
|
62
|
+
declare function FrontendFeedbackWidget({ include, locales, title, submitLabel, uploadLabel, tenantPathMarkers, tenantFormDataKey, }: FrontendFeedbackWidgetProps): react_jsx_runtime.JSX.Element | null;
|
|
63
|
+
|
|
64
|
+
export { AdminFeedbackWidget, FeedbackWidget, FrontendFeedbackWidget };
|