@veltdev/sdk-staging 5.0.0-beta.1 → 5.0.0-beta.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.
@@ -305,6 +305,11 @@ export declare class Snippyly {
305
305
  */
306
306
  getUserPermissions: (request?: GetUserPermissionsRequest) => Promise<GetUserPermissionsResponse>;
307
307
 
308
+ /**
309
+ * To get current user permissions.
310
+ */
311
+ getCurrentUserPermissions: () => Observable<GetUserPermissionsResponse | null>;
312
+
308
313
  /**
309
314
  * To check if plan is expired or not.
310
315
  */
@@ -41,9 +41,29 @@ export interface CopyLinkRequest {
41
41
  annotationId: string;
42
42
  options?: RequestOptions;
43
43
  }
44
+ /**
45
+ * Visibility type for comment annotations.
46
+ * - 'public': Visible to everyone (default:velt)
47
+ * - 'organization': Visible only to users in the specified organization
48
+ * - 'self': Visible only to specified users (private comments)
49
+ */
50
+ export type CommentVisibilityType = 'public' | 'organization' | 'self';
51
+ /**
52
+ * Configuration for comment visibility/access control.
53
+ */
54
+ export interface CommentVisibilityConfig {
55
+ /** The type of visibility for the comment */
56
+ type: CommentVisibilityType;
57
+ /** Organization ID for 'organization' type visibility */
58
+ organizationId?: string;
59
+ /** User IDs for 'self' type visibility - array of user IDs who can see the comment */
60
+ userIds?: string[];
61
+ }
44
62
  export interface AddCommentAnnotationRequest {
45
63
  annotation: CommentAnnotation;
46
64
  options?: RequestOptions;
65
+ /** Optional visibility configuration for the comment */
66
+ visibility?: CommentVisibilityConfig;
47
67
  }
48
68
  export interface ApproveCommentAnnotationRequest {
49
69
  annotationId: string;
@@ -54,6 +54,7 @@ export interface CommentSuggestionEventData {
54
54
  }
55
55
  export type CommentEventTypesMap = {
56
56
  [CommentEventTypes.ADD_COMMENT_ANNOTATION]: AddCommentAnnotationEvent;
57
+ [CommentEventTypes.ADD_COMMENT_ANNOTATION_DRAFT]: AddCommentAnnotationDraftEvent;
57
58
  [CommentEventTypes.APPROVE_COMMENT_ANNOTATION]: ApproveCommentAnnotationEvent;
58
59
  [CommentEventTypes.ACCEPT_COMMENT_ANNOTATION]: AcceptCommentAnnotationEvent;
59
60
  [CommentEventTypes.REJECT_COMMENT_ANNOTATION]: RejectCommentAnnotationEvent;
@@ -79,6 +80,7 @@ export type CommentEventTypesMap = {
79
80
  [CommentEventTypes.COMMENT_SIDEBAR_DATA_UPDATE]: CommentSidebarDataUpdateEvent;
80
81
  [CommentEventTypes.AUTOCOMPLETE_SEARCH]: AutocompleteSearchEvent;
81
82
  [CommentEventTypes.COMPOSER_CLICKED]: ComposerClickedEvent;
83
+ [CommentEventTypes.COMPOSER_TEXT_CHANGE]: ComposerTextChangeEvent;
82
84
  [CommentEventTypes.LINK_CLICKED]: LinkClickedEvent;
83
85
  [CommentEventTypes.COMMENT_PIN_CLICKED]: CommentPinClickedEvent;
84
86
  [CommentEventTypes.COMMENT_BUBBLE_CLICKED]: CommentBubbleClickedEvent;
@@ -96,6 +98,10 @@ export interface DeleteAttachmentEvent {
96
98
  attachment: Attachment;
97
99
  metadata: VeltEventMetadata;
98
100
  }
101
+ export interface AddCommentAnnotationDraftEvent {
102
+ metadata: VeltEventMetadata;
103
+ addContext: (context: Record<string, unknown>) => void;
104
+ }
99
105
  export interface AddCommentAnnotationEvent {
100
106
  annotationId: string;
101
107
  commentAnnotation: CommentAnnotation;
@@ -270,3 +276,7 @@ export interface CommentBubbleClickedEvent {
270
276
  commentAnnotation: CommentAnnotation;
271
277
  metadata?: VeltEventMetadata;
272
278
  }
279
+ export interface ComposerTextChangeEvent {
280
+ text: string;
281
+ metadata?: VeltEventMetadata;
282
+ }
@@ -1,3 +1,4 @@
1
+ import { Location } from './location.model';
1
2
  export interface IUnreadCommentsMap {
2
3
  [annotationId: string]: number;
3
4
  }
@@ -14,3 +15,28 @@ export interface TransformContext {
14
15
  inverseScale?: number;
15
16
  };
16
17
  }
18
+ /**
19
+ * Context data returned by the comment context provider.
20
+ * This is a flexible object that can contain custom properties.
21
+ */
22
+ export interface CommentContext {
23
+ /**
24
+ * Optional comment type. When set to 'manual', the comment will be treated as a manual comment
25
+ * and the target element will be removed.
26
+ */
27
+ commentType?: 'manual' | string;
28
+ /**
29
+ * Allow additional custom properties
30
+ */
31
+ [key: string]: unknown;
32
+ }
33
+ export type CommentContextProviderResponse = CommentContext | null | undefined;
34
+ /**
35
+ * A function that provides custom context for comments.
36
+ * Can return the context synchronously or asynchronously via a Promise.
37
+ *
38
+ * @param documentId - The ID of the document
39
+ * @param location - Optional location information
40
+ * @returns The comment context object or a Promise that resolves to it
41
+ */
42
+ export type CommentContextProvider = (documentId: string, location?: Location) => CommentContextProviderResponse | Promise<CommentContextProviderResponse>;
@@ -53,6 +53,14 @@ export declare class Config {
53
53
  * The domain of the API proxy.
54
54
  */
55
55
  apiProxyDomain?: string;
56
+ /**
57
+ * Controls whether global Velt styles are loaded.
58
+ * When true (default), global styles are applied.
59
+ * When false, global styles are not loaded - useful for custom styling.
60
+ *
61
+ * Default: true
62
+ */
63
+ globalStyles?: boolean;
56
64
  }
57
65
  export interface ExtendedFirebaseOptions extends FirebaseOptions {
58
66
  storeDbId: string;
@@ -1,16 +1,16 @@
1
1
  // @ts-nocheck
2
2
  import { Observable } from "rxjs";
3
- import { CommentAnnotation, CommentOnElementConfig, CommentSelectionChangeData, ManualCommentAnnotationConfig, UpdateContextConfig } from "../data/comment-annotation.data.model";
4
- import { AcceptCommentAnnotationEvent, AddCommentAnnotationEvent, AddCommentEvent, AddReactionEvent, ApproveCommentAnnotationEvent, CommentAddEventData, CommentEventTypesMap, CommentUpdateEventData, CopyLinkEvent, DeleteAttachmentEvent, DeleteCommentAnnotationEvent, DeleteCommentEvent, DeleteReactionEvent, DeleteRecordingEvent, GetLinkEvent, RejectCommentAnnotationEvent, ToggleReactionEvent, UpdateAccessEvent, UpdateCommentEvent, UpdatePriorityEvent, UpdateStatusEvent, GetCommentAnnotationsResponse, GetCommentAnnotationsCountResponse, FetchCommentAnnotationsResponse } from "../data/comment-events.data.model";
5
- import { CustomCategory, CustomPriority, CustomStatus } from "../data/custom-filter.data.model";
6
- import { CustomAnnotationDropdownData } from "../data/custom-chip-dropdown.data.model";
3
+ import { CommentSidebarSystemFiltersOperator, SidebarButtonCountType } from "../../utils/enums";
4
+ import { UploadFileData } from "../data/attachment.model";
7
5
  import { AutocompleteData } from "../data/autocomplete.data.model";
6
+ import { AcceptCommentAnnotationRequest, AddAttachmentRequest, AddAttachmentResponse, AddCommentAnnotationRequest, AddCommentRequest, AddReactionRequest, ApproveCommentAnnotationRequest, AssignUserEvent, AssignUserRequest, CommentRequestQuery, CommentVisibilityConfig, CopyLinkRequest, DeleteAttachmentRequest, DeleteCommentAnnotationRequest, DeleteCommentRequest, DeleteReactionRequest, DeleteRecordingRequest, FetchCommentAnnotationsRequest, GetAttachmentRequest, GetCommentRequest, GetLinkRequest, GetRecordingRequest, RejectCommentAnnotationRequest, ResolveCommentAnnotationRequest, SubscribeCommentAnnotationRequest, ToggleReactionRequest, UnsubscribeCommentAnnotationRequest, UpdateAccessRequest, UpdateCommentRequest, UpdatePriorityRequest, UpdateStatusRequest } from "../data/comment-actions.data.model";
7
+ import { CommentAnnotation, CommentOnElementConfig, CommentSelectionChangeData, ManualCommentAnnotationConfig, UpdateContextConfig } from "../data/comment-annotation.data.model";
8
+ import { AcceptCommentAnnotationEvent, AddCommentAnnotationEvent, AddCommentEvent, AddReactionEvent, ApproveCommentAnnotationEvent, CommentAddEventData, CommentEventTypesMap, CommentUpdateEventData, CopyLinkEvent, DeleteAttachmentEvent, DeleteCommentAnnotationEvent, DeleteCommentEvent, DeleteReactionEvent, DeleteRecordingEvent, FetchCommentAnnotationsResponse, GetCommentAnnotationsCountResponse, GetCommentAnnotationsResponse, GetLinkEvent, RejectCommentAnnotationEvent, ToggleReactionEvent, UpdateAccessEvent, UpdateCommentEvent, UpdatePriorityEvent, UpdateStatusEvent } from "../data/comment-events.data.model";
8
9
  import { CommentSidebarCustomActionEventData, CommentSidebarData, CommentSidebarDataOptions } from "../data/comment-sidebar-config.model";
10
+ import { CommentContextProvider, TransformContext, UnreadCommentsCount } from "../data/comment-utils.data.model";
11
+ import { CustomAnnotationDropdownData } from "../data/custom-chip-dropdown.data.model";
12
+ import { CustomCategory, CustomPriority, CustomStatus } from "../data/custom-filter.data.model";
9
13
  export { ReactionMap } from '../data/reaction-annotation.data.model';
10
- import { AcceptCommentAnnotationRequest, AddAttachmentRequest, AddAttachmentResponse, AddCommentAnnotationRequest, AddCommentRequest, AddReactionRequest, ApproveCommentAnnotationRequest, AssignUserRequest, AssignUserEvent, CopyLinkRequest, DeleteAttachmentRequest, DeleteCommentAnnotationRequest, CommentRequestQuery, CommentRequestQuery, DeleteCommentRequest, DeleteReactionRequest, DeleteRecordingRequest, GetAttachmentRequest, GetCommentRequest, GetLinkRequest, GetRecordingRequest, RejectCommentAnnotationRequest, ResolveCommentAnnotationRequest, SubscribeCommentAnnotationRequest, UnsubscribeCommentAnnotationRequest, ToggleReactionRequest, UpdateAccessRequest, UpdateCommentRequest, UpdatePriorityRequest, UpdateStatusRequest, FetchCommentAnnotationsRequest } from "../data/comment-actions.data.model";
11
- import { UnreadCommentsCount, TransformContext } from "../data/comment-utils.data.model";
12
- import { CommentSidebarSystemFiltersOperator, SidebarButtonCountType } from "../../utils/enums";
13
- import { UploadFileData } from "../data/attachment.model";
14
14
 
15
15
  export declare class CommentElement {
16
16
  /**
@@ -329,7 +329,7 @@ export declare class CommentElement {
329
329
  * @description Sets the comment context provider
330
330
  * @param provider
331
331
  */
332
- public setContextProvider: (provider: (documentId: string, location?: any) => any) => void;
332
+ public setContextProvider: (provider: CommentContextProvider | null) => void;
333
333
 
334
334
  /**
335
335
  * To enable suggestion mode
@@ -823,6 +823,14 @@ export declare class CommentElement {
823
823
  */
824
824
  public updateContext: (annotationId: string, context: any, config?: UpdateContextConfig) => Promise<any>;
825
825
 
826
+ /**
827
+ * Updates the visibility of a comment annotation.
828
+ * @param annotationId Annotation Id
829
+ * @param visibility Visibility configuration (public, organization, or self)
830
+ * @returns Promise<any>
831
+ */
832
+ public updateVisibility: (annotationId: string, visibility: CommentVisibilityConfig) => Promise<any>;
833
+
826
834
  /**
827
835
  * Subscribe to selected comments
828
836
  * @returns list of selected comments
@@ -1264,6 +1272,23 @@ export declare class CommentElement {
1264
1272
  */
1265
1273
  public disableScreenshot: () => void;
1266
1274
 
1275
+ /**
1276
+ * To programmatically submit a comment from a velt-comment-composer.
1277
+ * Finds the composer within the element identified by referenceId and submits its content.
1278
+ * @param referenceId The ID of the HTML element containing the velt-comment-composer
1279
+ */
1280
+ public submitComment: (referenceId: string) => void;
1281
+
1282
+ /**
1283
+ * To enable paginated contact list
1284
+ */
1285
+ public enablePaginatedContactList: () => void;
1286
+
1287
+ /**
1288
+ * To disable paginated contact list
1289
+ */
1290
+ public disablePaginatedContactList: () => void;
1291
+
1267
1292
  constructor();
1268
1293
  /**
1269
1294
  * Subscribe to comments on the current document.
@@ -2065,6 +2090,14 @@ export declare class CommentElement {
2065
2090
  */
2066
2091
  private _updateContext;
2067
2092
 
2093
+ /**
2094
+ * Updates the visibility of a comment annotation.
2095
+ * @param annotationId Annotation Id
2096
+ * @param visibility Visibility configuration (public, organization, or self)
2097
+ * @returns Promise<any>
2098
+ */
2099
+ private _updateVisibility;
2100
+
2068
2101
  /**
2069
2102
  * Subscribe to selected comments
2070
2103
  * @returns list of selected comments
@@ -2506,4 +2539,21 @@ export declare class CommentElement {
2506
2539
  * To disable screenshot
2507
2540
  */
2508
2541
  private _disableScreenshot;
2542
+
2543
+ /**
2544
+ * To enable paginated contact list
2545
+ */
2546
+ private _enablePaginatedContactList;
2547
+
2548
+ /**
2549
+ * To disable paginated contact list
2550
+ */
2551
+ private _disablePaginatedContactList;
2552
+
2553
+ /**
2554
+ * To programmatically submit a comment from a velt-comment-composer.
2555
+ * Finds the composer within the element identified by referenceId and submits its content.
2556
+ * @param referenceId The ID of the HTML element containing the velt-comment-composer
2557
+ */
2558
+ private _submitComment;
2509
2559
  }
@@ -1,5 +1,6 @@
1
1
  // @ts-nocheck
2
2
  import { CrdtGetDataQuery, CrdtGetVersionQuery, CrdtOnDataChangeQuery, CrdtOnPresenceChangeQuery, CrdtOnRegisteredUserChangeQuery, CrdtOnStateChangeQuery, CrdtRegisterSyncUserQuery, CrdtSetPresenceQuery, CrdtSaveVersionQuery, CrdtUpdateDataQuery, CrdtUpdateStateQuery } from "../data/crdt.data.model";
3
+ import { CrdtEventTypesMap } from "../data/crdt-events.data.model";
3
4
 
4
5
  export declare class CrdtElement {
5
6
  /**
@@ -79,6 +80,29 @@ export declare class CrdtElement {
79
80
  */
80
81
  getVersion: (getVersionQuery: CrdtGetVersionQuery) => Promise<any>;
81
82
 
83
+ /**
84
+ * Enable webhook
85
+ */
86
+ enableWebhook: () => void;
87
+
88
+ /**
89
+ * Disable webhook
90
+ */
91
+ disableWebhook: () => void;
92
+
93
+ /**
94
+ * Set webhook debounce time
95
+ * @param time debounce time in milliseconds
96
+ */
97
+ setWebhookDebounceTime: (time: number) => void;
98
+
99
+ /**
100
+ * Subscribe to crdt actions
101
+ * @param action Action to subscribe to
102
+ * @returns Observable of the action
103
+ */
104
+ on: <T extends keyof CrdtEventTypesMap>(action: T) => Observable<CrdtEventTypesMap[T]>;
105
+
82
106
  constructor();
83
107
 
84
108
  /**
@@ -163,4 +187,27 @@ export declare class CrdtElement {
163
187
  * @param id Document ID
164
188
  */
165
189
  private _getVersions;
190
+
191
+ /**
192
+ * Enable webhook
193
+ */
194
+ private _enableWebhook;
195
+
196
+ /**
197
+ * Disable webhook
198
+ */
199
+ private _disableWebhook;
200
+
201
+ /**
202
+ * Set webhook debounce time
203
+ * @param time debounce time in milliseconds
204
+ */
205
+ private _setWebhookDebounceTime;
206
+
207
+ /**
208
+ * Subscribe to crdt actions
209
+ * @param action Action to subscribe to
210
+ * @returns Observable of the action
211
+ */
212
+ private _on;
166
213
  }
@@ -56,6 +56,12 @@ export declare class SelectionElement {
56
56
  */
57
57
  getLiveSelectionData: () => Observable<LiveSelectionData | null>;
58
58
 
59
+ /**
60
+ * To set inactivity time (Default value is 5 minutes)
61
+ * @param time inactivity time in milliseconds
62
+ */
63
+ setInactivityTime: (time: number) => void;
64
+
59
65
  constructor();
60
66
 
61
67
  /**
@@ -112,4 +118,10 @@ export declare class SelectionElement {
112
118
  * To get live selection data
113
119
  */
114
120
  private _getLiveSelectionData;
121
+
122
+ /**
123
+ * To set inactivity time (Default value is 5 minutes)
124
+ * @param time inactivity time in milliseconds
125
+ */
126
+ private _setInactivityTime;
115
127
  }
@@ -11,6 +11,7 @@ export declare class Constants {
11
11
  static LISTENER_BATCH_SIZE: number;
12
12
  static LISTENER_CONTEXT_BATCH_SIZE: number;
13
13
  static DEFAULT_VELT_CONTEXT: string;
14
+ static VISIBILITY_SELF_PREFIX: string;
14
15
  static FIREBASE_PARTIAL_PATH_ORGANIZATIONS: string;
15
16
  static FIREBASE_PARTIAL_PATH_FOLDERS: string;
16
17
  static FIREBASE_PARTIAL_PATH_DOCS: string;
@@ -29,6 +29,7 @@ export declare enum ResolverActions {
29
29
  }
30
30
  export declare const CommentEventTypes: {
31
31
  readonly ADD_COMMENT_ANNOTATION: "addCommentAnnotation";
32
+ readonly ADD_COMMENT_ANNOTATION_DRAFT: "addCommentAnnotationDraft";
32
33
  readonly DELETE_COMMENT_ANNOTATION: "deleteCommentAnnotation";
33
34
  readonly APPROVE_COMMENT_ANNOTATION: "approveCommentAnnotation";
34
35
  readonly ACCEPT_COMMENT_ANNOTATION: "acceptCommentAnnotation";
@@ -54,6 +55,7 @@ export declare const CommentEventTypes: {
54
55
  readonly COMMENT_SIDEBAR_DATA_UPDATE: "commentSidebarDataUpdate";
55
56
  readonly AUTOCOMPLETE_SEARCH: "autocompleteSearch";
56
57
  readonly COMPOSER_CLICKED: "composerClicked";
58
+ readonly COMPOSER_TEXT_CHANGE: "composerTextChange";
57
59
  readonly LINK_CLICKED: "linkClicked";
58
60
  readonly COMMENT_PIN_CLICKED: "commentPinClicked";
59
61
  readonly COMMENT_BUBBLE_CLICKED: "commentBubbleClicked";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/sdk-staging",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.10",
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": [