react-visual-feedback 1.1.0 → 1.1.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.
Files changed (3) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +65 -34
  3. package/package.json +1 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Murali
3
+ Copyright (c) 2025 Murali Vvrsn Gurajapu
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,26 +1,27 @@
1
- # Murali Feedback Widget React
1
+ # React Visual Feedback
2
2
 
3
3
  A powerful, visual feedback collection tool for React applications. Users can select any element on your page, and the widget automatically captures a screenshot and context information.
4
4
 
5
5
  ## Features
6
6
 
7
7
  - 🎯 Visual element selection with hover highlighting
8
- - 📸 Automatic screenshot capture of selected elements
8
+ - 📸 Automatic screenshot capture of selected elements with perfect CSS rendering
9
9
  - 📝 Feedback form with rich context
10
10
  - ⚡ Lightweight and performant
11
- - 🎨 Customizable styling
12
- - ⌨️ Keyboard shortcuts (Ctrl+Q to activate, Esc to cancel)
11
+ - 🎨 Works with any CSS framework (Tailwind, Bootstrap, Material-UI, etc.)
12
+ - ⌨️ Keyboard shortcuts (Ctrl+Q to activate, Esc to cancel, Ctrl+Enter to submit)
13
+ - 🌓 Dark mode support
13
14
 
14
15
  ## Installation
15
16
 
16
17
  ```bash
17
- npm install murali-feedback-widget-react
18
+ npm install react-visual-feedback
18
19
  ```
19
20
 
20
21
  **Important:** Import the CSS file in your application:
21
22
 
22
23
  ```jsx
23
- import 'murali-feedback-widget-react/dist/index.css';
24
+ import 'react-visual-feedback/dist/index.css';
24
25
  ```
25
26
 
26
27
  ## Quick Start
@@ -29,8 +30,8 @@ import 'murali-feedback-widget-react/dist/index.css';
29
30
 
30
31
  ```jsx
31
32
  import React from 'react';
32
- import { FeedbackProvider } from 'murali-feedback-widget-react';
33
- import 'murali-feedback-widget-react/dist/index.css';
33
+ import { FeedbackProvider } from 'react-visual-feedback';
34
+ import 'react-visual-feedback/dist/index.css';
34
35
 
35
36
  function App() {
36
37
  const handleFeedbackSubmit = async (feedbackData) => {
@@ -56,7 +57,7 @@ export default App;
56
57
  ### 2. Add a feedback trigger button (optional)
57
58
 
58
59
  ```jsx
59
- import { useFeedback } from 'murali-feedback-widget-react';
60
+ import { useFeedback } from 'react-visual-feedback';
60
61
 
61
62
  function FeedbackButton() {
62
63
  const { setIsActive } = useFeedback();
@@ -71,14 +72,16 @@ function FeedbackButton() {
71
72
 
72
73
  ## Usage
73
74
 
74
- ### Keyboard Shortcut
75
- Press **Ctrl+Q** to activate the feedback widget. Press **Esc** to deactivate.
75
+ ### Keyboard Shortcuts
76
+ - **Ctrl+Q** - Activate feedback mode
77
+ - **Esc** - Cancel/deactivate
78
+ - **Ctrl+Enter** - Submit feedback (when form is open)
76
79
 
77
80
  ### Programmatic Activation (Uncontrolled Mode)
78
81
  Use the `useFeedback` hook to control the widget programmatically:
79
82
 
80
83
  ```jsx
81
- import { useFeedback } from 'murali-feedback-widget-react';
84
+ import { useFeedback } from 'react-visual-feedback';
82
85
 
83
86
  function MyComponent() {
84
87
  const { isActive, setIsActive } = useFeedback();
@@ -96,7 +99,7 @@ You can control the widget's active state from the parent component:
96
99
 
97
100
  ```jsx
98
101
  import React, { useState } from 'react';
99
- import { FeedbackProvider } from 'murali-feedback-widget-react';
102
+ import { FeedbackProvider } from 'react-visual-feedback';
100
103
 
101
104
  function App() {
102
105
  const [isFeedbackActive, setIsFeedbackActive] = useState(false);
@@ -144,9 +147,20 @@ The main provider component that wraps your application.
144
147
  tagName: "div",
145
148
  id: "element-id",
146
149
  className: "element-classes",
147
- xpath: "//div[@id='element-id']",
148
- innerText: "Element text content",
149
- attributes: { /* element attributes */ }
150
+ selector: "div.card > button.primary",
151
+ textContent: "Element text content",
152
+ position: {
153
+ x: 100,
154
+ y: 200,
155
+ width: 300,
156
+ height: 50
157
+ },
158
+ styles: {
159
+ backgroundColor: "rgb(255, 255, 255)",
160
+ color: "rgb(0, 0, 0)",
161
+ fontSize: "16px",
162
+ fontFamily: "Arial, sans-serif"
163
+ }
150
164
  },
151
165
  screenshot: "data:image/png;base64,...", // Base64 encoded screenshot
152
166
  url: "https://yourapp.com/current-page",
@@ -173,13 +187,16 @@ The widget comes with default styles, but you can customize them by targeting th
173
187
  .feedback-tooltip { /* Element info tooltip */ }
174
188
  .feedback-modal { /* Feedback form modal */ }
175
189
  .feedback-backdrop { /* Modal backdrop */ }
190
+ .feedback-modal-content { /* Modal content container */ }
191
+ .feedback-screenshot { /* Screenshot preview */ }
176
192
  ```
177
193
 
178
194
  ## Example Implementation
179
195
 
180
196
  ```jsx
181
197
  import React from 'react';
182
- import { FeedbackProvider, useFeedback } from 'murali-feedback-widget-react';
198
+ import { FeedbackProvider, useFeedback } from 'react-visual-feedback';
199
+ import 'react-visual-feedback/dist/index.css';
183
200
 
184
201
  function FeedbackButton() {
185
202
  const { isActive, setIsActive } = useFeedback();
@@ -191,15 +208,17 @@ function FeedbackButton() {
191
208
  position: 'fixed',
192
209
  bottom: '20px',
193
210
  right: '20px',
194
- padding: '10px 20px',
195
- background: '#007bff',
211
+ padding: '12px 24px',
212
+ background: isActive ? '#ef4444' : '#3b82f6',
196
213
  color: 'white',
197
214
  border: 'none',
198
- borderRadius: '5px',
199
- cursor: 'pointer'
215
+ borderRadius: '8px',
216
+ cursor: 'pointer',
217
+ fontWeight: 'bold',
218
+ boxShadow: '0 4px 6px rgba(0, 0, 0, 0.1)'
200
219
  }}
201
220
  >
202
- {isActive ? 'Select Element...' : 'Report Bug'}
221
+ {isActive ? ' Cancel' : '💬 Report Issue'}
203
222
  </button>
204
223
  );
205
224
  }
