react-visual-feedback 1.3.0 → 1.3.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/README.md +114 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,13 @@ A powerful, visual feedback collection tool for React applications with an integ
|
|
|
23
23
|
- 🔄 Status change callbacks for database synchronization
|
|
24
24
|
- ⌨️ Dashboard keyboard shortcut (Ctrl+Shift+Q)
|
|
25
25
|
|
|
26
|
+
### Update Notifications
|
|
27
|
+
- 🔔 Beautiful notification component for feedback updates
|
|
28
|
+
- 📬 Show users when their feedback status changes
|
|
29
|
+
- 🎨 Grouped by status (Completed, In Progress, Other)
|
|
30
|
+
- 👋 Dismiss individual updates or all at once
|
|
31
|
+
- ⏰ Smart time formatting (e.g., "2 hours ago", "3 days ago")
|
|
32
|
+
|
|
26
33
|
## Installation
|
|
27
34
|
|
|
28
35
|
```bash
|
|
@@ -123,6 +130,71 @@ function App() {
|
|
|
123
130
|
export default App;
|
|
124
131
|
```
|
|
125
132
|
|
|
133
|
+
### With Update Notifications
|
|
134
|
+
|
|
135
|
+
```jsx
|
|
136
|
+
import React, { useState } from 'react';
|
|
137
|
+
import {
|
|
138
|
+
FeedbackProvider,
|
|
139
|
+
FeedbackUpdatesNotification
|
|
140
|
+
} from 'react-visual-feedback';
|
|
141
|
+
import 'react-visual-feedback/dist/index.css';
|
|
142
|
+
|
|
143
|
+
function App() {
|
|
144
|
+
const [showNotifications, setShowNotifications] = useState(false);
|
|
145
|
+
const [updates, setUpdates] = useState([
|
|
146
|
+
{
|
|
147
|
+
id: '1',
|
|
148
|
+
title: 'Button not working on mobile',
|
|
149
|
+
feedback: 'The submit button is not clickable',
|
|
150
|
+
status: 'resolved',
|
|
151
|
+
responseMessage: 'Fixed! The button now works on all devices.',
|
|
152
|
+
resolvedBy: 'John Developer',
|
|
153
|
+
updatedAt: '2025-11-02T14:30:00Z'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: '2',
|
|
157
|
+
title: 'Add dark mode',
|
|
158
|
+
feedback: 'Would be great to have dark mode',
|
|
159
|
+
status: 'inProgress',
|
|
160
|
+
responseMessage: 'Working on it! Should be ready next week.',
|
|
161
|
+
assignedTo: 'Sarah Designer',
|
|
162
|
+
estimatedResolutionDate: '2025-11-10T00:00:00Z',
|
|
163
|
+
updatedAt: '2025-11-01T11:00:00Z'
|
|
164
|
+
}
|
|
165
|
+
]);
|
|
166
|
+
|
|
167
|
+
const handleDismissUpdate = (updateId) => {
|
|
168
|
+
setUpdates(prev => prev.filter(u => u.id !== updateId));
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const handleDismissAll = () => {
|
|
172
|
+
setUpdates([]);
|
|
173
|
+
setShowNotifications(false);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<FeedbackProvider onSubmit={handleFeedbackSubmit}>
|
|
178
|
+
<YourApp />
|
|
179
|
+
|
|
180
|
+
<button onClick={() => setShowNotifications(true)}>
|
|
181
|
+
🔔 Updates ({updates.length})
|
|
182
|
+
</button>
|
|
183
|
+
|
|
184
|
+
<FeedbackUpdatesNotification
|
|
185
|
+
isOpen={showNotifications}
|
|
186
|
+
onClose={() => setShowNotifications(false)}
|
|
187
|
+
updates={updates}
|
|
188
|
+
onDismissUpdate={handleDismissUpdate}
|
|
189
|
+
onDismissAll={handleDismissAll}
|
|
190
|
+
/>
|
|
191
|
+
</FeedbackProvider>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export default App;
|
|
196
|
+
```
|
|
197
|
+
|
|
126
198
|
## Status Options
|
|
127
199
|
|
|
128
200
|
The dashboard includes 7 professional status options:
|
|
@@ -165,6 +237,32 @@ const { isActive, setIsActive, setIsDashboardOpen } = useFeedback();
|
|
|
165
237
|
- `setIsActive`: `(active: boolean) => void` - Activate/deactivate feedback mode
|
|
166
238
|
- `setIsDashboardOpen`: `(open: boolean) => void` - Open/close dashboard
|
|
167
239
|
|
|
240
|
+
### FeedbackUpdatesNotification Props
|
|
241
|
+
|
|
242
|
+
| Prop | Type | Required | Default | Description |
|
|
243
|
+
|------|------|----------|---------|-------------|
|
|
244
|
+
| `isOpen` | `boolean` | Yes | - | Controls notification visibility |
|
|
245
|
+
| `onClose` | `() => void` | Yes | - | Callback when notification is closed |
|
|
246
|
+
| `updates` | `Array` | Yes | - | Array of feedback updates to display |
|
|
247
|
+
| `onDismissUpdate` | `(id: string) => void` | No | - | Callback when a single update is dismissed |
|
|
248
|
+
| `onDismissAll` | `() => void` | No | - | Callback when all updates are dismissed |
|
|
249
|
+
|
|
250
|
+
**Update Object Structure:**
|
|
251
|
+
```typescript
|
|
252
|
+
{
|
|
253
|
+
id: string,
|
|
254
|
+
title?: string,
|
|
255
|
+
feedback: string,
|
|
256
|
+
status: 'reported' | 'opened' | 'inProgress' | 'resolved' | 'released' | 'blocked' | 'wontFix',
|
|
257
|
+
responseMessage?: string,
|
|
258
|
+
assignedTo?: string,
|
|
259
|
+
resolvedBy?: string,
|
|
260
|
+
estimatedResolutionDate?: string,
|
|
261
|
+
updatedAt: string,
|
|
262
|
+
createdAt?: string
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
168
266
|
### Feedback Data Structure
|
|
169
267
|
|
|
170
268
|
```typescript
|
|
@@ -265,6 +363,16 @@ npm run dev
|
|
|
265
363
|
|
|
266
364
|
Visit `http://localhost:8080` to see the demo!
|
|
267
365
|
|
|
366
|
+
## Components Exported
|
|
367
|
+
|
|
368
|
+
```jsx
|
|
369
|
+
import {
|
|
370
|
+
FeedbackProvider, // Main provider component
|
|
371
|
+
useFeedback, // Hook to control feedback state
|
|
372
|
+
FeedbackUpdatesNotification // Notification component for updates
|
|
373
|
+
} from 'react-visual-feedback';
|
|
374
|
+
```
|
|
375
|
+
|
|
268
376
|
## What's New in v1.3.0
|
|
269
377
|
|
|
270
378
|
### Status Change with Comments
|
|
@@ -272,6 +380,12 @@ Visit `http://localhost:8080` to see the demo!
|
|
|
272
380
|
- 📝 Comments are passed to `onStatusChange` callback
|
|
273
381
|
- 👥 Comments visible to users as developer responses
|
|
274
382
|
|
|
383
|
+
### Update Notifications Component
|
|
384
|
+
- 🔔 New `FeedbackUpdatesNotification` component
|
|
385
|
+
- 📬 Show users updates on their feedback
|
|
386
|
+
- 🎨 Beautifully grouped by status
|
|
387
|
+
- 👋 Dismiss individual or all updates
|
|
388
|
+
|
|
275
389
|
## License
|
|
276
390
|
|
|
277
391
|
MIT © 2025 Murali Vvrsn Gurajapu
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-visual-feedback",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "A visual feedback widget for React applications with element selection, screenshot capture, and professional dashboard",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|