@designfever/web-review-kit 0.5.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 (42) hide show
  1. package/.env.sample +29 -0
  2. package/README.md +36 -10
  3. package/dist/chunk-AB5B6O77.js +584 -0
  4. package/dist/chunk-AB5B6O77.js.map +1 -0
  5. package/dist/{chunk-TWCSIBMY.js → chunk-RPVLRULC.js} +736 -201
  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 +1251 -202
  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 +10135 -4070
  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 +9258 -3707
  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-RvVa5ns-.d.cts → types-DT9Z66mV.d.cts} +14 -1
  24. package/dist/{types-RvVa5ns-.d.ts → types-DT9Z66mV.d.ts} +14 -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 -5
  32. package/docs/adapters.md +126 -0
  33. package/docs/adaptor.sample.ts +13 -1
  34. package/docs/architecture.md +6 -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 +44 -8
  39. package/docs/release-notes-0.6.0.md +108 -0
  40. package/docs/release-notes-0.7.0.md +128 -0
  41. package/package.json +6 -2
  42. package/dist/chunk-TWCSIBMY.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,11 +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.
31
+ - [Release notes 0.7.0](docs/release-notes-0.7.0.md): latest Figma image, QA field, and remote adapter loading changes.
29
32
 
30
33
  ## Quick Start
31
34
 
@@ -45,7 +48,7 @@ import {
45
48
  localAdapter,
46
49
  } from '@designfever/web-review-kit';
47
50
 
48
- const projectId = 'my-project';
51
+ const projectId = import.meta.env.VITE_REVIEW_PROJECT_ID || 'my-project';
49
52
  const local = localAdapter({
50
53
  storageKey: `${projectId}-review-items`,
51
54
  });
@@ -61,8 +64,16 @@ mountReviewShell({
61
64
  get: (id) => local.get(id),
62
65
  list: (query) => local.list(query),
63
66
  create: (item) => local.create(item),
67
+ fields: { title: true },
64
68
  statusOptions: REVIEW_WORKFLOW_STATUS_OPTIONS,
65
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 }),
66
77
  syncSubmission: ({ id, patch }) => local.update(id, patch),
67
78
  remove: (id) => local.remove(id),
68
79
  },
@@ -71,21 +82,36 @@ mountReviewShell({
71
82
  });
72
83
  ```
73
84
 
74
- 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.
75
86
 
76
- ## Optional Supabase Env
87
+ ## Environment
77
88
 
78
- 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.
79
98
 
80
99
  ```env
81
- VITE_REVIEW_PROJECT_ID=df-web-review-kit
82
- VITE_REVIEW_SUPABASE_URL=https://your-project.supabase.co
100
+ VITE_REVIEW_SUPABASE_URL=
83
101
  VITE_REVIEW_SUPABASE_ANON_KEY=
84
102
  VITE_REVIEW_SUPABASE_TABLE=review_items
85
103
  VITE_REVIEW_SUPABASE_PRESENCE_PRIVATE=false
86
104
  ```
87
105
 
88
- 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.
89
115
 
90
116
  ## Public Imports
91
117
 
@@ -130,16 +156,16 @@ export default defineConfig({
130
156
  });
131
157
  ```
132
158
 
133
- 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. DOM QA cards show a source action when the saved item has source hints. Keep these plugins disabled for production builds because they write source paths into the DOM.
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.
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}`.
134
162
 
135
163
  ```tsx
136
164
  mountReviewShell({
137
165
  projectId: REVIEW_PROJECT_ID,
138
166
  pages,
139
167
  adapters,
140
- sourceRoot: import.meta.env.VITE_REVIEW_SOURCE_ROOT,
141
168
  sourceInspector: {
142
- editor: 'cursor', // 'vscode' | 'cursor' | 'webstorm' | 'custom'
143
169
  maxDepth: 9,
144
170
  hoverOutline: true,
145
171
  includePlacer: false,