Skip to content

Commit 4164be1

Browse files
committed
Env docs with feedback applied
1 parent 56a00b5 commit 4164be1

File tree

3 files changed

+43
-142
lines changed

3 files changed

+43
-142
lines changed

async-collaboration/comments/customize-behavior.mdx

Lines changed: 22 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ commentElement.addCommentOnSelectedText();
9090

9191
Adds a Comment on a specific element by ID.
9292

93-
To add a comment on a specific element through an API method, use the `addCommentOnElement()` method and pass in an object with the schema shown in the examples:
93+
To add a comment on a specific element through an API method, use the `addCommentOnElement()` method and pass in an object with the schema shows in the example:
9494

9595
**Example 1: Add comment with targetElementId only:**
9696

@@ -100,17 +100,17 @@ To add a comment on a specific element through an API method, use the `addCommen
100100
```jsx
101101
const element = {
102102
"targetElement": {
103-
"elementId": "element_id",
103+
"elementId": "element_id", // optional (pass elementId if you want to add comment on a specific element)
104104
"targetText": "target_text", // optional (pass targetText if you want to add comment on a specific text)
105105
"occurrence": 1, // optional (default: 1) This is relevant for text comment. By default, we will attach comment to the first occurence of the target text in your document. You can change this to attach your comment on a more specific text.
106106
"selectAllContent": true, // Set to `true` if you want to select all the text content of the target element.
107107
},
108108
"commentData": [
109109
{
110-
"commentText": "This is awesome! Well done.",
111-
"commentHtml": "This <span style=\"color: green; background-color: aliceblue; display: inline-block; padding: 4px; border-radius: 4px;\">is test</span> comment.",
112-
"replaceContentText": "This is new comment",
113-
"replaceContentHtml": "<span>This is <b>new</b> comment.</span>",
110+
"commentText": "This is awesome! Well done.", // To set plain text content
111+
"commentHtml": "This <span style=\"color: green; background-color: aliceblue; display: inline-block; padding: 4px; border-radius: 4px;\">is test</span> comment.", // To set HTML formatted content
112+
"replaceContentText": "This is new comment", // provide this replaceContentText to replace current text with
113+
"replaceContentHtml": "<span>This is <b>new</b> comment.</span>", // If replacement text contains html formatted text, then provide it here
114114
}
115115
],
116116
"status": "open", // optional (default: open)
@@ -126,17 +126,17 @@ commentElement.addCommentOnElement(element);
126126
```jsx
127127
const element = {
128128
"targetElement": {
129-
"elementId": "element_id",
129+
"elementId": "element_id", // optional (pass elementId if you want to add comment on a specific element)
130130
"targetText": "target_text", // optional (pass targetText if you want to add comment on a specific text)
131131
"occurrence": 1, // optional (default: 1) This is relevant for text comment. By default, we will attach comment to the first occurence of the target text in your document. You can change this to attach your comment on a more specific text.
132132
"selectAllContent": true, // Set to `true` if you want to select all the text content of the target element.
133133
},
134134
"commentData": [
135135
{
136-
"commentText": "This is awesome! Well done.",
137-
"commentHtml": "This <span style=\"color: green; background-color: aliceblue; display: inline-block; padding: 4px; border-radius: 4px;\">is test</span> comment.",
138-
"replaceContentText": "This is new comment",
139-
"replaceContentHtml": "<span>This is <b>new</b> comment.</span>",
136+
"commentText": "This is awesome! Well done.", // To set plain text content
137+
"commentHtml": "This <span style=\"color: green; background-color: aliceblue; display: inline-block; padding: 4px; border-radius: 4px;\">is test</span> comment.", // To set HTML formatted content
138+
"replaceContentText": "This is new comment", // provide this replaceContentText to replace current text with
139+
"replaceContentHtml": "<span>This is <b>new</b> comment.</span>", // If replacement text contains html formatted text, then provide it here
140140
}
141141
],
142142
"status": "open", // optional (default: open)
@@ -148,58 +148,6 @@ commentElement.addCommentOnElement(element);
148148
</Tab>
149149
</Tabs>
150150

151-
**Example 2: Add comment with context metadata:**
152-
153-
<Tabs>
154-
<Tab title="React / Next.js">
155-
156-
```jsx
157-
const element = {
158-
"targetElement": {
159-
"elementId": "element_id",
160-
},
161-
"commentData": [
162-
{
163-
"commentText": "This is awesome! Well done.",
164-
}
165-
],
166-
"context": {
167-
"product": "cheese",
168-
"location": "zurich"
169-
},
170-
"status": "open",
171-
}
172-
173-
const commentElement = client.getCommentElement();
174-
commentElement.addCommentOnElement(element);
175-
```
176-
</Tab>
177-
178-
<Tab title="Other Frameworks">
179-
180-
```jsx
181-
const element = {
182-
"targetElement": {
183-
"elementId": "element_id",
184-
},
185-
"commentData": [
186-
{
187-
"commentText": "This is awesome! Well done.",
188-
}
189-
],
190-
"context": {
191-
"product": "cheese",
192-
"location": "zurich"
193-
},
194-
"status": "open",
195-
}
196-
197-
const commentElement = Velt.getCommentElement();
198-
commentElement.addCommentOnElement(element);
199-
```
200-
</Tab>
201-
</Tabs>
202-
203151
#### addManualComment
204152
- This feature is particularly useful for complex UIs where you need precise control over the placement of Comment Pins.
205153
- Using this you can manually set the position of Comment Annotations.
@@ -2118,33 +2066,18 @@ Extra fields in the comment context don't prevent a match.
21182066
{ product: "cheese", category: "dairy"} ❌ No match (missing field)
21192067
```
21202068
2121-
**Example 1: Comment Bubble with Partial Match**
2069+
**Example**
21222070
21232071
<Tabs>
21242072
<Tab title="React / Next.js">
21252073
```jsx
2074+
{/* Comment Bubble with Partial Match */}
21262075
<VeltCommentBubble
21272076
context={{ product: "cheese" }}
21282077
contextOptions={{ partialMatch: true }}
21292078
/>
2130-
```
2131-
</Tab>
2132-
<Tab title="Other Frameworks">
2133-
```html
2134-
<velt-comment-bubble
2135-
context='{ "product": "cheese" }'
2136-
context-options='{ "partialMatch": true }'
2137-
>
2138-
</velt-comment-bubble>
2139-
```
2140-
</Tab>
2141-
</Tabs>
21422079

2143-
**Example 2: Comment Tool with Partial Match**
2144-
2145-
<Tabs>
2146-
<Tab title="React / Next.js">
2147-
```jsx
2080+
{/* Comment Tool with Partial Match */}
21482081
<VeltCommentTool
21492082
targetElementId="element_id"
21502083
context={{ product: "cheese" }}
@@ -2154,6 +2087,14 @@ Extra fields in the comment context don't prevent a match.
21542087
</Tab>
21552088
<Tab title="Other Frameworks">
21562089
```html
2090+
<!-- Comment Bubble with Partial Match -->
2091+
<velt-comment-bubble
2092+
context='{ "product": "cheese" }'
2093+
context-options='{ "partialMatch": true }'
2094+
>
2095+
</velt-comment-bubble>
2096+
2097+
<!-- Comment Tool with Partial Match -->
21572098
<velt-comment-tool
21582099
target-element-id="element_id"
21592100
context='{ "product": "cheese" }'

async-collaboration/comments/setup/tiptap.mdx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ title: "Tiptap Setup"
3232
#### Step 2: Install the Velt Tiptap extension
3333

3434
```bash
35-
npm i @veltdev/tiptap-velt-comments @tiptap/react @tiptap/starter-kit
35+
npm i @veltdev/tiptap-velt-comments
3636
```
3737

3838
#### Step 3: Import and add the extension to your Tiptap editor
@@ -94,6 +94,7 @@ Add a button in your existing bubble menu or create a new bubble menu that appea
9494
<BubbleMenu editor={editor} tippyOptions={{ duration: 100 }}>
9595
<div className="bubble-menu">
9696
<button
97+
className="comment-button"
9798
onClick={(e) => {
9899
e.preventDefault();
99100
e.stopPropagation();
@@ -117,11 +118,27 @@ Add a button in your existing bubble menu or create a new bubble menu that appea
117118
```
118119
</Tab>
119120
<Tab title="Other Frameworks">
121+
```html
122+
<!-- HTML Structure -->
123+
<div id="editor"></div>
124+
<div class="bubble-menu">
125+
<button class="comment-button" title="Add comment">
126+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="currentColor">
127+
<path
128+
d="M10 17.25H4C3.30964 17.25 2.75 16.6904 2.75 16V10C2.75 5.99594 5.99594 2.75 10 2.75C14.0041 2.75 17.25 5.99594 17.25 10C17.25 14.0041 14.0041 17.25 10 17.25Z"
129+
stroke-width="1.5"
130+
/>
131+
</svg>
132+
</button>
133+
</div>
134+
```
135+
120136
```js
121137
import { BubbleMenu, Editor } from '@tiptap/core';
122138
import { addComment } from '@veltdev/tiptap-velt-comments';
123139

124140
const editor = new Editor({
141+
element: document.querySelector('#editor'),
125142
// ... your editor configuration
126143
});
127144

@@ -155,7 +172,7 @@ Refer to the [Tiptap BubbleMenu documentation](https://tiptap.dev/docs/editor/ex
155172
#### Step 5: Call `addComment` to add a comment
156173

157174
- Call this method to add a comment to selected text in the Tiptap editor. You can use this when the user clicks on the comment button in context menu or presses a keyboard shortcut.
158-
- Params: `AddCommentRequest`. It has the following properties:
175+
- Params: [`AddCommentRequest`](/api-reference/sdk/models/data-models#addcommentrequest). It has the following properties:
159176
- `editor`: instance of the Tiptap editor.
160177
- `editorId`: Id of the tiptap editor. Use this if you have multiple tiptap editors on the same page in your app. (optional)
161178
- `context`: Add any custom metadata to the Comment Annotation. [Learn more](/async-collaboration/comments/customize-behavior#metadata). (optional)
@@ -198,7 +215,7 @@ Refer to the [Tiptap BubbleMenu documentation](https://tiptap.dev/docs/editor/ex
198215
#### Step 6: Render Comments in Tiptap Editor
199216

200217
- Get the comment data from Velt SDK and render it in the Tiptap Editor.
201-
- Params: `RenderCommentsRequest`. It has the following properties:
218+
- Params: [`RenderCommentsRequest`](/api-reference/sdk/models/data-models#rendercommentsrequest). It has the following properties:
202219
- `editor`: Instance of the Tiptap editor.
203220
- `editorId`: Id of the tiptap editor. Use this if you have multiple tiptap editors on the same page in your app. (optional)
204221
- `commentAnnotations`: Array of Comment Annotation objects.

migration/environments.mdx

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Update environment variables, config files, and any hardcoded references.
3737

3838
Verify all features work with the production API key before going live.
3939

40-
**Regional keys (Enterprise only)**
40+
#### **Regional keys (Enterprise only)**
4141

4242
Enterprise customers can create production API keys for specific regions to reduce latency and meet data residency requirements. See [Supported Regions](/security/supported-regions) for all available regions.
4343

@@ -53,60 +53,3 @@ Create up to **10 API keys** for non-production environments. Use these for:
5353
- Individual developer environments
5454
- Testing and QA
5555

56-
## Data isolation
57-
58-
Each API key has completely separate:
59-
- Data (comments, recordings, etc.)
60-
- Feature configurations
61-
- Webhooks
62-
- Users and permissions
63-
- UI customization
64-
65-
<Warning>
66-
Settings and configurations do not automatically sync between environments. You must manually configure each environment.
67-
</Warning>
68-
69-
## Configuration management
70-
71-
When setting up a new environment, manually replicate these settings:
72-
73-
1. Feature configurations
74-
2. UI customization
75-
3. Webhook endpoints
76-
4. User permissions
77-
5. Integration settings
78-
79-
**Naming convention**
80-
81-
Use clear names to identify each environment:
82-
```
83-
production-na, production-eu
84-
staging-main, staging-feature-x
85-
dev-john, dev-sarah
86-
```
87-
88-
**Configuration tracking**
89-
90-
Document your settings per environment:
91-
- Enabled features
92-
- Webhook URLs
93-
- UI customizations
94-
- Permission rules
95-
96-
<Tip>
97-
Test configuration changes in staging before applying to production.
98-
</Tip>
99-
100-
## Managing API keys
101-
102-
Create and manage keys in the [Velt Console](https://console.velt.dev/):
103-
104-
1. Go to workspace settings
105-
2. Open API Keys section
106-
3. Click "Create New API Key"
107-
4. Name your environment
108-
5. Select environment type
109-
110-
<Warning>
111-
Store API keys in environment variables or a secrets manager. Never commit them to version control.
112-
</Warning>

0 commit comments

Comments
 (0)