@veltdev/sdk 3.0.77 → 3.0.79

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.
@@ -25,6 +25,7 @@ import { UserContact } from "../models/data/user-contact.data.model";
25
25
  import { DocumentMetadata } from "../models/data/document-metadata.model";
26
26
  import { ReactionElement } from "../models/element/reaction-element.model";
27
27
  import { VeltEventMetadata } from "../models/data/event-metadata.data.model";
28
+ import { CoreEventTypesMap } from "../models/data/core-events.data.model";
28
29
  export declare class Snippyly {
29
30
  constructor();
30
31
  initConfig: (apiKey: string, config?: Config) => void;
@@ -263,4 +264,9 @@ export declare class Snippyly {
263
264
  * To get document metadata.
264
265
  */
265
266
  getDocumentMetadata: () => Observable<DocumentMetadata | null>;
267
+
268
+ /**
269
+ * To subscribe to core actions
270
+ */
271
+ on: <T extends keyof CoreEventTypesMap>(action: T) => Observable<CoreEventTypesMap[T]>;
266
272
  }
@@ -0,0 +1,31 @@
1
+ import { CommentAnnotation } from "./comment-annotation.data.model";
2
+ import { Comment } from "./comment.data.model";
3
+ import { VeltEventMetadata } from "./event-metadata.data.model";
4
+ import { Notification } from "./notification.model";
5
+ export interface VeltButtonClickEvent extends VeltButtonData {
6
+ buttonContext: VeltButtonContext;
7
+ metadata: VeltEventMetadata;
8
+ }
9
+ export interface VeltButtonContext {
10
+ type?: string;
11
+ groupId?: string;
12
+ selections?: VeltButtonSelectionMap;
13
+ clickedButtonId?: string;
14
+ }
15
+ export interface VeltButtonData {
16
+ commentAnnotation?: CommentAnnotation;
17
+ comment?: Comment;
18
+ index?: number;
19
+ commentAnnotations?: CommentAnnotation[];
20
+ systemFilteredAnnotations?: CommentAnnotation[];
21
+ unreadCommentAnnotationsMap?: {
22
+ [commentAnnotationId: string]: number;
23
+ };
24
+ notification?: Notification;
25
+ notifications?: Notification[];
26
+ }
27
+ export interface VeltButtonSelectionMap {
28
+ [groupId: string]: {
29
+ [buttonId: string]: boolean;
30
+ };
31
+ }
@@ -1,5 +1,6 @@
1
1
  import { CommentAccessMode, CommentEventTypes, CommentStatus } from "../../utils/enums";
2
2
  import { Attachment } from "./attachment.model";
3
+ import { VeltButtonClickEvent } from "./button.data.model";
3
4
  import { AddAttachmentResponse } from "./comment-actions.data.model";
4
5
  import { CommentAnnotation, UpdateContextConfig } from "./comment-annotation.data.model";
5
6
  import { Comment } from "./comment.data.model";
@@ -74,6 +75,8 @@ export type CommentEventTypesMap = {
74
75
  [CommentEventTypes.ADD_REACTION]: AddReactionEvent;
75
76
  [CommentEventTypes.DELETE_REACTION]: DeleteReactionEvent;
76
77
  [CommentEventTypes.TOGGLE_REACTION]: ToggleReactionEvent;
78
+ [CommentEventTypes.COMMENT_SIDEBAR_DATA_INIT]: CommentSidebarDataInitEvent;
79
+ [CommentEventTypes.COMMENT_SIDEBAR_DATA_UPDATE]: CommentSidebarDataUpdateEvent;
77
80
  };
78
81
  export interface AddAttachmentEvent {
79
82
  annotationId: string;
@@ -222,3 +225,7 @@ export interface CopyLinkEvent {
222
225
  link: string;
223
226
  metadata: VeltEventMetadata;
224
227
  }
228
+ export interface CommentSidebarDataInitEvent extends VeltButtonClickEvent {
229
+ }
230
+ export interface CommentSidebarDataUpdateEvent extends VeltButtonClickEvent {
231
+ }
@@ -0,0 +1,5 @@
1
+ import { CoreEventTypes } from "../../utils/enums";
2
+ import { VeltButtonClickEvent } from "./button.data.model";
3
+ export type CoreEventTypesMap = {
4
+ [CoreEventTypes.VELT_BUTTON_CLICK]: VeltButtonClickEvent;
5
+ };
@@ -39,8 +39,14 @@ export declare const CommentEventTypes: {
39
39
  readonly ADD_REACTION: "addReaction";
40
40
  readonly DELETE_REACTION: "deleteReaction";
41
41
  readonly TOGGLE_REACTION: "toggleReaction";
42
+ readonly COMMENT_SIDEBAR_DATA_INIT: "commentSidebarDataInit";
43
+ readonly COMMENT_SIDEBAR_DATA_UPDATE: "commentSidebarDataUpdate";
44
+ };
45
+ export declare const CoreEventTypes: {
46
+ readonly VELT_BUTTON_CLICK: "veltButtonClick";
42
47
  };
43
48
  export type CommentEventType = typeof CommentEventTypes[keyof typeof CommentEventTypes];
49
+ export type CoreEventType = typeof CoreEventTypes[keyof typeof CoreEventTypes];
44
50
  export declare enum TagStatus {
45
51
  ADDED = "added",
46
52
  UPDATED = "updated",
package/models.d.ts CHANGED
@@ -2,12 +2,14 @@ export * from './app/utils/enums';
2
2
  export * from './app/models/data/attachment.model';
3
3
  export * from './app/models/data/area-annotation.data.model';
4
4
  export * from './app/models/data/base-metadata.data.model';
5
+ export * from './app/models/data/button.data.model';
5
6
  export * from './app/models/data/chatgpt.data.model';
6
7
  export * from './app/models/data/comment-annotation.data.model';
7
8
  export * from './app/models/data/comment-events.data.model';
8
9
  export * from './app/models/data/comment.data.model';
9
10
  export * from './app/models/data/comment-actions.data.model';
10
11
  export * from './app/models/data/config.data.model';
12
+ export * from './app/models/data/core-events.data.model';
11
13
  export * from './app/models/data/cursor-position.data.model';
12
14
  export * from './app/models/data/cursor-user.data.model';
13
15
  export * from './app/models/data/custom-css.data.model';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/sdk",
3
- "version": "3.0.77",
3
+ "version": "3.0.79",
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": [