feedback-vos 1.0.0 → 1.0.1
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/LICENSE +22 -22
- package/README.md +103 -309
- package/dist/index.d.mts +5 -9
- package/dist/index.d.ts +5 -9
- package/dist/index.js +342 -83
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +342 -83
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +103 -98
- package/package.json +59 -59
package/LICENSE
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Klaas Sysop
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Klaas Sysop
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
CHANGED
|
@@ -1,309 +1,103 @@
|
|
|
1
|
-
# Feedback Vos
|
|
2
|
-
|
|
3
|
-
A beautiful, customizable feedback widget for Next.js applications with built-in
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- 🎨 Modern and responsive design
|
|
8
|
-
- 📸 Screenshot functionality
|
|
9
|
-
- 🎯 Three feedback types: Bug, Idea, Other
|
|
10
|
-
- ⚡ Built for Next.js 14+ (App Router)
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
### GitHub Integration
|
|
106
|
-
|
|
107
|
-
1. **Create a GitHub Personal Access Token:**
|
|
108
|
-
- Go to https://github.com/settings/tokens
|
|
109
|
-
- Click "Generate new token (classic)"
|
|
110
|
-
- Give it a name and select scope: `repo` (for private repos) or `public_repo` (for public repos)
|
|
111
|
-
- Copy the token
|
|
112
|
-
|
|
113
|
-
2. **Configure in your app:**
|
|
114
|
-
```tsx
|
|
115
|
-
<Widget
|
|
116
|
-
integration="github"
|
|
117
|
-
githubConfig={{
|
|
118
|
-
token: process.env.NEXT_PUBLIC_GITHUB_TOKEN!,
|
|
119
|
-
owner: 'your-username',
|
|
120
|
-
repo: 'your-repo-name',
|
|
121
|
-
}}
|
|
122
|
-
/>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## API Reference
|
|
126
|
-
|
|
127
|
-
### Widget Props
|
|
128
|
-
|
|
129
|
-
```typescript
|
|
130
|
-
interface WidgetProps {
|
|
131
|
-
integration: 'notion' | 'github';
|
|
132
|
-
notionConfig?: NotionConfig;
|
|
133
|
-
githubConfig?: GitHubConfig;
|
|
134
|
-
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
interface NotionConfig {
|
|
138
|
-
apiKey: string;
|
|
139
|
-
databaseId: string;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
interface GitHubConfig {
|
|
143
|
-
token: string;
|
|
144
|
-
owner: string;
|
|
145
|
-
repo: string;
|
|
146
|
-
}
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Position Options
|
|
150
|
-
|
|
151
|
-
- `bottom-right` (default) - Bottom right corner
|
|
152
|
-
- `bottom-left` - Bottom left corner
|
|
153
|
-
- `top-right` - Top right corner
|
|
154
|
-
- `top-left` - Top left corner
|
|
155
|
-
|
|
156
|
-
## Examples
|
|
157
|
-
|
|
158
|
-
### Notion Integration
|
|
159
|
-
|
|
160
|
-
```tsx
|
|
161
|
-
import { Widget } from 'feedback-vos';
|
|
162
|
-
import 'feedback-vos/styles';
|
|
163
|
-
|
|
164
|
-
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
165
|
-
return (
|
|
166
|
-
<html>
|
|
167
|
-
<body>
|
|
168
|
-
{children}
|
|
169
|
-
<Widget
|
|
170
|
-
integration="notion"
|
|
171
|
-
notionConfig={{
|
|
172
|
-
apiKey: process.env.NEXT_PUBLIC_NOTION_API_KEY!,
|
|
173
|
-
databaseId: process.env.NEXT_PUBLIC_NOTION_DATABASE_ID!,
|
|
174
|
-
}}
|
|
175
|
-
position="bottom-right"
|
|
176
|
-
/>
|
|
177
|
-
</body>
|
|
178
|
-
</html>
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### GitHub Integration
|
|
184
|
-
|
|
185
|
-
```tsx
|
|
186
|
-
import { Widget } from 'feedback-vos';
|
|
187
|
-
import 'feedback-vos/styles';
|
|
188
|
-
|
|
189
|
-
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
190
|
-
return (
|
|
191
|
-
<html>
|
|
192
|
-
<body>
|
|
193
|
-
{children}
|
|
194
|
-
<Widget
|
|
195
|
-
integration="github"
|
|
196
|
-
githubConfig={{
|
|
197
|
-
token: process.env.NEXT_PUBLIC_GITHUB_TOKEN!,
|
|
198
|
-
owner: 'klaas-sysop',
|
|
199
|
-
repo: 'my-project',
|
|
200
|
-
}}
|
|
201
|
-
position="bottom-left"
|
|
202
|
-
/>
|
|
203
|
-
</body>
|
|
204
|
-
</html>
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
## Environment Variables
|
|
210
|
-
|
|
211
|
-
Add these to your `.env.local` file:
|
|
212
|
-
|
|
213
|
-
```env
|
|
214
|
-
# For Notion
|
|
215
|
-
NEXT_PUBLIC_NOTION_API_KEY=secret_...
|
|
216
|
-
NEXT_PUBLIC_NOTION_DATABASE_ID=...
|
|
217
|
-
|
|
218
|
-
# For GitHub
|
|
219
|
-
NEXT_PUBLIC_GITHUB_TOKEN=ghp_...
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
**Note:** Since these are `NEXT_PUBLIC_` variables, they will be exposed to the client. For production, consider using a backend API route to handle the integrations server-side.
|
|
223
|
-
|
|
224
|
-
## Styling
|
|
225
|
-
|
|
226
|
-
The widget uses Tailwind CSS. Make sure Tailwind is configured in your Next.js project. The widget styles are automatically included when you import `'feedback-vos/styles'`.
|
|
227
|
-
|
|
228
|
-
### Custom Colors
|
|
229
|
-
|
|
230
|
-
You can customize the brand colors by overriding Tailwind classes in your global CSS:
|
|
231
|
-
|
|
232
|
-
```css
|
|
233
|
-
/* app/globals.css */
|
|
234
|
-
@tailwind base;
|
|
235
|
-
@tailwind components;
|
|
236
|
-
@tailwind utilities;
|
|
237
|
-
|
|
238
|
-
/* Override brand colors */
|
|
239
|
-
.bg-brand-500 {
|
|
240
|
-
background-color: #your-color;
|
|
241
|
-
}
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
## TypeScript Support
|
|
245
|
-
|
|
246
|
-
This package includes TypeScript definitions. No additional setup required.
|
|
247
|
-
|
|
248
|
-
## Requirements
|
|
249
|
-
|
|
250
|
-
- Next.js 14+
|
|
251
|
-
- React 18+
|
|
252
|
-
- Tailwind CSS (should already be in your Next.js project)
|
|
253
|
-
|
|
254
|
-
## Contributing
|
|
255
|
-
|
|
256
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
257
|
-
|
|
258
|
-
## License
|
|
259
|
-
|
|
260
|
-
MIT License - see LICENSE file for details.
|
|
261
|
-
|
|
262
|
-
## Publishing
|
|
263
|
-
|
|
264
|
-
This package is ready to be published to npm. To publish:
|
|
265
|
-
|
|
266
|
-
1. **Ensure you're logged in to npm:**
|
|
267
|
-
```bash
|
|
268
|
-
npm login
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
2. **Verify the build works:**
|
|
272
|
-
```bash
|
|
273
|
-
npm run build
|
|
274
|
-
```
|
|
275
|
-
This will generate the `dist/` folder with all necessary files.
|
|
276
|
-
|
|
277
|
-
3. **Check what will be published:**
|
|
278
|
-
```bash
|
|
279
|
-
npm pack --dry-run
|
|
280
|
-
```
|
|
281
|
-
This shows exactly which files will be included in the package.
|
|
282
|
-
|
|
283
|
-
4. **Publish to npm:**
|
|
284
|
-
```bash
|
|
285
|
-
npm publish
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
For the first publish, the package will be public by default. If you need to explicitly set access:
|
|
289
|
-
```bash
|
|
290
|
-
npm publish --access public
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
5. **Update version for subsequent releases:**
|
|
294
|
-
```bash
|
|
295
|
-
npm version patch # for bug fixes (1.0.0 -> 1.0.1)
|
|
296
|
-
npm version minor # for new features (1.0.0 -> 1.1.0)
|
|
297
|
-
npm version major # for breaking changes (1.0.0 -> 2.0.0)
|
|
298
|
-
npm publish
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
The `prepublishOnly` script in `package.json` will automatically run the build before publishing, ensuring the latest code is included.
|
|
302
|
-
|
|
303
|
-
## Support
|
|
304
|
-
|
|
305
|
-
For issues, questions, or feature requests, please open an issue on [GitHub](https://github.com/klaas-sysop/npm-feedback-vos).
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
Built with 💜 by [Klaas Sysop](https://github.com/klaas-sysop)
|
|
1
|
+
# Feedback Vos
|
|
2
|
+
|
|
3
|
+
A beautiful, customizable feedback widget for Next.js applications with built-in GitHub Issues integration.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎨 Modern and responsive design
|
|
8
|
+
- 📸 Screenshot functionality
|
|
9
|
+
- 🎯 Three feedback types: Bug, Idea, Other
|
|
10
|
+
- ⚡ Built for Next.js 14+ (App Router)
|
|
11
|
+
- 🔌 Automatic GitHub Issues creation
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install feedback-vos
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
// app/layout.tsx
|
|
23
|
+
import { Widget } from 'feedback-vos';
|
|
24
|
+
import 'feedback-vos/styles';
|
|
25
|
+
|
|
26
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
27
|
+
return (
|
|
28
|
+
<html lang="en">
|
|
29
|
+
<body>
|
|
30
|
+
{children}
|
|
31
|
+
<Widget
|
|
32
|
+
integration="github"
|
|
33
|
+
githubConfig={{
|
|
34
|
+
token: process.env.NEXT_PUBLIC_GITHUB_TOKEN!,
|
|
35
|
+
owner: process.env.NEXT_PUBLIC_GITHUB_OWNER!,
|
|
36
|
+
repo: process.env.NEXT_PUBLIC_GITHUB_REPO!,
|
|
37
|
+
}}
|
|
38
|
+
position="bottom-right"
|
|
39
|
+
/>
|
|
40
|
+
</body>
|
|
41
|
+
</html>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
### GitHub Setup
|
|
49
|
+
|
|
50
|
+
1. Create a GitHub Personal Access Token at https://github.com/settings/tokens with `repo` (private) or `public_repo` (public) scope and issue permissions
|
|
51
|
+
2. Add to `.env.local`:
|
|
52
|
+
```env
|
|
53
|
+
NEXT_PUBLIC_GITHUB_TOKEN=your_github_token_here
|
|
54
|
+
NEXT_PUBLIC_GITHUB_OWNER=your-username
|
|
55
|
+
NEXT_PUBLIC_GITHUB_REPO=your-repo-name
|
|
56
|
+
NEXT_PUBLIC_FEEDBACK_POSITION=bottom-right # optional: bottom-left
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Important:** `owner` and `repo` are case-sensitive. Ensure Issues are enabled in your repository.
|
|
60
|
+
|
|
61
|
+
## API Reference
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
interface WidgetProps {
|
|
65
|
+
integration: 'github';
|
|
66
|
+
githubConfig: {
|
|
67
|
+
token: string;
|
|
68
|
+
owner: string;
|
|
69
|
+
repo: string;
|
|
70
|
+
screenshotPath?: string; // default: '.feedback-vos'
|
|
71
|
+
};
|
|
72
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## How It Works
|
|
77
|
+
|
|
78
|
+
When feedback is submitted:
|
|
79
|
+
1. Feedback type and comment are captured
|
|
80
|
+
2. Screenshots are compressed and uploaded to `.feedback-vos/` in your repo
|
|
81
|
+
3. A GitHub issue is created with labels `feedback` and the feedback type
|
|
82
|
+
|
|
83
|
+
**Note:** Labels must exist in your repository. Screenshots are stored in your repo (no size limits).
|
|
84
|
+
|
|
85
|
+
## Troubleshooting
|
|
86
|
+
|
|
87
|
+
- **404:** Check repository exists, case-sensitive `owner/repo`, token access, Issues enabled
|
|
88
|
+
- **401:** Invalid/expired token or missing scope
|
|
89
|
+
- **403:** No issue permissions, Issues disabled, or rate limit exceeded
|
|
90
|
+
|
|
91
|
+
## Requirements
|
|
92
|
+
|
|
93
|
+
- Next.js 14+
|
|
94
|
+
- React 18+
|
|
95
|
+
- Tailwind CSS
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
MIT License
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
Built with 💜 by [Klaas Sysop](https://github.com/klaas-sysop)
|
package/dist/index.d.mts
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
interface NotionConfig {
|
|
4
|
-
apiKey: string;
|
|
5
|
-
databaseId: string;
|
|
6
|
-
}
|
|
7
3
|
interface GitHubConfig {
|
|
8
4
|
token: string;
|
|
9
5
|
owner: string;
|
|
10
6
|
repo: string;
|
|
7
|
+
screenshotPath?: string;
|
|
11
8
|
}
|
|
12
9
|
interface WidgetProps {
|
|
13
|
-
integration: '
|
|
14
|
-
|
|
15
|
-
githubConfig?: GitHubConfig;
|
|
10
|
+
integration: 'github';
|
|
11
|
+
githubConfig: GitHubConfig;
|
|
16
12
|
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
17
13
|
}
|
|
18
14
|
|
|
19
|
-
declare function Widget({ integration,
|
|
15
|
+
declare function Widget({ integration, githubConfig, position }: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
20
16
|
|
|
21
|
-
export { type GitHubConfig,
|
|
17
|
+
export { type GitHubConfig, Widget, type WidgetProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
interface NotionConfig {
|
|
4
|
-
apiKey: string;
|
|
5
|
-
databaseId: string;
|
|
6
|
-
}
|
|
7
3
|
interface GitHubConfig {
|
|
8
4
|
token: string;
|
|
9
5
|
owner: string;
|
|
10
6
|
repo: string;
|
|
7
|
+
screenshotPath?: string;
|
|
11
8
|
}
|
|
12
9
|
interface WidgetProps {
|
|
13
|
-
integration: '
|
|
14
|
-
|
|
15
|
-
githubConfig?: GitHubConfig;
|
|
10
|
+
integration: 'github';
|
|
11
|
+
githubConfig: GitHubConfig;
|
|
16
12
|
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
17
13
|
}
|
|
18
14
|
|
|
19
|
-
declare function Widget({ integration,
|
|
15
|
+
declare function Widget({ integration, githubConfig, position }: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
20
16
|
|
|
21
|
-
export { type GitHubConfig,
|
|
17
|
+
export { type GitHubConfig, Widget, type WidgetProps };
|