@matija2209/payload-plugin-admin-feedback 1.0.0 → 1.0.3
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/README.md +47 -106
- package/dist/client/index.cjs +2851 -0
- package/dist/client/index.d.cts +140 -0
- package/dist/client/index.d.ts +140 -0
- package/dist/client/index.js +2838 -0
- package/dist/index.cjs +646 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +643 -0
- package/dist/routeMatcher-CmCMn_gT.d.cts +54 -0
- package/dist/routeMatcher-CmCMn_gT.d.ts +54 -0
- package/package.json +25 -5
- 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
package/src/types.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { PayloadRequest, Config } from 'payload';
|
|
2
|
-
|
|
3
|
-
export type FrontendDisplayConfig = {
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
include?: string[];
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type ScreenshotConfig = {
|
|
9
|
-
enabled?: boolean;
|
|
10
|
-
maxFileSizeBytes?: number;
|
|
11
|
-
allowedMimeTypes?: string[];
|
|
12
|
-
capturePolicy?: 'current-tab-first' | 'strict-current-tab' | 'any-surface';
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type AdminFeedbackPluginOptions = {
|
|
16
|
-
enabled?: boolean;
|
|
17
|
-
emailTo: string | string[];
|
|
18
|
-
fromLabel?: string;
|
|
19
|
-
fromName?: string;
|
|
20
|
-
fromAddress?: string;
|
|
21
|
-
email?: Config['email'];
|
|
22
|
-
allowScreenshotUpload?: boolean;
|
|
23
|
-
maxMessageLength?: number;
|
|
24
|
-
mediaCollectionSlug?: string;
|
|
25
|
-
strictMediaCollection?: boolean;
|
|
26
|
-
screenshot?: ScreenshotConfig;
|
|
27
|
-
frontend?: FrontendDisplayConfig;
|
|
28
|
-
frontendRouteMatcher?: (pathname: string) => boolean;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type ResolvedAdminFeedbackPluginOptions = Omit<
|
|
32
|
-
AdminFeedbackPluginOptions,
|
|
33
|
-
'frontend' | 'screenshot' | 'mediaCollectionSlug' | 'strictMediaCollection'
|
|
34
|
-
> & {
|
|
35
|
-
frontend: Required<FrontendDisplayConfig>;
|
|
36
|
-
screenshot: Required<ScreenshotConfig>;
|
|
37
|
-
mediaCollectionSlug: string;
|
|
38
|
-
strictMediaCollection: boolean;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export type FeedbackMetaInput = {
|
|
42
|
-
userAgent?: string;
|
|
43
|
-
locale?: string;
|
|
44
|
-
viewport?: string;
|
|
45
|
-
createdAt?: string;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export type CreateFeedbackInput = {
|
|
49
|
-
message: string;
|
|
50
|
-
pagePath: string;
|
|
51
|
-
selector?: string;
|
|
52
|
-
selectedText?: string;
|
|
53
|
-
screenshotId?: number | null;
|
|
54
|
-
meta?: FeedbackMetaInput;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export type FeedbackEmailData = {
|
|
58
|
-
id?: string | number;
|
|
59
|
-
message: string;
|
|
60
|
-
pagePath: string;
|
|
61
|
-
selector?: string | null;
|
|
62
|
-
selectedText?: string | null;
|
|
63
|
-
screenshotUrl?: string | null;
|
|
64
|
-
createdByEmail?: string | null;
|
|
65
|
-
createdByName?: string | null;
|
|
66
|
-
createdAt?: string | null;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export type AdminFeedbackHookArgs = {
|
|
70
|
-
req: PayloadRequest;
|
|
71
|
-
doc: Record<string, unknown>;
|
|
72
|
-
operation: 'create' | 'update';
|
|
73
|
-
};
|
package/tsconfig.build.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"incremental": false,
|
|
5
|
-
"noEmit": false,
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"emitDeclarationOnly": true,
|
|
8
|
-
"declarationDir": "./dist",
|
|
9
|
-
"outDir": "./dist",
|
|
10
|
-
"rootDir": "./src"
|
|
11
|
-
},
|
|
12
|
-
"include": ["src"],
|
|
13
|
-
"exclude": ["dist", "node_modules", "dev"]
|
|
14
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "dist",
|
|
5
|
-
"rootDir": "src",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"module": "ESNext",
|
|
10
|
-
"moduleResolution": "bundler",
|
|
11
|
-
"target": "ESNext",
|
|
12
|
-
"jsx": "react-jsx",
|
|
13
|
-
"strict": true,
|
|
14
|
-
"skipLibCheck": true,
|
|
15
|
-
"incremental": false
|
|
16
|
-
},
|
|
17
|
-
"include": ["src"],
|
|
18
|
-
"exclude": ["node_modules", "dist"]
|
|
19
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile } from 'fs/promises';
|
|
2
|
-
import { defineConfig } from 'tsup';
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
entry: {
|
|
6
|
-
index: 'src/index.ts',
|
|
7
|
-
'client/index': 'src/client/index.ts',
|
|
8
|
-
},
|
|
9
|
-
format: ['esm'],
|
|
10
|
-
external: [
|
|
11
|
-
'react',
|
|
12
|
-
'react-dom',
|
|
13
|
-
'react/jsx-runtime',
|
|
14
|
-
'next',
|
|
15
|
-
'next/navigation',
|
|
16
|
-
/^next\//,
|
|
17
|
-
'payload',
|
|
18
|
-
],
|
|
19
|
-
dts: false,
|
|
20
|
-
splitting: false,
|
|
21
|
-
clean: true,
|
|
22
|
-
sourcemap: false,
|
|
23
|
-
treeshake: true,
|
|
24
|
-
async onSuccess() {
|
|
25
|
-
const path = 'dist/client/index.js';
|
|
26
|
-
const content = await readFile(path, 'utf-8');
|
|
27
|
-
await writeFile(path, `'use client';\n${content}`);
|
|
28
|
-
},
|
|
29
|
-
});
|