@mindbowser_inc/ui-feedback-plugin 0.1.0
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 +163 -0
- package/dist/firebase-BGU5KpRU.mjs +15481 -0
- package/dist/firebase-BGU5KpRU.mjs.map +1 -0
- package/dist/html2canvas.esm-d2sM-0Wm.mjs +4871 -0
- package/dist/html2canvas.esm-d2sM-0Wm.mjs.map +1 -0
- package/dist/index-BcqBbswO.mjs +18420 -0
- package/dist/index-BcqBbswO.mjs.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/s3-DkzKoz0A.mjs +32 -0
- package/dist/s3-DkzKoz0A.mjs.map +1 -0
- package/dist/supabase-BUHP2OkK.mjs +128 -0
- package/dist/supabase-BUHP2OkK.mjs.map +1 -0
- package/dist/ui-feedback-plugin.es.js +1382 -0
- package/dist/ui-feedback-plugin.es.js.map +1 -0
- package/dist/ui-feedback-plugin.umd.js +3036 -0
- package/dist/ui-feedback-plugin.umd.js.map +1 -0
- package/package.json +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# ui-feedback-plugin
|
|
2
|
+
|
|
3
|
+
A drop-in floating widget for collecting annotated UI feedback on web prototypes. Think Figma comments — but on any web page.
|
|
4
|
+
|
|
5
|
+
**Features**
|
|
6
|
+
- Draggable floating trigger button
|
|
7
|
+
- Freehand drawing + shapes (rectangle, circle, arrow)
|
|
8
|
+
- Full-page screenshots with annotations
|
|
9
|
+
- Comment threads with replies
|
|
10
|
+
- Open / Resolved filter
|
|
11
|
+
- Real-time sync across tabs
|
|
12
|
+
- Firebase **or** Supabase backend
|
|
13
|
+
- S3 screenshot storage via a backend proxy
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @mindbowser_inc/ui-feedback-plugin
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
### With Firebase
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { initFeedbackPlugin } from '@mindbowser_inc/ui-feedback-plugin'
|
|
31
|
+
|
|
32
|
+
initFeedbackPlugin({
|
|
33
|
+
database: {
|
|
34
|
+
provider: 'firebase',
|
|
35
|
+
apiKey: process.env.FIREBASE_API_KEY,
|
|
36
|
+
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
|
|
37
|
+
projectId: process.env.FIREBASE_PROJECT_ID,
|
|
38
|
+
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
|
|
39
|
+
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
|
|
40
|
+
appId: process.env.FIREBASE_APP_ID,
|
|
41
|
+
},
|
|
42
|
+
projectKey: 'my-project',
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> The Firebase API key is a **public identifier**, not a secret. Secure your data with [Firebase Security Rules](https://firebase.google.com/docs/rules).
|
|
47
|
+
|
|
48
|
+
### With Supabase
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
import { initFeedbackPlugin } from '@mindbowser_inc/ui-feedback-plugin'
|
|
52
|
+
|
|
53
|
+
initFeedbackPlugin({
|
|
54
|
+
database: {
|
|
55
|
+
provider: 'supabase',
|
|
56
|
+
url: process.env.SUPABASE_URL,
|
|
57
|
+
anonKey: process.env.SUPABASE_ANON_KEY,
|
|
58
|
+
},
|
|
59
|
+
projectKey: 'my-project',
|
|
60
|
+
})
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
> The Supabase `anonKey` is a **public key by design**. Secure your data with [Row Level Security (RLS)](https://supabase.com/docs/guides/auth/row-level-security) policies.
|
|
64
|
+
|
|
65
|
+
**Supabase setup** — run this SQL in your Supabase SQL editor:
|
|
66
|
+
|
|
67
|
+
```sql
|
|
68
|
+
create table if not exists ufp_comments (
|
|
69
|
+
id uuid primary key default gen_random_uuid(),
|
|
70
|
+
page_url text not null,
|
|
71
|
+
project_key text not null default 'default',
|
|
72
|
+
author_name text not null,
|
|
73
|
+
text text not null,
|
|
74
|
+
screenshot_url text default '',
|
|
75
|
+
annotation jsonb not null default '{}',
|
|
76
|
+
resolved boolean default false,
|
|
77
|
+
created_at bigint not null
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
create table if not exists ufp_replies (
|
|
81
|
+
id uuid primary key default gen_random_uuid(),
|
|
82
|
+
comment_id uuid not null references ufp_comments(id) on delete cascade,
|
|
83
|
+
author_name text not null,
|
|
84
|
+
text text not null,
|
|
85
|
+
created_at bigint not null
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
alter table ufp_comments enable row level security;
|
|
89
|
+
alter table ufp_replies enable row level security;
|
|
90
|
+
create policy "ufp_comments_all" on ufp_comments for all using (true) with check (true);
|
|
91
|
+
create policy "ufp_replies_all" on ufp_replies for all using (true) with check (true);
|
|
92
|
+
|
|
93
|
+
grant select, insert, update, delete on ufp_comments to anon;
|
|
94
|
+
grant select, insert, update, delete on ufp_replies to anon;
|
|
95
|
+
|
|
96
|
+
alter publication supabase_realtime add table ufp_comments;
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Then create a **public** Storage bucket named `ufp-screenshots` and add these policies:
|
|
100
|
+
|
|
101
|
+
```sql
|
|
102
|
+
create policy "ufp_storage_insert" on storage.objects for insert to anon with check (bucket_id = 'ufp-screenshots');
|
|
103
|
+
create policy "ufp_storage_select" on storage.objects for select to anon using (bucket_id = 'ufp-screenshots');
|
|
104
|
+
create policy "ufp_storage_update" on storage.objects for update to anon using (bucket_id = 'ufp-screenshots');
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## S3 screenshot storage
|
|
110
|
+
|
|
111
|
+
Store screenshots in S3 while keeping your database on Firebase or Supabase. **AWS credentials must never appear in frontend code** — provide a backend proxy endpoint instead.
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
initFeedbackPlugin({
|
|
115
|
+
database: {
|
|
116
|
+
provider: 'supabase',
|
|
117
|
+
url: process.env.SUPABASE_URL,
|
|
118
|
+
anonKey: process.env.SUPABASE_ANON_KEY,
|
|
119
|
+
},
|
|
120
|
+
screenshots: {
|
|
121
|
+
provider: 's3',
|
|
122
|
+
uploadEndpoint: 'https://your-api.com/upload-screenshot',
|
|
123
|
+
headers: { Authorization: 'Bearer your-internal-token' },
|
|
124
|
+
},
|
|
125
|
+
projectKey: 'my-project',
|
|
126
|
+
})
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Your endpoint receives `POST { commentId: string, imageData: string }` (base64) and must return `{ url: string }`. See the [minimal Node/Express example](src/adapters/s3.ts).
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Configuration
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
initFeedbackPlugin({
|
|
137
|
+
database: FirebaseProviderConfig | SupabaseProviderConfig // required
|
|
138
|
+
screenshots?: 'firebase' | 'supabase' | S3ScreenshotConfig // optional, defaults to same as database
|
|
139
|
+
projectKey?: string // namespace comments per project (default: 'default')
|
|
140
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' // default: 'bottom-right'
|
|
141
|
+
theme?: { primaryColor?: string } // default: '#6366f1'
|
|
142
|
+
})
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Usage in plain HTML (UMD)
|
|
148
|
+
|
|
149
|
+
```html
|
|
150
|
+
<script src="https://unpkg.com/@mindbowser_inc/ui-feedback-plugin/dist/ui-feedback-plugin.umd.js"></script>
|
|
151
|
+
<script>
|
|
152
|
+
UIFeedbackPlugin.initFeedbackPlugin({
|
|
153
|
+
database: { provider: 'supabase', url: '...', anonKey: '...' },
|
|
154
|
+
projectKey: 'my-project',
|
|
155
|
+
})
|
|
156
|
+
</script>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
MIT
|