@designfever/web-review-kit 0.6.0 → 0.7.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/.env.sample +32 -0
- package/README.md +35 -10
- package/dist/chunk-2ZLU5FTD.js +602 -0
- package/dist/chunk-2ZLU5FTD.js.map +1 -0
- package/dist/{chunk-IN36JHEU.js → chunk-RPVLRULC.js} +504 -143
- package/dist/chunk-RPVLRULC.js.map +1 -0
- package/dist/image.types-BmzkFSPX.d.cts +71 -0
- package/dist/image.types-BmzkFSPX.d.ts +71 -0
- package/dist/index.cjs +1037 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.js +50 -3
- package/dist/index.js.map +1 -1
- package/dist/react-shell.cjs +10339 -5168
- package/dist/react-shell.cjs.map +1 -1
- package/dist/react-shell.d.cts +39 -4
- package/dist/react-shell.d.ts +39 -4
- package/dist/react-shell.js +9687 -4856
- package/dist/react-shell.js.map +1 -1
- package/dist/token-Dt-ZH-YO.d.cts +88 -0
- package/dist/token-nJXPPdYX.d.ts +88 -0
- package/dist/{types-DFHHVRBc.d.cts → types-DT9Z66mV.d.cts} +13 -1
- package/dist/{types-DFHHVRBc.d.ts → types-DT9Z66mV.d.ts} +13 -1
- package/dist/vite.cjs +1144 -5
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +45 -1
- package/dist/vite.d.ts +45 -1
- package/dist/vite.js +829 -5
- package/dist/vite.js.map +1 -1
- package/docs/README.md +13 -7
- package/docs/adapters.md +128 -0
- package/docs/adaptor.sample.ts +13 -1
- package/docs/architecture.md +2 -1
- package/docs/code-review-0.6.0.md +232 -0
- package/docs/db-setup.md +4 -2
- package/docs/figma-image-mvp-0.7.0.md +330 -0
- package/docs/figma-overlay.md +11 -4
- package/docs/installation.md +42 -7
- package/docs/release-notes-0.7.0.md +132 -0
- package/docs/release-notes-0.7.1.md +34 -0
- package/package.json +6 -2
- package/dist/chunk-IN36JHEU.js.map +0 -1
package/.env.sample
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# df-web-review-kit host project env sample
|
|
2
|
+
# Copy this file into the host project as `.env.local`.
|
|
3
|
+
# Vite exposes `VITE_*` values to browser code, so keep secrets out of here.
|
|
4
|
+
|
|
5
|
+
# Review project id. Used for storage keys, remote item filtering, and presence.
|
|
6
|
+
VITE_REVIEW_PROJECT_ID=my-project
|
|
7
|
+
|
|
8
|
+
# Optional default reviewer id. Settings localStorage user-id still wins.
|
|
9
|
+
VITE_REVIEW_USER_ID=
|
|
10
|
+
|
|
11
|
+
# Optional server/dev-only Figma image rendering token.
|
|
12
|
+
# This must stay in the dev/server process env. Do not expose it as VITE_*.
|
|
13
|
+
FIGMA_TOKEN=
|
|
14
|
+
|
|
15
|
+
# Optional Supabase remote adapter and presence.
|
|
16
|
+
# Leave URL/key empty for local-only review.
|
|
17
|
+
VITE_REVIEW_SUPABASE_URL=
|
|
18
|
+
VITE_REVIEW_SUPABASE_ANON_KEY=
|
|
19
|
+
VITE_REVIEW_SUPABASE_TABLE=review_items
|
|
20
|
+
VITE_REVIEW_SUPABASE_PRESENCE_PRIVATE=false
|
|
21
|
+
|
|
22
|
+
# Optional source opening / Source Tree.
|
|
23
|
+
# Set this when source hints store relative paths. Absolute source paths can
|
|
24
|
+
# open without it.
|
|
25
|
+
VITE_REVIEW_SOURCE_ROOT=/absolute/path/to/project
|
|
26
|
+
|
|
27
|
+
# Supported values: vscode, cursor, webstorm, custom.
|
|
28
|
+
VITE_REVIEW_SOURCE_EDITOR=cursor
|
|
29
|
+
|
|
30
|
+
# Required only when VITE_REVIEW_SOURCE_EDITOR=custom.
|
|
31
|
+
# Supported placeholders: {path}, {encodedPath}, {line}, {column}.
|
|
32
|
+
VITE_REVIEW_SOURCE_URL_TEMPLATE=
|
package/README.md
CHANGED
|
@@ -21,12 +21,14 @@ This package does not own internal operator tools, private admin keys, or produc
|
|
|
21
21
|
## Docs
|
|
22
22
|
|
|
23
23
|
- [Installation](docs/installation.md): install the package and mount `/review`.
|
|
24
|
+
- [.env.sample](.env.sample): copyable host project env template for local, Supabase, and source opening.
|
|
25
|
+
- [Adapter boundaries](docs/adapters.md): QA adapter vs Figma image store responsibilities.
|
|
24
26
|
- [Custom adapter sample](docs/adaptor.sample.ts): starting point for host-owned remote adapters.
|
|
25
27
|
- [DB setup](docs/db-setup.md): optional Supabase `review_items` setup, RLS, presence notes, and validation.
|
|
26
28
|
- [Architecture and runtime logic](docs/architecture.md): core runtime, React shell, coordinate, anchor, and extension boundaries.
|
|
27
29
|
- [Figma overlay](docs/figma-overlay.md): how the shell toggles a host Figma overlay.
|
|
28
30
|
- [Grid overlay](docs/grid-overlay.md): how the shell toggles a host grid/helper overlay.
|
|
29
|
-
- [Release notes 0.
|
|
31
|
+
- [Release notes 0.7.0](docs/release-notes-0.7.0.md): latest Figma image, QA field, and remote adapter loading changes.
|
|
30
32
|
|
|
31
33
|
## Quick Start
|
|
32
34
|
|
|
@@ -46,7 +48,7 @@ import {
|
|
|
46
48
|
localAdapter,
|
|
47
49
|
} from '@designfever/web-review-kit';
|
|
48
50
|
|
|
49
|
-
const projectId = 'my-project';
|
|
51
|
+
const projectId = import.meta.env.VITE_REVIEW_PROJECT_ID || 'my-project';
|
|
50
52
|
const local = localAdapter({
|
|
51
53
|
storageKey: `${projectId}-review-items`,
|
|
52
54
|
});
|
|
@@ -62,8 +64,16 @@ mountReviewShell({
|
|
|
62
64
|
get: (id) => local.get(id),
|
|
63
65
|
list: (query) => local.list(query),
|
|
64
66
|
create: (item) => local.create(item),
|
|
67
|
+
fields: { title: true },
|
|
65
68
|
statusOptions: REVIEW_WORKFLOW_STATUS_OPTIONS,
|
|
66
69
|
updateStatus: ({ id, status }) => local.update(id, { status }),
|
|
70
|
+
assigneeTitle: 'Assignee',
|
|
71
|
+
assigneeOptions: [
|
|
72
|
+
{ value: 'planning', label: 'Planning' },
|
|
73
|
+
{ value: 'frontend', label: 'Frontend' },
|
|
74
|
+
],
|
|
75
|
+
updateAssignee: ({ id, assigneeId, assigneeName }) =>
|
|
76
|
+
local.update(id, { assigneeId, assigneeName }),
|
|
67
77
|
syncSubmission: ({ id, patch }) => local.update(id, patch),
|
|
68
78
|
remove: (id) => local.remove(id),
|
|
69
79
|
},
|
|
@@ -72,21 +82,36 @@ mountReviewShell({
|
|
|
72
82
|
});
|
|
73
83
|
```
|
|
74
84
|
|
|
75
|
-
See [Installation](docs/installation.md) for route files, Supabase adapter wiring, viewport presets, and verification commands.
|
|
85
|
+
See [Installation](docs/installation.md) for route files, `.env.sample`, Supabase adapter wiring, viewport presets, and verification commands.
|
|
76
86
|
|
|
77
|
-
##
|
|
87
|
+
## Environment
|
|
78
88
|
|
|
79
|
-
|
|
89
|
+
Copy [.env.sample](.env.sample) into the host project as `.env.local`, then fill only the values that project needs.
|
|
90
|
+
|
|
91
|
+
Local-only review needs only `VITE_REVIEW_PROJECT_ID`.
|
|
92
|
+
|
|
93
|
+
```env
|
|
94
|
+
VITE_REVIEW_PROJECT_ID=my-project
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Only host projects that choose the Supabase adapter need Supabase values.
|
|
80
98
|
|
|
81
99
|
```env
|
|
82
|
-
|
|
83
|
-
VITE_REVIEW_SUPABASE_URL=https://your-project.supabase.co
|
|
100
|
+
VITE_REVIEW_SUPABASE_URL=
|
|
84
101
|
VITE_REVIEW_SUPABASE_ANON_KEY=
|
|
85
102
|
VITE_REVIEW_SUPABASE_TABLE=review_items
|
|
86
103
|
VITE_REVIEW_SUPABASE_PRESENCE_PRIVATE=false
|
|
87
104
|
```
|
|
88
105
|
|
|
89
|
-
|
|
106
|
+
Source opening / Source Tree can also be configured from env.
|
|
107
|
+
|
|
108
|
+
```env
|
|
109
|
+
VITE_REVIEW_SOURCE_ROOT=/absolute/path/to/project
|
|
110
|
+
VITE_REVIEW_SOURCE_EDITOR=cursor
|
|
111
|
+
VITE_REVIEW_SOURCE_URL_TEMPLATE=
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Browser env must use a Supabase `anon` key only. Do not put `service_role`, OpenClaw operator secrets, or private admin keys in a host browser env or in this package.
|
|
90
115
|
|
|
91
116
|
## Public Imports
|
|
92
117
|
|
|
@@ -133,14 +158,14 @@ export default defineConfig({
|
|
|
133
158
|
|
|
134
159
|
When source hints are available, hold `Option` over the review target to inspect source candidates from the DOM ancestry. Click the target to pin the candidate list, then choose a file to open. The side rail can also open a Source Tree panel with section/source/data links, live box metrics, text/font/media metadata, and class tags. DOM QA cards show a source action when the saved item has source hints. Source Tree filter/options, QA panel mode, and QA status filter are stored in browser localStorage. Keep these plugins disabled for production builds because they write source paths into the DOM.
|
|
135
160
|
|
|
161
|
+
In Vite/ESM hosts, source opening reads `VITE_REVIEW_SOURCE_ROOT`, `VITE_REVIEW_SOURCE_EDITOR`, and `VITE_REVIEW_SOURCE_URL_TEMPLATE` from the host env. Env values override matching `sourceRoot`, `sourceInspector.editor`, and `sourceInspector.urlTemplate` init values; init values still work as a fallback for existing projects and CommonJS consumers. Use `VITE_REVIEW_SOURCE_URL_TEMPLATE` only with `VITE_REVIEW_SOURCE_EDITOR=custom`; the template supports `{path}`, `{encodedPath}`, `{line}`, and `{column}`.
|
|
162
|
+
|
|
136
163
|
```tsx
|
|
137
164
|
mountReviewShell({
|
|
138
165
|
projectId: REVIEW_PROJECT_ID,
|
|
139
166
|
pages,
|
|
140
167
|
adapters,
|
|
141
|
-
sourceRoot: import.meta.env.VITE_REVIEW_SOURCE_ROOT,
|
|
142
168
|
sourceInspector: {
|
|
143
|
-
editor: 'cursor', // 'vscode' | 'cursor' | 'webstorm' | 'custom'
|
|
144
169
|
maxDepth: 9,
|
|
145
170
|
hoverOutline: true,
|
|
146
171
|
includePlacer: false,
|