review-lens-react 0.2.1 → 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/README.md +48 -8
- package/dist/index.d.ts +2 -1
- package/dist/review-lens-logo.d.ts +6 -0
- package/dist/review-lens-react.js +776 -543
- package/dist/review-lens-react.umd.cjs +3 -1
- package/dist/sheets/google-sheets-adapter.d.ts +3 -1
- package/dist/styles.css +1 -1
- package/dist/types.d.ts +13 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# review-lens-react
|
|
2
2
|
|
|
3
|
+
<img src="https://raw.githubusercontent.com/ichichich3011/review-lens-react/main/packages/review-lens-react/review-lens-logo.svg" alt="Review Lens logo" width="64" height="64">
|
|
4
|
+
|
|
3
5
|
`review-lens-react` is a React overlay for UX reviews inside frontend apps. Designers can inspect real DOM elements, see computed spacing and typography details, lock an element, write feedback, and store that feedback in Google Sheets. Developers can open the same app, see page comments anchored to selectors, and resolve feedback while implementing the review.
|
|
4
6
|
|
|
5
7
|
The package is intended to be mounted by the host app only when review mode is needed. It does not add a global launcher by default.
|
|
@@ -52,7 +54,8 @@ export function AppReviewMode() {
|
|
|
52
54
|
<ReviewLensProvider
|
|
53
55
|
config={{
|
|
54
56
|
googleClientId: import.meta.env.VITE_GOOGLE_CLIENT_ID,
|
|
55
|
-
|
|
57
|
+
contentSpreadsheetId: import.meta.env.VITE_REVIEW_LENS_CONTENT_SPREADSHEET_ID,
|
|
58
|
+
usersSpreadsheetId: import.meta.env.VITE_REVIEW_LENS_USERS_SPREADSHEET_ID,
|
|
56
59
|
projectKey: "landing-pages-app",
|
|
57
60
|
contentId: "article-123"
|
|
58
61
|
}}
|
|
@@ -92,7 +95,8 @@ Config:
|
|
|
92
95
|
| Name | Required | Description |
|
|
93
96
|
| --- | --- | --- |
|
|
94
97
|
| `googleClientId` | yes, unless `adapter` is provided | OAuth web client id from Google Cloud. |
|
|
95
|
-
| `
|
|
98
|
+
| `contentSpreadsheetId` | yes, unless `adapter` is provided | Google Sheet id for review feedback and messages. |
|
|
99
|
+
| `usersSpreadsheetId` | yes, unless `adapter` is provided | Google Sheet id for user roles and authentication metadata. |
|
|
96
100
|
| `sheetName` | no | Feedback sheet name. Defaults to `Feedback`. |
|
|
97
101
|
| `projectKey` | yes | Stable app/project key, for example `landing-pages-app`. |
|
|
98
102
|
| `contentId` | yes | Stable content key shared by localhost and production. |
|
|
@@ -100,6 +104,7 @@ Config:
|
|
|
100
104
|
| `normalizeUrl` | no | Custom URL normalization function. |
|
|
101
105
|
| `designTokens` | no | Allowed spacing, font size, line height, color, and radius values for advisory token checks. |
|
|
102
106
|
| `captureScreenshot` | no | Optional hook that captures a screenshot for a selected target. |
|
|
107
|
+
| `emailNotifications` | no | Enables Gmail notifications for authors and assignees. Requires the Gmail send scope. |
|
|
103
108
|
| `uploadAttachment` | no | Optional hook that stores screenshots and returns attachment URLs. |
|
|
104
109
|
| `adapter` | no | Custom storage adapter for tests, demos, or a future backend. |
|
|
105
110
|
|
|
@@ -143,12 +148,13 @@ Official references:
|
|
|
143
148
|
|
|
144
149
|
Open Google Cloud Console and choose the project that should own the OAuth client.
|
|
145
150
|
|
|
146
|
-
### 2. Enable Google
|
|
151
|
+
### 2. Enable Google APIs
|
|
147
152
|
|
|
148
153
|
In Google Cloud Console:
|
|
149
154
|
|
|
150
155
|
1. Go to `APIs & Services`.
|
|
151
156
|
2. Enable `Google Sheets API`.
|
|
157
|
+
3. Enable `Gmail API` when `emailNotifications` should send notification emails.
|
|
152
158
|
|
|
153
159
|
### 3. Configure OAuth consent
|
|
154
160
|
|
|
@@ -166,6 +172,37 @@ https://www.googleapis.com/auth/userinfo.email
|
|
|
166
172
|
|
|
167
173
|
The Sheets scope is used to read/write feedback rows. The email scope is used to match the signed-in Google account against the `Users` tab.
|
|
168
174
|
|
|
175
|
+
To send review notifications from the signed-in user's Gmail account, also add:
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
https://www.googleapis.com/auth/gmail.send
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Then enable notifications in the provider config:
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
<ReviewLensProvider
|
|
185
|
+
config={{
|
|
186
|
+
googleClientId,
|
|
187
|
+
contentSpreadsheetId,
|
|
188
|
+
usersSpreadsheetId,
|
|
189
|
+
projectKey: "demo",
|
|
190
|
+
contentId: "article-123",
|
|
191
|
+
emailNotifications: true
|
|
192
|
+
}}
|
|
193
|
+
>
|
|
194
|
+
{children}
|
|
195
|
+
</ReviewLensProvider>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Notification emails include a `reviewLensFeedback=<id>` link back to the selected feedback and state that they were sent by Review Lens on behalf of the signed-in user. The default Google adapter only requests the Gmail scope when `emailNotifications` is enabled.
|
|
199
|
+
|
|
200
|
+
The package also exports `ReviewLensLogo` for host apps that want to reuse the same mark in custom launchers or review entry points:
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
import { ReviewLensLogo } from "review-lens-react";
|
|
204
|
+
```
|
|
205
|
+
|
|
169
206
|
### 4. Create an OAuth web client
|
|
170
207
|
|
|
171
208
|
In Google Cloud Console:
|
|
@@ -186,15 +223,17 @@ https://your-production-app.example.com
|
|
|
186
223
|
|
|
187
224
|
Use the generated client id as `googleClientId`.
|
|
188
225
|
|
|
189
|
-
### 5. Create the Google
|
|
226
|
+
### 5. Create the Google Sheets
|
|
190
227
|
|
|
191
|
-
Create
|
|
228
|
+
Create a content Google Sheet and copy its id from the URL:
|
|
192
229
|
|
|
193
230
|
```text
|
|
194
231
|
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit
|
|
195
232
|
```
|
|
196
233
|
|
|
197
|
-
Share the Sheet with every reviewer/developer who should
|
|
234
|
+
Use this id as `contentSpreadsheetId`. Share the content Sheet with every reviewer/developer who should create or update review content.
|
|
235
|
+
|
|
236
|
+
Create a separate users/auth Google Sheet and use its id as `usersSpreadsheetId`. Normal reviewers only need read access to this Sheet; admins can keep write access to themselves.
|
|
198
237
|
|
|
199
238
|
### 6. Add the `Feedback` tab
|
|
200
239
|
|
|
@@ -214,7 +253,7 @@ Create a tab named `Messages` with this header row:
|
|
|
214
253
|
id,feedbackId,body,authorEmail,createdAt
|
|
215
254
|
```
|
|
216
255
|
|
|
217
|
-
### 8. Add the `Users` tab
|
|
256
|
+
### 8. Add the `Users` tab in the users Sheet
|
|
218
257
|
|
|
219
258
|
Create a tab named `Users` with this header row:
|
|
220
259
|
|
|
@@ -261,7 +300,8 @@ If your app has a different URL model, pass a custom normalizer:
|
|
|
261
300
|
<ReviewLensProvider
|
|
262
301
|
config={{
|
|
263
302
|
googleClientId,
|
|
264
|
-
|
|
303
|
+
contentSpreadsheetId,
|
|
304
|
+
usersSpreadsheetId,
|
|
265
305
|
projectKey: "landing-pages-app",
|
|
266
306
|
contentId: article.id,
|
|
267
307
|
normalizeUrl: (url) => new URL(url).pathname.replace(/^\/preview/, "")
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "./styles.css";
|
|
2
2
|
export { ReviewLensProvider, useReviewLens } from "./review-lens-provider";
|
|
3
3
|
export { ReviewLensOverlay } from "./review-lens-overlay";
|
|
4
|
+
export { ReviewLensLogo } from "./review-lens-logo";
|
|
4
5
|
export type { ReviewLensOverlayPlacement, ReviewLensViewportOption } from "./review-lens-overlay";
|
|
5
6
|
export { createGoogleSheetsAdapter } from "./sheets/google-sheets-adapter";
|
|
6
7
|
export { buildElementTarget } from "./selectors/build-element-target";
|
|
7
8
|
export { normalizeReviewUrl } from "./url/normalize-review-url";
|
|
8
|
-
export type { CssSnapshot, CreateAttachmentInput, CreateFeedbackInput, CreateMessageInput, ElementFingerprint, FeedbackCategory, FeedbackSeverity, FeedbackStatus, ReviewLensAttachment, ReviewLensAdapter, ReviewLensConfig, ReviewLensDesignTokens, ReviewLensFeedback, ReviewLensPermission, ReviewLensRole, ReviewLensTarget, ReviewLensThreadMessage, ReviewLensViewportPreset, UpdateFeedbackInput } from "./types";
|
|
9
|
+
export type { CssSnapshot, CreateAttachmentInput, CreateFeedbackInput, CreateMessageInput, ElementFingerprint, FeedbackCategory, FeedbackSeverity, FeedbackStatus, ReviewLensAttachment, ReviewLensAdapter, ReviewLensConfig, ReviewLensDesignTokens, ReviewLensEmailNotificationOptions, ReviewLensFeedback, ReviewLensPermission, ReviewLensRole, ReviewLensSendEmailInput, ReviewLensTarget, ReviewLensThreadMessage, ReviewLensViewportPreset, UpdateFeedbackInput } from "./types";
|