@csalvato/remarq 1.1.0 → 1.4.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.
- package/README.md +38 -41
- package/dist/feedback-layer.js +219 -206
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ Lightweight annotation and feedback layer for HTML documents. Add collaborative
|
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
- **Text Highlighting** - Select any text and add comments
|
|
10
|
+
- **Threaded Discussions** - Reply to annotations with nested conversations
|
|
11
|
+
- **Edit Comments** - Update your feedback anytime
|
|
12
|
+
- **Document-Order Display** - Annotations appear in reading order
|
|
13
|
+
- **Smart Anchoring** - Comments stay attached even when content changes
|
|
14
|
+
- **Filter & Resolve** - Mark feedback as resolved, toggle visibility
|
|
15
|
+
- **Zero Dependencies** - Just one script tag
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
@@ -56,7 +56,7 @@ Configure via data attributes on the script tag:
|
|
|
56
56
|
|
|
57
57
|
| Attribute | Required | Default | Description |
|
|
58
58
|
|-----------|----------|---------|-------------|
|
|
59
|
-
| `data-api-url` | Yes | - | URL of your
|
|
59
|
+
| `data-api-url` | Yes | - | URL of your Remarq server |
|
|
60
60
|
| `data-content-selector` | No | `"body"` | CSS selector for annotatable content |
|
|
61
61
|
| `data-document-uri` | No | `window.location.pathname` | Unique identifier for this document |
|
|
62
62
|
|
|
@@ -90,36 +90,43 @@ Configure via data attributes on the script tag:
|
|
|
90
90
|
></script>
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
##
|
|
93
|
+
## Comment Server
|
|
94
94
|
|
|
95
|
-
Remarq requires a backend server to store
|
|
95
|
+
Remarq requires a backend server to store comments.
|
|
96
96
|
|
|
97
|
-
### Quick Start with
|
|
98
|
-
|
|
99
|
-
Clone the repository and run the included server:
|
|
97
|
+
### Quick Start with Docker
|
|
100
98
|
|
|
101
99
|
```bash
|
|
102
|
-
# Clone the repo
|
|
103
100
|
git clone https://github.com/cass-clearly/remarq.git
|
|
104
|
-
cd remarq
|
|
105
|
-
|
|
106
|
-
# Start the server
|
|
107
|
-
npm install
|
|
108
|
-
node index.js
|
|
101
|
+
cd remarq
|
|
102
|
+
docker compose -f docker-compose.remarq.yml up --build
|
|
109
103
|
```
|
|
110
104
|
|
|
111
|
-
|
|
105
|
+
This starts Postgres and the Remarq server on `http://localhost:3333`. For production, create a `.env` file next to the compose file with `POSTGRES_PASSWORD=your-secure-password` — see the [main README](https://github.com/cass-clearly/remarq#production) for details.
|
|
112
106
|
|
|
113
107
|
### API Endpoints
|
|
114
108
|
|
|
115
|
-
The server
|
|
109
|
+
The server implements these endpoints:
|
|
110
|
+
|
|
111
|
+
**Documents**
|
|
112
|
+
|
|
113
|
+
| Method | Endpoint | Description |
|
|
114
|
+
|--------|----------|-------------|
|
|
115
|
+
| `GET` | `/documents` | List all documents |
|
|
116
|
+
| `POST` | `/documents` | Create or find a document by URI |
|
|
117
|
+
| `GET` | `/documents/:id` | Retrieve a document |
|
|
118
|
+
| `DELETE` | `/documents/:id` | Delete a document and its comments |
|
|
116
119
|
|
|
117
|
-
|
|
118
|
-
- `POST /api/annotations` - Create annotation
|
|
119
|
-
- `PATCH /api/annotations/:id` - Update annotation
|
|
120
|
-
- `DELETE /api/annotations/:id` - Delete annotation
|
|
120
|
+
**Comments**
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
| Method | Endpoint | Description |
|
|
123
|
+
|--------|----------|-------------|
|
|
124
|
+
| `GET` | `/comments?document=<id>` | List comments by document ID |
|
|
125
|
+
| `GET` | `/comments?uri=<url>` | List comments by document URI |
|
|
126
|
+
| `POST` | `/comments` | Create a comment |
|
|
127
|
+
| `GET` | `/comments/:id` | Retrieve a comment |
|
|
128
|
+
| `PATCH` | `/comments/:id` | Update body or status |
|
|
129
|
+
| `DELETE` | `/comments/:id` | Delete a comment and its replies |
|
|
123
130
|
|
|
124
131
|
## Usage
|
|
125
132
|
|
|
@@ -127,8 +134,8 @@ See the [API specification](./server/README.md) for details.
|
|
|
127
134
|
2. **Click "Annotate"** - Add your comment
|
|
128
135
|
3. **View annotations** - Click highlights or open the sidebar
|
|
129
136
|
4. **Reply** - Click "Reply" to start a discussion
|
|
130
|
-
5. **Edit** - Click the pencil icon
|
|
131
|
-
6. **Resolve** - Click the checkmark
|
|
137
|
+
5. **Edit** - Click the pencil icon to edit comments
|
|
138
|
+
6. **Resolve** - Click the checkmark to mark as resolved
|
|
132
139
|
|
|
133
140
|
## Keyboard Shortcuts
|
|
134
141
|
|
|
@@ -143,27 +150,17 @@ See the [API specification](./server/README.md) for details.
|
|
|
143
150
|
## Development
|
|
144
151
|
|
|
145
152
|
```bash
|
|
146
|
-
# Clone the repo
|
|
147
153
|
git clone https://github.com/cass-clearly/remarq.git
|
|
148
154
|
cd remarq/feedback-layer
|
|
149
155
|
|
|
150
|
-
# Install dependencies
|
|
151
156
|
npm install
|
|
152
|
-
|
|
153
|
-
#
|
|
154
|
-
npm run build
|
|
155
|
-
|
|
156
|
-
# Watch mode
|
|
157
|
-
npm run watch
|
|
157
|
+
npm run build # one-off build
|
|
158
|
+
npm run watch # rebuild on changes
|
|
158
159
|
```
|
|
159
160
|
|
|
160
161
|
## License
|
|
161
162
|
|
|
162
|
-
MIT
|
|
163
|
-
|
|
164
|
-
## Contributing
|
|
165
|
-
|
|
166
|
-
Contributions welcome! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) first.
|
|
163
|
+
MIT
|
|
167
164
|
|
|
168
165
|
## Credits
|
|
169
166
|
|