hocmai-feedback-widget 0.1.0 → 0.1.2
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
CHANGED
|
@@ -13,9 +13,9 @@ A React library for collecting user feedback with screenshot capabilities, conte
|
|
|
13
13
|
|
|
14
14
|
### Via NPM/Yarn
|
|
15
15
|
```bash
|
|
16
|
-
npm install
|
|
16
|
+
npm install hocmai-feedback-widget
|
|
17
17
|
# or
|
|
18
|
-
yarn add
|
|
18
|
+
yarn add hocmai-feedback-widget
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
### Local Installation
|
|
@@ -26,7 +26,7 @@ yarn add @antigravity/feedback-widget
|
|
|
26
26
|
```
|
|
27
27
|
2. Install the generated `.tgz` file in your target project:
|
|
28
28
|
```bash
|
|
29
|
-
npm install ./path/to/
|
|
29
|
+
npm install ./path/to/hocmai-feedback-widget-0.1.0.tgz
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Usage
|
|
@@ -35,7 +35,7 @@ yarn add @antigravity/feedback-widget
|
|
|
35
35
|
Wrap your root component (or the section of the app that needs feedback) with `FeedbackProvider`.
|
|
36
36
|
|
|
37
37
|
```tsx
|
|
38
|
-
import { FeedbackProvider, type FeedbackData } from '
|
|
38
|
+
import { FeedbackProvider, type FeedbackData } from 'hocmai-feedback-widget';
|
|
39
39
|
// If styles are not automatically injected by your bundler, you might need:
|
|
40
40
|
// import '@antigravity/feedback-widget/dist/style.css';
|
|
41
41
|
|
|
@@ -60,7 +60,7 @@ function App() {
|
|
|
60
60
|
Use the `useFeedback` hook anywhere in your child components to open the widget for a specific item.
|
|
61
61
|
|
|
62
62
|
```tsx
|
|
63
|
-
import { useFeedback } from '
|
|
63
|
+
import { useFeedback } from 'hocmai-feedback-widget';
|
|
64
64
|
|
|
65
65
|
const QuestionItem = ({ id, content }) => {
|
|
66
66
|
const { openFeedback } = useFeedback();
|
|
@@ -82,7 +82,7 @@ const QuestionItem = ({ id, content }) => {
|
|
|
82
82
|
If you only need a single widget instance and manage state manually:
|
|
83
83
|
|
|
84
84
|
```tsx
|
|
85
|
-
import { FeedbackWidget } from '
|
|
85
|
+
import { FeedbackWidget } from 'hocmai-feedback-widget';
|
|
86
86
|
|
|
87
87
|
<FeedbackWidget
|
|
88
88
|
questionId="123"
|
|
@@ -108,7 +108,7 @@ Returns an object with:
|
|
|
108
108
|
This library is fully compatible with standard JavaScript projects. The usage is identical, just without type annotations.
|
|
109
109
|
|
|
110
110
|
```jsx
|
|
111
|
-
import { FeedbackProvider, useFeedback } from '
|
|
111
|
+
import { FeedbackProvider, useFeedback } from 'hocmai-feedback-widget';
|
|
112
112
|
|
|
113
113
|
function App() {
|
|
114
114
|
const handleSubmit = async (data) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { FeedbackData } from '../components/FeedbackWidget';
|
|
3
3
|
interface FeedbackContextType {
|
|
4
|
-
openFeedback: (questionId: string | number, contextData?: any) => void;
|
|
4
|
+
openFeedback: (questionId: string | number, questionIdChild?: string | number, contextData?: any) => void;
|
|
5
5
|
closeFeedback: () => void;
|
|
6
6
|
isOpen: boolean;
|
|
7
7
|
activeQuestionId: string | number | null;
|