@designfever/web-review-kit 0.6.0 → 0.7.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.
Files changed (41) hide show
  1. package/.env.sample +29 -0
  2. package/README.md +35 -10
  3. package/dist/chunk-AB5B6O77.js +584 -0
  4. package/dist/chunk-AB5B6O77.js.map +1 -0
  5. package/dist/{chunk-IN36JHEU.js → chunk-RPVLRULC.js} +504 -143
  6. package/dist/chunk-RPVLRULC.js.map +1 -0
  7. package/dist/image.types-BmzkFSPX.d.cts +71 -0
  8. package/dist/image.types-BmzkFSPX.d.ts +71 -0
  9. package/dist/index.cjs +1019 -144
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +27 -3
  12. package/dist/index.d.ts +27 -3
  13. package/dist/index.js +50 -3
  14. package/dist/index.js.map +1 -1
  15. package/dist/react-shell.cjs +10293 -5185
  16. package/dist/react-shell.cjs.map +1 -1
  17. package/dist/react-shell.d.cts +37 -4
  18. package/dist/react-shell.d.ts +37 -4
  19. package/dist/react-shell.js +9624 -4856
  20. package/dist/react-shell.js.map +1 -1
  21. package/dist/token-Dt-ZH-YO.d.cts +88 -0
  22. package/dist/token-nJXPPdYX.d.ts +88 -0
  23. package/dist/{types-DFHHVRBc.d.cts → types-DT9Z66mV.d.cts} +13 -1
  24. package/dist/{types-DFHHVRBc.d.ts → types-DT9Z66mV.d.ts} +13 -1
  25. package/dist/vite.cjs +1116 -5
  26. package/dist/vite.cjs.map +1 -1
  27. package/dist/vite.d.cts +45 -1
  28. package/dist/vite.d.ts +45 -1
  29. package/dist/vite.js +800 -5
  30. package/dist/vite.js.map +1 -1
  31. package/docs/README.md +11 -7
  32. package/docs/adapters.md +126 -0
  33. package/docs/adaptor.sample.ts +13 -1
  34. package/docs/architecture.md +2 -1
  35. package/docs/code-review-0.6.0.md +232 -0
  36. package/docs/db-setup.md +4 -2
  37. package/docs/figma-image-mvp-0.7.0.md +327 -0
  38. package/docs/installation.md +39 -7
  39. package/docs/release-notes-0.7.0.md +128 -0
  40. package/package.json +6 -2
  41. package/dist/chunk-IN36JHEU.js.map +0 -1
package/.env.sample ADDED
@@ -0,0 +1,29 @@
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 server/dev-only Figma image rendering token.
9
+ # This must stay in the dev/server process env. Do not expose it as VITE_*.
10
+ FIGMA_TOKEN=
11
+
12
+ # Optional Supabase remote adapter and presence.
13
+ # Leave URL/key empty for local-only review.
14
+ VITE_REVIEW_SUPABASE_URL=
15
+ VITE_REVIEW_SUPABASE_ANON_KEY=
16
+ VITE_REVIEW_SUPABASE_TABLE=review_items
17
+ VITE_REVIEW_SUPABASE_PRESENCE_PRIVATE=false
18
+
19
+ # Optional source opening / Source Tree.
20
+ # Set this when source hints store relative paths. Absolute source paths can
21
+ # open without it.
22
+ VITE_REVIEW_SOURCE_ROOT=/absolute/path/to/project
23
+
24
+ # Supported values: vscode, cursor, webstorm, custom.
25
+ VITE_REVIEW_SOURCE_EDITOR=cursor
26
+
27
+ # Required only when VITE_REVIEW_SOURCE_EDITOR=custom.
28
+ # Supported placeholders: {path}, {encodedPath}, {line}, {column}.
29
+ 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.6.0](docs/release-notes-0.6.0.md): latest shell/source tree changes and validation notes.
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
- ## Optional Supabase Env
87
+ ## Environment
78
88
 
79
- Only host projects that choose the Supabase adapter need these values.
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
- VITE_REVIEW_PROJECT_ID=df-web-review-kit
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
- Browser env must use a Supabase `anon` key only. Do not put `service_role` or OpenClaw operator secrets in a host browser env or in this package.
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,