@designfever/web-review-kit 0.1.0 → 0.3.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 (45) hide show
  1. package/README.md +77 -179
  2. package/dist/{chunk-U5K2YGGL.js → chunk-I76WEDLA.js} +2248 -2722
  3. package/dist/chunk-I76WEDLA.js.map +1 -0
  4. package/dist/index.cjs +2346 -2603
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +10 -6
  7. package/dist/index.d.ts +10 -6
  8. package/dist/index.js +220 -7
  9. package/dist/index.js.map +1 -1
  10. package/dist/react-shell.cjs +8953 -6632
  11. package/dist/react-shell.cjs.map +1 -1
  12. package/dist/react-shell.d.cts +8 -3
  13. package/dist/react-shell.d.ts +8 -3
  14. package/dist/react-shell.js +5956 -3636
  15. package/dist/react-shell.js.map +1 -1
  16. package/dist/{types-D_mNjOHx.d.cts → types-Cf2x5ky6.d.cts} +8 -14
  17. package/dist/{types-D_mNjOHx.d.ts → types-Cf2x5ky6.d.ts} +8 -14
  18. package/dist/vite.cjs +186 -0
  19. package/dist/vite.cjs.map +1 -0
  20. package/dist/vite.d.cts +16 -0
  21. package/dist/vite.d.ts +16 -0
  22. package/dist/vite.js +161 -0
  23. package/dist/vite.js.map +1 -0
  24. package/docs/README.md +21 -30
  25. package/docs/adaptor.sample.ts +182 -0
  26. package/docs/architecture.md +125 -0
  27. package/docs/db-setup.md +253 -0
  28. package/docs/figma-overlay.md +52 -0
  29. package/docs/grid-overlay.md +38 -0
  30. package/docs/installation.md +108 -40
  31. package/package.json +22 -6
  32. package/dist/chunk-U5K2YGGL.js.map +0 -1
  33. package/docs/adapter-handoff.md +0 -146
  34. package/docs/concept.md +0 -102
  35. package/docs/df-sheet-adapter.md +0 -336
  36. package/docs/df-sheet-next.md +0 -222
  37. package/docs/initial-plan.md +0 -226
  38. package/docs/package-split-checkpoint.md +0 -79
  39. package/docs/presence-handoff.md +0 -138
  40. package/docs/review-feedback-2026-06-20.md +0 -267
  41. package/docs/smoke-baseline-2026-06-20.md +0 -41
  42. package/docs/stabilize-ui-work-guide.md +0 -243
  43. package/docs/supabase-presence.md +0 -198
  44. package/docs/supabase-review-items.md +0 -365
  45. package/docs/supabase.md +0 -205
package/README.md CHANGED
@@ -2,240 +2,138 @@
2
2
 
3
3
  Designfever web page review overlay toolkit.
4
4
 
5
- `df-web-review-kit`는 프로젝트 안에 `/review` shell 붙이고, iframe으로 실제 page를 띄운 QA note/area/DOM marker를 생성하는 검수 도구다. 프로젝트는 adapter만 바꿔서 local draft, df-sheet, Supabase 같은 저장소를 선택한다.
5
+ `@designfever/web-review-kit` adds a `/review` shell to a host project. The shell opens real project pages in an iframe, creates QA notes/area/DOM markers, restores deep links, and lets each project choose its own storage adapter.
6
6
 
7
- 현재 Lexus pilot 기준:
7
+ ## Package Role
8
8
 
9
- - package name: `@designfever/web-review-kit`
10
- - current version: `0.1.0`
11
- - first route: `/review`
12
- - primary sources: `local`, `supabase`
13
- - optional remote direction: `df-sheet`
14
- - default overlay hotkey: `Shift+Q`
9
+ This package owns:
15
10
 
16
- ## Docs
11
+ - review shell UI
12
+ - local draft storage
13
+ - marker creation and restore logic
14
+ - adapter contracts
15
+ - custom adapter sample
16
+ - optional Supabase adapter samples
17
+ - grid/Figma overlay controls for host pages that already support them
17
18
 