@@ -217,7 +236,6 @@ function App() {
217
236
  alert('Thank you for your feedback!');
218
237
  }
219
238
  } catch (error) {
220
- console.error('Failed to submit feedback:', error);
221
239
  alert('Failed to submit feedback. Please try again.');
222
240
  }
223
241
  };
@@ -241,9 +259,9 @@ export default App;
241
259
  1. User activates the widget (Ctrl+Q or button click)
242
260
  2. User hovers over elements to see them highlighted
243
261
  3. User clicks on the problematic element
244
- 4. Widget captures a screenshot of the selected element
245
- 5. Feedback form appears with element context pre-filled
246
- 6. User enters their feedback and submits
262
+ 4. Widget captures a pixel-perfect screenshot of the selected element
263
+ 5. Feedback form appears with element context pre-filled and large screenshot preview
264
+ 6. User enters their feedback and submits (or presses Ctrl+Enter)
247
265
  7. Your `onSubmit` handler receives all the data
248
266
 
249
267
  ## Browser Support
@@ -253,13 +271,20 @@ export default App;
253
271
  - Safari: ✅
254
272
  - Opera: ✅
255
273
 
256
- Requires `html2canvas` for screenshot functionality.
274
+ ## Screenshot Capture
275
+
276
+ The widget uses `html-to-image` library for accurate screenshot capture with fallback to `html2canvas`. This ensures:
277
+ - Perfect CSS rendering including Tailwind, Bootstrap, and custom styles
278
+ - Accurate colors, fonts, and layout
279
+ - Support for gradients, shadows, and modern CSS features
280
+ - High-resolution screenshots (2x pixel ratio)
257
281
 
258
282
  ## Dependencies
259
283
 
260
284
  - React ^16.8.0 || ^17.0.0 || ^18.0.0
261
285
  - react-dom ^16.8.0 || ^17.0.0 || ^18.0.0
262
- - html2canvas ^1.4.1
286
+ - html-to-image ^1.11.13
287
+ - html2canvas ^1.4.1 (fallback)
263
288
  - lucide-react ^0.263.1
264
289
 
265
290
  ## Local Development & Testing
@@ -285,13 +310,14 @@ npm install
285
310
  npm run dev
286
311
  ```
287
312
 
288
- The example app will open at `http://localhost:3000` with a fully working demo!
313
+ The example app will open at `http://localhost:8080` with a fully working demo!
289
314
 
290
315
  ### What's Included
291
316
 
292
- - ✅ Complete working example with UI
293
- - ✅ Both controlled and uncontrolled mode examples
294
- - ✅ Interactive test elements (buttons, forms, images)
317
+ - ✅ Complete working example with Tailwind CSS
318
+ - ✅ Both light and dark mode support
319
+ - ✅ Controlled and uncontrolled mode examples
320
+ - ✅ Interactive test elements (buttons, forms, cards, gradients)
295
321
  - ✅ Console logging to see feedback data
296
322
  - ✅ Hot reload for fast development
297
323
 
@@ -305,7 +331,7 @@ See `example/README.md` for more details.
305
331
 
306
332
  ## License
307
333
 
308
- MIT © Murali
334
+ MIT © 2025 Murali
309
335
 
310
336
  ## Contributing
311
337
 
@@ -318,4 +344,9 @@ https://github.com/Murali1889/react-feedback-widget/issues
318
344
 
319
345
  ## Author
320
346
 
321
- Murali
347
+ **Murali**
348
+ Email: murali.g@hyperverge.co
349
+
350
+ ---
351
+
352
+ Made with ❤️ for better user feedback collection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-visual-feedback",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A visual feedback widget for React applications with element selection and screenshot capture",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",