web-remarq 0.1.9 → 0.1.10
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/README.md +41 -8
- package/package.json +13 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Visual annotation tool for design review workflows. Framework-agnostic, zero dependencies.
|
|
4
4
|
|
|
5
|
-
Designer annotates UI elements on staging/dev, exports a report. Developer imports the report and sees markers on the exact elements.
|
|
5
|
+
Designer annotates UI elements on staging/dev, exports a report. Developer imports the report and sees markers on the exact elements. Copy annotations as agent-friendly markdown with search hints for AI coding agents.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -47,19 +47,23 @@ Remove all DOM nodes, event listeners, and observers. Full cleanup.
|
|
|
47
47
|
|
|
48
48
|
Switch between `'light'` and `'dark'` themes.
|
|
49
49
|
|
|
50
|
+
### `WebRemarq.copy()`
|
|
51
|
+
|
|
52
|
+
Copy annotations as agent-friendly markdown to clipboard. Includes ranked search hints (CSS selectors, class names, text content, DOM path) so AI coding agents can grep and locate the source code.
|
|
53
|
+
|
|
50
54
|
### `WebRemarq.export(format)`
|
|
51
55
|
|
|
52
|
-
- `'md'` —
|
|
56
|
+
- `'md'` — downloads `.md` file with search hints (same content as `copy()`)
|
|
53
57
|
- `'json'` — downloads `.json` file with full annotation data
|
|
54
58
|
|
|
55
59
|
### `WebRemarq.import(file)`
|
|
56
60
|
|
|
57
|
-
Import annotations from a JSON file. Returns `Promise<{ total, matched, detached }>`.
|
|
61
|
+
Import annotations from a JSON file. Returns `Promise<{ total, matched, otherBreakpoint, detached }>`.
|
|
58
62
|
|
|
59
63
|
```ts
|
|
60
64
|
const input = document.querySelector('input[type="file"]')
|
|
61
65
|
const result = await WebRemarq.import(input.files[0])
|
|
62
|
-
// { total: 12, matched: 10, detached:
|
|
66
|
+
// { total: 12, matched: 10, otherBreakpoint: 1, detached: 1 }
|
|
63
67
|
```
|
|
64
68
|
|
|
65
69
|
### `WebRemarq.getAnnotations(route?)`
|
|
@@ -91,8 +95,9 @@ When a user clicks an element, a multi-signal fingerprint is captured:
|
|
|
91
95
|
|
|
92
96
|
- **Stable anchors** — `data-annotate`, `data-testid`, `id`
|
|
93
97
|
- **Semantics** — tag name, text content, ARIA role/label
|
|
94
|
-
- **Structure** — stable CSS classes (hashes stripped), DOM path, sibling index
|
|
98
|
+
- **Structure** — stable CSS classes (hashes stripped), DOM path with parent classes, sibling index
|
|
95
99
|
- **Parent context** — nearest ancestor's `data-annotate` value
|
|
100
|
+
- **Agent export** — raw classes, CSS Module decomposition (module hint + local class name)
|
|
96
101
|
|
|
97
102
|
### Matching
|
|
98
103
|
|
|
@@ -101,7 +106,34 @@ When loading annotations, elements are found via a fallback chain:
|
|
|
101
106
|
1. Exact match by `data-annotate` or `data-testid`
|
|
102
107
|
2. Exact match by `id`
|
|
103
108
|
3. Fuzzy match using weighted scoring (text similarity, ARIA, classes, DOM path)
|
|
104
|
-
4. Unmatched annotations
|
|
109
|
+
4. Unmatched annotations sorted into "other viewport" or "detached" panels
|
|
110
|
+
|
|
111
|
+
### Viewport Breakpoints
|
|
112
|
+
|
|
113
|
+
Annotations are tagged with a viewport bucket (width rounded to 100px). When resizing:
|
|
114
|
+
|
|
115
|
+
- **Attached** — element found in current viewport
|
|
116
|
+
- **Other viewport** — element not found, but annotation belongs to a different breakpoint (not an error)
|
|
117
|
+
- **Detached** — element not found even in its native breakpoint (real problem)
|
|
118
|
+
|
|
119
|
+
Automatic reconnection when returning to the annotation's native viewport.
|
|
120
|
+
|
|
121
|
+
### Agent-Friendly Copy
|
|
122
|
+
|
|
123
|
+
The Copy button produces markdown with ranked search hints:
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
### 1. [pending] "Button too small on mobile"
|
|
127
|
+
Element: <button> "Submit"
|
|
128
|
+
Viewport: 300px
|
|
129
|
+
|
|
130
|
+
Search hints:
|
|
131
|
+
- `data-testid="submit-btn"` — in template files
|
|
132
|
+
- `"Submit"` — text content in templates
|
|
133
|
+
- `.submitButton` — in CSS Module file (likely `form.module.*`)
|
|
134
|
+
- DOM: div.form-wrapper > form > button.submit
|
|
135
|
+
- Classes: form__submitButton__cEqts flex items-center
|
|
136
|
+
```
|
|
105
137
|
|
|
106
138
|
### Hash Detection
|
|
107
139
|
|
|
@@ -122,11 +154,12 @@ Works without any markup changes, but for guaranteed stable matching add `data-a
|
|
|
122
154
|
|
|
123
155
|
## UI Components
|
|
124
156
|
|
|
125
|
-
- **Toolbar** — fixed bottom-right panel with inspect, export, import, clear, theme, minimize
|
|
157
|
+
- **Toolbar** — fixed bottom-right panel with inspect, copy, export, import, clear, theme, minimize
|
|
126
158
|
- **Inspect mode** — hover to highlight, click to annotate
|
|
127
159
|
- **Markers** — numbered circles (orange = pending, green = resolved)
|
|
128
160
|
- **Popup** — comment input for new annotations, detail view with Resolve/Delete for existing
|
|
129
|
-
- **
|
|
161
|
+
- **Other viewport panel** — annotations from different breakpoints, click to see required viewport
|
|
162
|
+
- **Detached panel** — annotations whose elements can't be found in their native viewport
|
|
130
163
|
|
|
131
164
|
## Build Outputs
|
|
132
165
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-remarq",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Visual annotation tool for design review workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -34,6 +34,18 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/DPostnik/web-remarq/issues"
|
|
36
36
|
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"annotation",
|
|
39
|
+
"design-review",
|
|
40
|
+
"visual-feedback",
|
|
41
|
+
"ui-review",
|
|
42
|
+
"qa",
|
|
43
|
+
"element-inspector",
|
|
44
|
+
"ai-agent",
|
|
45
|
+
"design-handoff",
|
|
46
|
+
"web-annotation",
|
|
47
|
+
"dom-fingerprint"
|
|
48
|
+
],
|
|
37
49
|
"license": "MIT",
|
|
38
50
|
"devDependencies": {
|
|
39
51
|
"tsup": "^8.5.1",
|