18
- - [Concept](docs/concept.md): 제품 컨셉, local draft와 remote canonical QA 역할
19
- - [Installation](docs/installation.md): package 설치, `/review` mount, Vite/Lexus 예시
20
- - [Supabase setup](docs/supabase.md): Supabase item/presence 연결 절차
21
- - [Supabase review item SQL](docs/supabase-review-items.md): table, RPC, RLS, migration SQL
22
- - [Supabase presence](docs/supabase-presence.md): Realtime Presence adapter 구조
23
- - [Adapter handoff](docs/adapter-handoff.md): adapter contract와 분리 계획
24
- - [df-sheet next](docs/df-sheet-next.md): df-sheet를 remote destination으로 쓸 때의 방향
19
+ This package does not own internal operator tools, private admin keys, or production QA administration. OpenClaw tools such as `kuku` and future QA admin services stay outside the public npm package.
25
20
 
26
- `docs/initial-plan.md`는 초기 아이디어 기록이다. 현재 설치/운영 기준은 이 README와 위 문서를 우선한다.
21
+ ## Docs
27
22
 
28
- ## Quick Start
23
+ - [Installation](docs/installation.md): install the package and mount `/review`.
24
+ - [Custom adapter sample](docs/adaptor.sample.ts): starting point for host-owned remote adapters.
25
+ - [DB setup](docs/db-setup.md): optional Supabase `review_items` setup, RLS, presence notes, and validation.
26
+ - [Architecture and runtime logic](docs/architecture.md): core runtime, React shell, coordinate, anchor, and extension boundaries.
27
+ - [Figma overlay](docs/figma-overlay.md): how the shell toggles a host Figma overlay.
28
+ - [Grid overlay](docs/grid-overlay.md): how the shell toggles a host grid/helper overlay.
29
29
 
30
- Host project에 package와 React peer dependency를 설치한다.
30
+ ## Quick Start
31
31
 
32
32
  ```bash
33
33
  pnpm add @designfever/web-review-kit react react-dom
34
34
  ```
35
35
 
36
- Supabase를 remote/presence로 쓰면 host project에 Supabase client도 설치한다.
37
-
38
- ```bash
39
- pnpm add @supabase/supabase-js
40
- ```
41
-
42
- Vite project 예시:
36
+ Minimal Vite route:
43
37
 
