@veltdev/sdk-staging 5.0.2-beta.35 → 5.0.2-beta.36
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.
|
@@ -83,4 +83,9 @@ export declare class PresenceUser {
|
|
|
83
83
|
initial?: string;
|
|
84
84
|
isTabAway?: boolean;
|
|
85
85
|
isUserIdle?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether this custom user is local-only (not persisted to DB).
|
|
88
|
+
* Only applicable to users added via addUser API.
|
|
89
|
+
*/
|
|
90
|
+
localOnly?: boolean;
|
|
86
91
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { TargetTextRange } from './target-text-range.data.model';
|
|
2
|
+
import { RewriterEventTypes } from '../../utils/enums';
|
|
3
|
+
export interface TextSelectedEvent {
|
|
4
|
+
selectionId: string;
|
|
5
|
+
text: string;
|
|
6
|
+
targetTextRange: TargetTextRange;
|
|
7
|
+
}
|
|
8
|
+
export interface RewriterAskAiRequest {
|
|
9
|
+
model: string;
|
|
10
|
+
prompt: string;
|
|
11
|
+
selectedText: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RewriterReplaceTextRequest {
|
|
14
|
+
text: string;
|
|
15
|
+
event: TextSelectedEvent;
|
|
16
|
+
}
|
|
17
|
+
export interface RewriterAddCommentRequest {
|
|
18
|
+
text: string;
|
|
19
|
+
event: TextSelectedEvent;
|
|
20
|
+
}
|
|
21
|
+
export interface RewriterAskAiResponse {
|
|
22
|
+
text: string;
|
|
23
|
+
success: boolean;
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface RewriterReplaceTextResponse {
|
|
27
|
+
success: boolean;
|
|
28
|
+
originalText: string;
|
|
29
|
+
replacedText: string;
|
|
30
|
+
error?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface RewriterAddCommentResponse {
|
|
33
|
+
success: boolean;
|
|
34
|
+
annotationId?: string;
|
|
35
|
+
commentText?: string;
|
|
36
|
+
error?: string;
|
|
37
|
+
}
|
|
38
|
+
export type RewriterEventTypesMap = {
|
|
39
|
+
[RewriterEventTypes.TEXT_SELECTED]: TextSelectedEvent;
|
|
40
|
+
};
|
|
@@ -50,6 +50,21 @@ export declare class PresenceElement {
|
|
|
50
50
|
* Subscribe to presence events
|
|
51
51
|
*/
|
|
52
52
|
on: <T extends keyof PresenceEventTypesMap>(action: T) => Observable<PresenceEventTypesMap[T]>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Add a custom user to the presence list (e.g., an AI agent).
|
|
56
|
+
* The user will appear in presence alongside real users.
|
|
57
|
+
* @param request Object containing user data with at least userId required.
|
|
58
|
+
*/
|
|
59
|
+
addUser: (request: { user: Partial<PresenceUser>, localOnly?: boolean }) => void;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Remove a previously added custom user from the presence list.
|
|
63
|
+
* @param request Object containing user data with at least userId required, and optional localOnly flag.
|
|
64
|
+
* @param request.localOnly If true, user is only removed locally (not removed from DB). Default: false.
|
|
65
|
+
*/
|
|
66
|
+
removeUser: (request: { user: Partial<PresenceUser>, localOnly?: boolean }) => void;
|
|
67
|
+
|
|
53
68
|
constructor();
|
|
54
69
|
/**
|
|
55
70
|
* Subscribe to a list of all online users who are either active or inactive on the current document.
|
|
@@ -95,4 +110,14 @@ export declare class PresenceElement {
|
|
|
95
110
|
* Subscribe to presence events
|
|
96
111
|
*/
|
|
97
112
|
private _on;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Add a custom user to the presence list
|
|
116
|
+
*/
|
|
117
|
+
private _addUser;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Remove a custom user from the presence list
|
|
121
|
+
*/
|
|
122
|
+
private _removeUser;
|
|
98
123
|
}
|
package/app/utils/enums.d.ts
CHANGED
|
@@ -86,6 +86,9 @@ export declare const RecorderEventTypes: {
|
|
|
86
86
|
readonly RECORDING_STOPPED: "recordingStopped";
|
|
87
87
|
readonly RECORDING_DONE_LOCAL: "recordingDoneLocal";
|
|
88
88
|
};
|
|
89
|
+
export declare const RewriterEventTypes: {
|
|
90
|
+
readonly TEXT_SELECTED: "textSelected";
|
|
91
|
+
};
|
|
89
92
|
export declare const CoreEventTypes: {
|
|
90
93
|
readonly PERMISSION_PROVIDER: "permissionProvider";
|
|
91
94
|
readonly USER_RESOLVER: "userResolver";
|
|
@@ -126,6 +129,7 @@ export type CoreEventType = typeof CoreEventTypes[keyof typeof CoreEventTypes];
|
|
|
126
129
|
export type LiveStateSyncEventType = typeof LiveStateSyncEventTypes[keyof typeof LiveStateSyncEventTypes];
|
|
127
130
|
export type PresenceEventType = typeof PresenceEventTypes[keyof typeof PresenceEventTypes];
|
|
128
131
|
export type NotificationEventType = typeof NotificationEventTypes[keyof typeof NotificationEventTypes];
|
|
132
|
+
export type RewriterEventType = typeof RewriterEventTypes[keyof typeof RewriterEventTypes];
|
|
129
133
|
export type CrdtEventType = typeof CrdtEventTypes[keyof typeof CrdtEventTypes];
|
|
130
134
|
export declare enum TagStatus {
|
|
131
135
|
ADDED = "added",
|
package/models.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export * from './app/models/data/recorder.model';
|
|
|
49
49
|
export * from './app/models/data/recorder-annotation.data.model';
|
|
50
50
|
export * from './app/models/data/recorder-events.data.model';
|
|
51
51
|
export * from './app/models/data/rewriter-annotation.data.model';
|
|
52
|
+
export * from './app/models/data/rewriter-events.data.model';
|
|
52
53
|
export * from './app/models/data/screen-size.data.model';
|
|
53
54
|
export * from './app/models/data/screenshot.data.model';
|
|
54
55
|
export * from './app/models/data/selection.model';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltdev/sdk-staging",
|
|
3
|
-
"version": "5.0.2-beta.
|
|
3
|
+
"version": "5.0.2-beta.36",
|
|
4
4
|
"description": "Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.",
|
|
5
5
|
"homepage": "https://velt.dev",
|
|
6
6
|
"keywords": [
|