@matija2209/payload-plugin-admin-feedback 1.0.3 → 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.
@@ -1,7 +1,4 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { F as FeedbackListItem } from '../routeMatcher-CmCMn_gT.cjs';
3
- export { p as pathMatchesAllowlist } from '../routeMatcher-CmCMn_gT.cjs';
4
- import 'payload';
5
2
 
6
3
  type CapturePolicy = 'current-tab-first' | 'strict-current-tab' | 'any-surface';
7
4
  type SubmitPayload = {
@@ -35,12 +32,6 @@ type DeleteResult = {
35
32
  success: false;
36
33
  error: string;
37
34
  };
38
- type DeleteFeedbackResult = {
39
- success: true;
40
- } | {
41
- success: false;
42
- error: string;
43
- };
44
35
  type FeedbackWidgetProps = {
45
36
  title?: string;
46
37
  submitLabel?: string;
@@ -52,24 +43,8 @@ type FeedbackWidgetProps = {
52
43
  onSubmit: (payload: SubmitPayload) => Promise<SubmitResult>;
53
44
  onUpload?: (formData: FormData) => Promise<UploadResult>;
54
45
  onDeleteScreenshot?: (mediaId: number) => Promise<DeleteResult>;
55
- onDeleteFeedback?: (id: number) => Promise<DeleteFeedbackResult>;
56
- showHistory?: boolean;
57
- currentUserId?: number | null;
58
- onUpdateFeedback?: (id: number, data: {
59
- message?: string;
60
- screenshotId?: number | null;
61
- }) => Promise<boolean>;
62
- history?: {
63
- feedbacks: FeedbackListItem[];
64
- totalPages: number;
65
- currentPage: number;
66
- loading: boolean;
67
- error: string | null;
68
- refetch: () => void;
69
- onPageChange: (page: number) => void;
70
- };
71
46
  };
72
- declare function FeedbackWidget({ title, submitLabel, uploadLabel, allowScreenshotUpload, screenshotMaxFileSizeBytes, screenshotAllowedMimeTypes, capturePolicy, onSubmit, onUpload, onDeleteScreenshot, onDeleteFeedback, showHistory, currentUserId, onUpdateFeedback, history, }: FeedbackWidgetProps): react_jsx_runtime.JSX.Element;
47
+ declare function FeedbackWidget({ title, submitLabel, uploadLabel, allowScreenshotUpload, screenshotMaxFileSizeBytes, screenshotAllowedMimeTypes, capturePolicy, onSubmit, onUpload, onDeleteScreenshot, }: FeedbackWidgetProps): react_jsx_runtime.JSX.Element;
73
48
 
74
49
  declare function AdminFeedbackWidget(): react_jsx_runtime.JSX.Element;
75
50
 
@@ -79,62 +54,11 @@ type FrontendFeedbackWidgetProps = {
79
54
  title?: string;
80
55
  submitLabel?: string;
81
56
  uploadLabel?: string;
82
- showIndicators?: boolean;
83
- showHistory?: boolean;
84
- };
85
- declare function FrontendFeedbackWidget({ include, locales, title, submitLabel, uploadLabel, showIndicators, showHistory, }: FrontendFeedbackWidgetProps): react_jsx_runtime.JSX.Element | null;
86
-
87
- type FeedbackDetailProps = {
88
- feedback: FeedbackListItem;
89
- currentUserId: number | null;
90
- capturePolicy: CapturePolicy;
91
- onBack: () => void;
92
- onUpdate: (id: number, data: {
93
- message?: string;
94
- screenshotId?: number | null;
95
- }) => Promise<boolean>;
96
- onDelete: (id: number) => Promise<boolean>;
97
- onUpload: (formData: FormData) => Promise<UploadResult>;
98
- onDeleteScreenshot: (mediaId: number) => Promise<DeleteResult>;
99
- };
100
- declare function FeedbackDetail({ feedback, currentUserId, capturePolicy: _capturePolicy, onBack, onUpdate, onDelete, onUpload, onDeleteScreenshot, }: FeedbackDetailProps): react_jsx_runtime.JSX.Element;
101
-
102
- type FeedbackHistoryProps = {
103
- feedbacks: FeedbackListItem[];
104
- totalPages: number;
105
- currentPage: number;
106
- loading: boolean;
107
- error: string | null;
108
- currentUserId: number | null;
109
- onSelectFeedback: (id: number) => void;
110
- onPageChange: (page: number) => void;
111
- onRefetch: () => void;
112
- };
113
- declare function FeedbackHistory({ feedbacks, totalPages, currentPage, loading, error, currentUserId, onSelectFeedback, onPageChange, onRefetch, }: FeedbackHistoryProps): react_jsx_runtime.JSX.Element;
114
-
115
- type FeedbackIndicatorsProps = {
116
- pagePath?: string;
117
- };
118
- declare function FeedbackIndicators({ pagePath }: FeedbackIndicatorsProps): null;
119
-
120
- type UseFeedbackQueryParams = {
121
- pagePath?: string;
122
- page?: number;
123
- limit?: number;
124
- };
125
- type UseFeedbackQueryResult = {
126
- feedbacks: FeedbackListItem[];
127
- totalPages: number;
128
- currentPage: number;
129
- loading: boolean;
130
- error: string | null;
131
- refetch: () => void;
132
- };
133
- declare function useFeedbackQuery(params: UseFeedbackQueryParams): UseFeedbackQueryResult;
134
- type UseCurrentUserResult = {
135
- userId: number | null;
136
- loading: boolean;
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;
137
61
  };
138
- declare function useCurrentUser(): UseCurrentUserResult;
62
+ declare function FrontendFeedbackWidget({ include, locales, title, submitLabel, uploadLabel, tenantPathMarkers, tenantFormDataKey, }: FrontendFeedbackWidgetProps): react_jsx_runtime.JSX.Element | null;
139
63
 
140
- export { AdminFeedbackWidget, type CapturePolicy, type DeleteResult, FeedbackDetail, FeedbackHistory, FeedbackIndicators, FeedbackWidget, FrontendFeedbackWidget, type UploadResult, useCurrentUser, useFeedbackQuery };
64
+ export { AdminFeedbackWidget, FeedbackWidget, FrontendFeedbackWidget };
@@ -1,7 +1,4 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { F as FeedbackListItem } from '../routeMatcher-CmCMn_gT.js';
3
- export { p as pathMatchesAllowlist } from '../routeMatcher-CmCMn_gT.js';
4
- import 'payload';
5
2
 
6
3
  type CapturePolicy = 'current-tab-first' | 'strict-current-tab' | 'any-surface';
7
4
  type SubmitPayload = {
@@ -35,12 +32,6 @@ type DeleteResult = {
35
32
  success: false;
36
33
  error: string;
37
34
  };
38
- type DeleteFeedbackResult = {
39
- success: true;
40
- } | {
41
- success: false;
42
- error: string;
43
- };
44
35
  type FeedbackWidgetProps = {
45
36
  title?: string;
46
37
  submitLabel?: string;
@@ -52,24 +43,8 @@ type FeedbackWidgetProps = {
52
43
  onSubmit: (payload: SubmitPayload) => Promise<SubmitResult>;
53
44
  onUpload?: (formData: FormData) => Promise<UploadResult>;
54
45
  onDeleteScreenshot?: (mediaId: number) => Promise<DeleteResult>;
55
- onDeleteFeedback?: (id: number) => Promise<DeleteFeedbackResult>;
56
- showHistory?: boolean;
57
- currentUserId?: number | null;
58
- onUpdateFeedback?: (id: number, data: {
59
- message?: string;
60
- screenshotId?: number | null;
61
- }) => Promise<boolean>;
62
- history?: {
63
- feedbacks: FeedbackListItem[];
64
- totalPages: number;
65
- currentPage: number;
66
- loading: boolean;
67
- error: string | null;
68
- refetch: () => void;
69
- onPageChange: (page: number) => void;
70
- };
71
46
  };
72
- declare function FeedbackWidget({ title, submitLabel, uploadLabel, allowScreenshotUpload, screenshotMaxFileSizeBytes, screenshotAllowedMimeTypes, capturePolicy, onSubmit, onUpload, onDeleteScreenshot, onDeleteFeedback, showHistory, currentUserId, onUpdateFeedback, history, }: FeedbackWidgetProps): react_jsx_runtime.JSX.Element;
47
+ declare function FeedbackWidget({ title, submitLabel, uploadLabel, allowScreenshotUpload, screenshotMaxFileSizeBytes, screenshotAllowedMimeTypes, capturePolicy, onSubmit, onUpload, onDeleteScreenshot, }: FeedbackWidgetProps): react_jsx_runtime.JSX.Element;
73
48
 
74
49
  declare function AdminFeedbackWidget(): react_jsx_runtime.JSX.Element;
75
50
 
@@ -79,62 +54,11 @@ type FrontendFeedbackWidgetProps = {
79
54
  title?: string;
80
55
  submitLabel?: string;
81
56
  uploadLabel?: string;
82
- showIndicators?: boolean;
83
- showHistory?: boolean;
84
- };
85
- declare function FrontendFeedbackWidget({ include, locales, title, submitLabel, uploadLabel, showIndicators, showHistory, }: FrontendFeedbackWidgetProps): react_jsx_runtime.JSX.Element | null;
86
-
87
- type FeedbackDetailProps = {
88
- feedback: FeedbackListItem;
89
- currentUserId: number | null;
90
- capturePolicy: CapturePolicy;
91
- onBack: () => void;
92
- onUpdate: (id: number, data: {
93
- message?: string;
94
- screenshotId?: number | null;
95
- }) => Promise<boolean>;
96
- onDelete: (id: number) => Promise<boolean>;
97
- onUpload: (formData: FormData) => Promise<UploadResult>;
98
- onDeleteScreenshot: (mediaId: number) => Promise<DeleteResult>;
99
- };
100
- declare function FeedbackDetail({ feedback, currentUserId, capturePolicy: _capturePolicy, onBack, onUpdate, onDelete, onUpload, onDeleteScreenshot, }: FeedbackDetailProps): react_jsx_runtime.JSX.Element;
101
-
102
- type FeedbackHistoryProps = {
103
- feedbacks: FeedbackListItem[];
104
- totalPages: number;
105
- currentPage: number;
106
- loading: boolean;
107
- error: string | null;
108
- currentUserId: number | null;
109
- onSelectFeedback: (id: number) => void;
110
- onPageChange: (page: number) => void;
111
- onRefetch: () => void;
112
- };
113
- declare function FeedbackHistory({ feedbacks, totalPages, currentPage, loading, error, currentUserId, onSelectFeedback, onPageChange, onRefetch, }: FeedbackHistoryProps): react_jsx_runtime.JSX.Element;
114
-
115
- type FeedbackIndicatorsProps = {
116
- pagePath?: string;
117
- };
118
- declare function FeedbackIndicators({ pagePath }: FeedbackIndicatorsProps): null;
119
-
120
- type UseFeedbackQueryParams = {
121
- pagePath?: string;
122
- page?: number;
123
- limit?: number;
124
- };
125
- type UseFeedbackQueryResult = {
126
- feedbacks: FeedbackListItem[];
127
- totalPages: number;
128
- currentPage: number;
129
- loading: boolean;
130
- error: string | null;
131
- refetch: () => void;
132
- };
133
- declare function useFeedbackQuery(params: UseFeedbackQueryParams): UseFeedbackQueryResult;
134
- type UseCurrentUserResult = {
135
- userId: number | null;
136
- loading: boolean;
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;
137
61
  };
138
- declare function useCurrentUser(): UseCurrentUserResult;
62
+ declare function FrontendFeedbackWidget({ include, locales, title, submitLabel, uploadLabel, tenantPathMarkers, tenantFormDataKey, }: FrontendFeedbackWidgetProps): react_jsx_runtime.JSX.Element | null;
139
63
 
140
- export { AdminFeedbackWidget, type CapturePolicy, type DeleteResult, FeedbackDetail, FeedbackHistory, FeedbackIndicators, FeedbackWidget, FrontendFeedbackWidget, type UploadResult, useCurrentUser, useFeedbackQuery };
64
+ export { AdminFeedbackWidget, FeedbackWidget, FrontendFeedbackWidget };