44
38
  ```tsx
45
39
  import {
46
- createFallbackPresenceAdapter,
47
- createLocalPresenceAdapter,
48
40
  createReviewPagesFromGlob,
49
- createSupabasePresenceAdapter,
50
41
  mountReviewShell,
51
- type ReviewShellAdapter,
52
- type SupabasePresenceClient,
53
42
  } from '@designfever/web-review-kit/react-shell';
54
43
  import {
55
44
  REVIEW_WORKFLOW_STATUS_OPTIONS,
56
45
  localAdapter,
57
- supabaseAdapter,
58
- type SupabaseReviewClient,
59
46
  } from '@designfever/web-review-kit';
60
- import { createClient } from '@supabase/supabase-js';
61
-
62
- const REVIEW_PROJECT_ID = 'lexus-official-v2026';
63
- const REVIEW_PATH_PREFIX = '/review';
64
- const pages = createReviewPagesFromGlob(import.meta.glob('/**/index.tsx'), {
65
- exclude: (href) =>
66
- href === '/review/' ||
67
- href === '/guide/' ||
68
- href.startsWith('/guide/'),
69
- });
70
47
 
48
+ const projectId = 'my-project';
71
49
  const local = localAdapter({
72
- storageKey: `${REVIEW_PROJECT_ID}-review-items`,
73
- });
74
-
75
- const supabaseClient = import.meta.env.VITE_REVIEW_SUPABASE_ANON_KEY
76
- ? createClient(
77
- import.meta.env.VITE_REVIEW_SUPABASE_URL,
78
- import.meta.env.VITE_REVIEW_SUPABASE_ANON_KEY
79
- )
80
- : null;
81
-
82
- const supabase = supabaseClient
83
- ? supabaseAdapter({
84
- client: supabaseClient as unknown as SupabaseReviewClient,
85
- table: import.meta.env.VITE_REVIEW_SUPABASE_TABLE || 'review_items',
86
- projectId: REVIEW_PROJECT_ID,
87
- source: 'supabase',
88
- reviewPathPrefix: REVIEW_PATH_PREFIX,
89
- })
90
- : null;
91
-
92
- const adapters = [
93
- {
94
- label: 'local',
95
- get: (id) => local.get(id),
96
- list: (query) => local.list(query),
97
- create: (item) => local.create(item),
98
- statusOptions: REVIEW_WORKFLOW_STATUS_OPTIONS,
99
- updateStatus: ({ id, status }) => local.update(id, { status }),
100
- syncSubmission: ({ id, patch }) => local.update(id, patch),
101
- remove: (id) => local.remove(id),
102
- },
103
- ...(supabase
104
- ? [
105
- {
106
- label: 'supabase',
107
- get: (id) => supabase.get(id),
108
- list: (query) => supabase.list(query),
109
- create: (item) => supabase.create(item),
110
- statusOptions: REVIEW_WORKFLOW_STATUS_OPTIONS,
111
- updateStatus: ({ id, status }) => supabase.update(id, { status }),
112
- remove: (id) => supabase.remove(id),
113
- } satisfies ReviewShellAdapter,
114
- ]
115
- : []),
116
- ] satisfies ReviewShellAdapter[];
117
-
118
- const localPresence = createLocalPresenceAdapter({
119
- channelName: `${REVIEW_PROJECT_ID}:review-presence`,
50
+ storageKey: `${projectId}-review-items`,
120
51
  });
121
52
 
122
- const presence = supabaseClient
123
- ? createFallbackPresenceAdapter(
124
- createSupabasePresenceAdapter({
125
- client: supabaseClient as unknown as SupabasePresenceClient,
126
- channelPrefix: 'review-presence',
127
- private: import.meta.env.VITE_REVIEW_SUPABASE_PRESENCE_PRIVATE === 'true',
128
- }),
129
- localPresence
130
- )
131
- : localPresence;
132
-
133
53
  mountReviewShell({
134
- projectId: REVIEW_PROJECT_ID,
135
- pages,
136
- adapters,
137
- reviewPathPrefix: REVIEW_PATH_PREFIX,
138
- presence,
54
+ projectId,
55
+ pages: createReviewPagesFromGlob(import.meta.glob('/**/index.tsx'), {
56
+ exclude: (href) => href === '/review/',
57
+ }),
58
+ adapters: [
59
+ {
60
+ label: 'local',
61
+ get: (id) => local.get(id),
62
+ list: (query) => local.list(query),
63
+ create: (item) => local.create(item),
64
+ statusOptions: REVIEW_WORKFLOW_STATUS_OPTIONS,
65
+ updateStatus: ({ id, status }) => local.update(id, { status }),
66
+ syncSubmission: ({ id, patch }) => local.update(id, patch),
67
+ remove: (id) => local.remove(id),
68
+ },
69
+ ],
70
+ reviewPathPrefix: '/review',
139
71
  });
140
72
  ```
141
73
 
142
- ## Package boundary
143
-
144
- Public imports are limited to the export map:
145
-
146
- ```ts
147
- import { createWebReviewKit, localAdapter } from '@designfever/web-review-kit';
148
- import { mountReviewShell } from '@designfever/web-review-kit/react-shell';
149
- ```
150
-
151
- - `@designfever/web-review-kit`: core API, adapters, shared types.
152
- - `@designfever/web-review-kit/react-shell`: review shell UI, presence adapters, page glob helper.
153
- - `src/*` is not a public import path.
154
- - `react` and `react-dom` are peer dependencies.
155
- - `lucide-react` is currently bundled into the built shell output, not required from the host.
156
- - Published/packed files are `dist`, `docs`, and `README.md`; the Lexus `/review` page stays as a consumer smoke page outside the package surface.
74
+ See [Installation](docs/installation.md) for route files, Supabase adapter wiring, viewport presets, and verification commands.
157
75
 
158
- See [Package split checkpoint](docs/package-split-checkpoint.md) for the current split policy.
76
+ ## Optional Supabase Env
159
77
 
160
- ## Environment
78
+ Only host projects that choose the Supabase adapter need these values.
161
79
 
162
80
  ```env
81
+ VITE_REVIEW_PROJECT_ID=df-web-review-kit
163
82
  VITE_REVIEW_SUPABASE_URL=https://your-project.supabase.co
164
83
  VITE_REVIEW_SUPABASE_ANON_KEY=
165
84
  VITE_REVIEW_SUPABASE_TABLE=review_items
166
85
  VITE_REVIEW_SUPABASE_PRESENCE_PRIVATE=false
167
86
  ```
168
87
 
169
- Browser에는 Supabase `anon` key 넣는다. `service_role` key는 넣지 않는다.
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.
170
89
 
