@designfever/web-review-kit 0.1.0 → 0.2.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 (39) hide show
  1. package/README.md +59 -184
  2. package/dist/{chunk-U5K2YGGL.js → chunk-EJDROXJM.js} +2583 -3085
  3. package/dist/chunk-EJDROXJM.js.map +1 -0
  4. package/dist/index.cjs +2615 -2900
  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 +8364 -6651
  11. package/dist/react-shell.cjs.map +1 -1
  12. package/dist/react-shell.d.cts +7 -3
  13. package/dist/react-shell.d.ts +7 -3
  14. package/dist/react-shell.js +5163 -3425
  15. package/dist/react-shell.js.map +1 -1
  16. package/dist/{types-D_mNjOHx.d.cts → types-NiCp9JJQ.d.cts} +6 -14
  17. package/dist/{types-D_mNjOHx.d.ts → types-NiCp9JJQ.d.ts} +6 -14
  18. package/docs/README.md +21 -30
  19. package/docs/adaptor.sample.ts +182 -0
  20. package/docs/architecture.md +125 -0
  21. package/docs/db-setup.md +253 -0
  22. package/docs/figma-overlay.md +52 -0
  23. package/docs/grid-overlay.md +38 -0
  24. package/docs/installation.md +75 -40
  25. package/package.json +8 -3
  26. package/dist/chunk-U5K2YGGL.js.map +0 -1
  27. package/docs/adapter-handoff.md +0 -146
  28. package/docs/concept.md +0 -102
  29. package/docs/df-sheet-adapter.md +0 -336
  30. package/docs/df-sheet-next.md +0 -222
  31. package/docs/initial-plan.md +0 -226
  32. package/docs/package-split-checkpoint.md +0 -79
  33. package/docs/presence-handoff.md +0 -138
  34. package/docs/review-feedback-2026-06-20.md +0 -267
  35. package/docs/smoke-baseline-2026-06-20.md +0 -41
  36. package/docs/stabilize-ui-work-guide.md +0 -243
  37. package/docs/supabase-presence.md +0 -198
  38. package/docs/supabase-review-items.md +0 -365
  39. package/docs/supabase.md +0 -205
package/README.md CHANGED
@@ -2,240 +2,115 @@
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`,
50
+ storageKey: `${projectId}-review-items`,
73
51
  });
74
52
 
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`,
120
- });
121
-
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
74
+ See [Installation](docs/installation.md) for route files, Supabase adapter wiring, viewport presets, and verification commands.
143
75
 
144
- Public imports are limited to the export map:
76
+ ## Optional Supabase Env
145
77
 
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.
157
-
158
- See [Package split checkpoint](docs/package-split-checkpoint.md) for the current split policy.
159
-
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는 넣지 않는다.
170
-
171
- ## Current Lexus Commands
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.
172
89
 
173
- Lexus repo 안에서 package를 검증할 때:
90
+ ## Public Imports
174
91
 
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"
193
- ```
194
-
195
- package source를 바꾸면 commit 전에 `pnpm review-kit:build`로 `dist`도 같이 갱신한다.
196
-
197
- ## Data Rules
198
-
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를 기준으로 한다.
204
-
205
- Example:
206
-
207
- ```txt
208
- /review?source=supabase&target=/service/&w=540&h=1080&item=<remote-id>
92
+ ```ts
93
+ import { createWebReviewKit, localAdapter } from '@designfever/web-review-kit';
94
+ import { mountReviewShell } from '@designfever/web-review-kit/react-shell';
209
95
  ```
210
96
 
211
- ## Verification
97
+ - `@designfever/web-review-kit`: core API, adapters, shared types.
98
+ - `@designfever/web-review-kit/react-shell`: review shell UI, presence adapters, page glob helper.
99
+ - `src/*` is not a public import path.
212
100
 
213
- Docs-only:
101
+ ## Local Dev Harness
214
102
 
215
103
  ```bash
216
- git diff --check
104
+ pnpm dev:review
217
105
  ```
218
106
 
219
- Package source:
107
+ Open `http://127.0.0.1:5177/review/`.
220
108
 
221
- ```bash
222
- pnpm review-kit:typecheck
223
- pnpm review-kit:build
224
- ```
225
-
226
- Lexus integration:
109
+ Useful checks:
227
110
 
228
111
  ```bash
229
- pnpm typecheck:review
230
- pnpm build:review
112
+ pnpm typecheck
113
+ pnpm build
114
+ pnpm typecheck:dev
115
+ pnpm build:dev
231
116
  ```
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.