@veltdev/types-dev 5.0.0-beta.3 → 5.0.0-beta.31
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/app/models/data/comment-actions.data.model.d.ts +44 -0
- package/app/models/data/comment-events.data.model.d.ts +10 -0
- package/app/models/data/comment-utils.data.model.d.ts +26 -0
- package/app/models/data/config.data.model.d.ts +11 -0
- package/app/models/element/comment-element.model.d.ts +39 -10
- package/app/utils/constants.d.ts +1 -0
- package/app/utils/enums.d.ts +2 -0
- package/package.json +1 -1
|
@@ -41,9 +41,31 @@ 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
|
+
/** Annotation ID for the comment to update visibility */
|
|
58
|
+
annotationId?: string;
|
|
59
|
+
/** Organization ID for 'organization' type visibility */
|
|
60
|
+
organizationId?: string;
|
|
61
|
+
/** User IDs for 'self' type visibility - array of user IDs who can see the comment */
|
|
62
|
+
userIds?: string[];
|
|
63
|
+
}
|
|
44
64
|
export interface AddCommentAnnotationRequest {
|
|
45
65
|
annotation: CommentAnnotation;
|
|
46
66
|
options?: RequestOptions;
|
|
67
|
+
/** Optional visibility configuration for the comment */
|
|
68
|
+
visibility?: CommentVisibilityConfig;
|
|
47
69
|
}
|
|
48
70
|
export interface PublishCommentAnnotationRequest {
|
|
49
71
|
annotationId: string;
|
|
@@ -65,6 +87,24 @@ export interface DeleteCommentAnnotationRequest {
|
|
|
65
87
|
annotationId: string;
|
|
66
88
|
options?: RequestOptions;
|
|
67
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Query parameters for fetching comment annotation counts.
|
|
92
|
+
*
|
|
93
|
+
* @property organizationId - Filter by organization (enables org-wide aggregation when used alone)
|
|
94
|
+
* @property documentIds - Filter by specific document IDs
|
|
95
|
+
* @property locationIds - Filter by location IDs within documents
|
|
96
|
+
* @property statusIds - Filter by comment status IDs (e.g., "open", "resolved")
|
|
97
|
+
* @property folderId - Filter by folder ID (use with allDocuments for folder-wide counts)
|
|
98
|
+
* @property allDocuments - When true with folderId, aggregates all documents in folder
|
|
99
|
+
* @property locationId - Single location filter (deprecated, use locationIds)
|
|
100
|
+
* @property aggregateDocuments - When true, combines all documentIds into single count
|
|
101
|
+
* @property filterGhostComments - When true, excludes orphaned/deleted comments from counts
|
|
102
|
+
* @property batchedPerDocument - When true, uses efficient batched listeners (4 instead of 100)
|
|
103
|
+
* but still returns per-document counts. Best for large document lists (50+).
|
|
104
|
+
* Trade-off: slight delay on updates due to debouncing.
|
|
105
|
+
* @property debounceMs - Debounce time in milliseconds for batchedPerDocument mode (default: 5000ms).
|
|
106
|
+
* Prevents rapid re-fetches when multiple documents update in quick succession.
|
|
107
|
+
*/
|
|
68
108
|
export interface CommentRequestQuery {
|
|
69
109
|
organizationId?: string;
|
|
70
110
|
documentIds?: string[];
|
|
@@ -75,6 +115,10 @@ export interface CommentRequestQuery {
|
|
|
75
115
|
locationId?: string;
|
|
76
116
|
aggregateDocuments?: boolean;
|
|
77
117
|
filterGhostComments?: boolean;
|
|
118
|
+
/** Enable batched listeners with per-document counts. Uses 4 listeners instead of N listeners. */
|
|
119
|
+
batchedPerDocument?: boolean;
|
|
120
|
+
/** Debounce time in ms for batchedPerDocument mode (default: 5000). */
|
|
121
|
+
debounceMs?: number;
|
|
78
122
|
}
|
|
79
123
|
export interface SubscribeCommentAnnotationRequest {
|
|
80
124
|
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;
|
|
@@ -275,3 +281,7 @@ export interface CommentBubbleClickedEvent {
|
|
|
275
281
|
commentAnnotation: CommentAnnotation;
|
|
276
282
|
metadata?: VeltEventMetadata;
|
|
277
283
|
}
|
|
284
|
+
export interface ComposerTextChangeEvent {
|
|
285
|
+
text: string;
|
|
286
|
+
metadata?: VeltEventMetadata;
|
|
287
|
+
}
|
|
@@ -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;
|
|
@@ -66,3 +74,6 @@ export interface DisableLogsConfig {
|
|
|
66
74
|
warnings?: boolean;
|
|
67
75
|
suppressAll?: boolean;
|
|
68
76
|
}
|
|
77
|
+
export interface GetProjectConfigResponse {
|
|
78
|
+
isPrivateCommentsEnabled: boolean;
|
|
79
|
+
}
|
|
@@ -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, PublishCommentAnnotationEvent } 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";
|
|
7
|
-
import { AutocompleteData } from "../data/autocomplete.data.model";
|
|
8
|
-
import { CommentSidebarCustomActionEventData, CommentSidebarData, CommentSidebarDataOptions } from "../data/comment-sidebar-config.model";
|
|
9
|
-
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, PublishCommentAnnotationRequest } from "../data/comment-actions.data.model";
|
|
11
|
-
import { UnreadCommentsCount, TransformContext } from "../data/comment-utils.data.model";
|
|
12
3
|
import { CommentSidebarSystemFiltersOperator, SidebarButtonCountType } from "../../utils/enums";
|
|
13
4
|
import { UploadFileData } from "../data/attachment.model";
|
|
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, PublishCommentAnnotationRequest, 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, PublishCommentAnnotationEvent, RejectCommentAnnotationEvent, ToggleReactionEvent, UpdateAccessEvent, UpdateCommentEvent, UpdatePriorityEvent, UpdateStatusEvent } from "../data/comment-events.data.model";
|
|
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";
|
|
13
|
+
export { ReactionMap, ReactionMap } from '../data/reaction-annotation.data.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:
|
|
332
|
+
public setContextProvider: (provider: CommentContextProvider | null) => void;
|
|
333
333
|
|
|
334
334
|
/**
|
|
335
335
|
* To enable suggestion mode
|
|
@@ -823,6 +823,13 @@ 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 visibility Visibility configuration (public, organization, or self) including annotationId
|
|
829
|
+
* @returns Promise<any>
|
|
830
|
+
*/
|
|
831
|
+
public updateVisibility: (visibility: CommentVisibilityConfig) => Promise<any>;
|
|
832
|
+
|
|
826
833
|
/**
|
|
827
834
|
* Subscribe to selected comments
|
|
828
835
|
* @returns list of selected comments
|
|
@@ -1269,6 +1276,13 @@ export declare class CommentElement {
|
|
|
1269
1276
|
*/
|
|
1270
1277
|
public disableScreenshot: () => void;
|
|
1271
1278
|
|
|
1279
|
+
/**
|
|
1280
|
+
* To programmatically submit a comment from a velt-comment-composer.
|
|
1281
|
+
* Finds the composer within the element identified by referenceId and submits its content.
|
|
1282
|
+
* @param referenceId The ID of the HTML element containing the velt-comment-composer
|
|
1283
|
+
*/
|
|
1284
|
+
public submitComment: (referenceId: string) => void;
|
|
1285
|
+
|
|
1272
1286
|
/**
|
|
1273
1287
|
* To enable paginated contact list
|
|
1274
1288
|
*/
|
|
@@ -2080,6 +2094,14 @@ export declare class CommentElement {
|
|
|
2080
2094
|
*/
|
|
2081
2095
|
private _updateContext;
|
|
2082
2096
|
|
|
2097
|
+
/**
|
|
2098
|
+
* Updates the visibility of a comment annotation.
|
|
2099
|
+
* @param annotationId Annotation Id
|
|
2100
|
+
* @param visibility Visibility configuration (public, organization, or self)
|
|
2101
|
+
* @returns Promise<any>
|
|
2102
|
+
*/
|
|
2103
|
+
private _updateVisibility;
|
|
2104
|
+
|
|
2083
2105
|
/**
|
|
2084
2106
|
* Subscribe to selected comments
|
|
2085
2107
|
* @returns list of selected comments
|
|
@@ -2536,4 +2558,11 @@ export declare class CommentElement {
|
|
|
2536
2558
|
* To disable paginated contact list
|
|
2537
2559
|
*/
|
|
2538
2560
|
private _disablePaginatedContactList;
|
|
2561
|
+
|
|
2562
|
+
/**
|
|
2563
|
+
* To programmatically submit a comment from a velt-comment-composer.
|
|
2564
|
+
* Finds the composer within the element identified by referenceId and submits its content.
|
|
2565
|
+
* @param referenceId The ID of the HTML element containing the velt-comment-composer
|
|
2566
|
+
*/
|
|
2567
|
+
private _submitComment;
|
|
2539
2568
|
}
|
package/app/utils/constants.d.ts
CHANGED
|
@@ -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;
|
package/app/utils/enums.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare enum ResolverActions {
|
|
|
30
30
|
}
|
|
31
31
|
export declare const CommentEventTypes: {
|
|
32
32
|
readonly ADD_COMMENT_ANNOTATION: "addCommentAnnotation";
|
|
33
|
+
readonly ADD_COMMENT_ANNOTATION_DRAFT: "addCommentAnnotationDraft";
|
|
33
34
|
readonly PUBLISH_COMMENT_ANNOTATION: "publishCommentAnnotation";
|
|
34
35
|
readonly DELETE_COMMENT_ANNOTATION: "deleteCommentAnnotation";
|
|
35
36
|
readonly APPROVE_COMMENT_ANNOTATION: "approveCommentAnnotation";
|
|
@@ -56,6 +57,7 @@ export declare const CommentEventTypes: {
|
|
|
56
57
|
readonly COMMENT_SIDEBAR_DATA_UPDATE: "commentSidebarDataUpdate";
|
|
57
58
|
readonly AUTOCOMPLETE_SEARCH: "autocompleteSearch";
|
|
58
59
|
readonly COMPOSER_CLICKED: "composerClicked";
|
|
60
|
+
readonly COMPOSER_TEXT_CHANGE: "composerTextChange";
|
|
59
61
|
readonly LINK_CLICKED: "linkClicked";
|
|
60
62
|
readonly COMMENT_PIN_CLICKED: "commentPinClicked";
|
|
61
63
|
readonly COMMENT_BUBBLE_CLICKED: "commentBubbleClicked";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltdev/types-dev",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.31",
|
|
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": [
|