171
- ## Current Lexus Commands
90
+ ## Public Imports
172
91
 
173
- Lexus repo 안에서 package를 검증할 때:
174
-
175
- ```bash
176
- pnpm dev:review
177
- pnpm review-kit:typecheck
178
- pnpm typecheck:review
179
- pnpm review-kit:build
180
- pnpm build:review
181
- ```
182
-
183
- - `pnpm dev:review`: review-kit build 후 package watch와 Vite dev server 실행
184
- - `pnpm review-kit:typecheck`: package typecheck
185
- - `pnpm typecheck:review`: package + Lexus typecheck
186
- - `pnpm review-kit:build`: package dist build 후 Lexus `node_modules` sync
187
- - `pnpm build:review`: package dist build 후 Lexus SEO build
188
-
189
- 이 repo에서는 package를 file dependency로 소비한다.
190
-
191
- ```json
192
- "@designfever/web-review-kit": "file:packages/df-web-review-kit"
92
+ ```ts
93
+ import { createWebReviewKit, localAdapter } from '@designfever/web-review-kit';
94
+ import { mountReviewShell } from '@designfever/web-review-kit/react-shell';
95
+ import { reviewSourceLocator } from '@designfever/web-review-kit/vite';
193
96
  ```
194
97
 
195
- package source를 바꾸면 commit 전에 `pnpm review-kit:build`로 `dist`도 같이 갱신한다.
196
-
197
- ## Data Rules
98
+ - `@designfever/web-review-kit`: core API, adapters, shared types.
99
+ - `@designfever/web-review-kit/react-shell`: review shell UI, presence adapters, page glob helper.
100
+ - `@designfever/web-review-kit/vite`: dev-only JSX source locator for source file hints.
101
+ - `src/*` is not a public import path.
198
102
 
199
- - local item `#id`는 개인 draft 번호다.
200
- - remote source에 등록하면 remote adapter가 새 canonical `reviewNumber`를 발급한다.
201
- - local에서 remote 등록이 성공하면 local draft는 삭제한다.
202
- - item model에는 screenshot data URL을 넣지 않는다.
203
- - deep link restore는 `source`, `target`, `w`, `h`, `item` query를 기준으로 한다.
103
+ ## Optional Source Locator
204
104
 
205
- Example:
105
+ For local QA, add the Vite plugin to inject source hints into rendered DOM nodes.
206
106
 
207
- ```txt
208
- /review?source=supabase&target=/service/&w=540&h=1080&item=<remote-id>
107
+ ```ts
108
+ import { defineConfig } from 'vite';
109
+ import { reviewSourceLocator } from '@designfever/web-review-kit/vite';
110
+
111
+ export default defineConfig({
112
+ plugins: [
113
+ reviewSourceLocator({
114
+ enabled: true,
115
+ include: ['src'],
116
+ filePath: 'absolute',
117
+ }),
118
+ ],
119
+ });
209
120
  ```
210
121
 
211
- ## Verification
122
+ When source hints are available, `Option` + click inside the review target opens the source file in VS Code. DOM QA cards also show a source action when the saved item has source hints. Keep this plugin disabled for production builds because it writes source paths into the DOM.
212
123
 
213
- Docs-only:
124
+ ## Local Dev Harness
214
125
 
215
126
  ```bash
216
- git diff --check
127
+ pnpm dev:review
217
128
  ```
218
129
 
219
- Package source:
130
+ Open `http://127.0.0.1:5177/review/`.
220
131
 
221
- ```bash
222
- pnpm review-kit:typecheck
223
- pnpm review-kit:build
224
- ```
225
-
226
- Lexus integration:
132
+ Useful checks:
227
133
 
228
134
  ```bash
229
- pnpm typecheck:review
230
- pnpm build:review
135
+ pnpm typecheck
136
+ pnpm build
137
+ pnpm typecheck:dev
138
+ pnpm build:dev
231
139
  ```
232
-
233
- Manual smoke:
234
-
235
- 1. Open `/review`.
236
- 2. Load a target page.
237
- 3. Create local note, DOM note, and area item.
238
- 4. Submit local item to remote.
239
- 5. Confirm local draft is removed.
240
- 6. Switch to remote source and open the remote item.
241
- 7. Confirm route, viewport, scroll, marker, and prompt restore.