@liveblocks/emails 3.6.2 → 3.7.0

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/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { Relax, BaseUserMeta, DU, MentionData, DRI, Awaitable, ResolveUsersArgs, CommentBodyText, CommentBodyLink, CommentBodyMention } from '@liveblocks/core';
2
- export { ResolveUsersArgs } from '@liveblocks/core';
1
+ import { Relax, BaseUserMeta, DU, DGI, MentionData, DRI, Awaitable, ResolveUsersArgs, ResolveGroupsInfoArgs, CommentBodyText, CommentBodyLink, CommentBodyMention } from '@liveblocks/core';
2
+ export { ResolveGroupsInfoArgs, ResolveUsersArgs } from '@liveblocks/core';
3
3
  import { Liveblocks, TextMentionNotificationEvent, ThreadNotificationEvent } from '@liveblocks/node';
4
4
  import { ReactNode, ComponentType } from 'react';
5
5
  import { Properties } from 'csstype';
@@ -35,12 +35,18 @@ type LiveblocksTextEditorTextNode = {
35
35
  type: "text";
36
36
  text: string;
37
37
  } & LiveblocksTextEditorTextFormat;
38
- type LiveblocksTextEditorMentionNode = Relax<LiveblocksTextEditorUserMentionNode>;
38
+ type LiveblocksTextEditorMentionNode = Relax<LiveblocksTextEditorUserMentionNode | LiveblocksTextEditorGroupMentionNode>;
39
39
  type LiveblocksTextEditorUserMentionNode = {
40
40
  type: "mention";
41
41
  kind: "user";
42
42
  id: string;
43
43
  };
44
+ type LiveblocksTextEditorGroupMentionNode = {
45
+ type: "mention";
46
+ kind: "group";
47
+ id: string;
48
+ userIds?: string[];
49
+ };
44
50
 
45
51
  type MentionEmailData<ContentType, U extends BaseUserMeta = DU> = MentionData & {
46
52
  textMentionId: string;
@@ -61,9 +67,15 @@ type PrepareTextMentionNotificationEmailOptions<U extends BaseUserMeta = DU> = {
61
67
  */
62
68
  resolveRoomInfo?: (args: ResolveRoomInfoArgs) => Awaitable<DRI | undefined>;
63
69
  /**
64
- * A function that returns info from user IDs.
70
+ * A function that returns user info from user IDs.
71
+ * You should return a list of user objects of the same size, in the same order.
65
72
  */
66
73
  resolveUsers?: (args: ResolveUsersArgs) => Awaitable<(U["info"] | undefined)[] | undefined>;
74
+ /**
75
+ * A function that returns group info from group IDs.
76
+ * You should return a list of group info objects of the same size, in the same order.
77
+ */
78
+ resolveGroupsInfo?: (args: ResolveGroupsInfoArgs) => Awaitable<(DGI | undefined)[] | undefined>;
67
79
  };
68
80
  type TextEditorContainerComponentProps = {
69
81
  /**
@@ -77,9 +89,13 @@ type TextEditorMentionComponentProps<U extends BaseUserMeta = DU> = {
77
89
  */
78
90
  element: LiveblocksTextEditorMentionNode;
79
91
  /**
80
- * The mention's user info, if the `resolvedUsers` option was provided.
92
+ * The mention's user info, if the mention is a user mention and the `resolvedUsers` option was provided.
81
93
  */
82
94
  user?: U["info"];
95
+ /**
96
+ * The mention's group info, if the mention is a group mention and the `resolvedGroupsInfo` option was provided.
97
+ */
98
+ group?: DGI;
83
99
  };
84
100
  type TextEditorTextComponentProps = {
85
101
  /**
@@ -213,9 +229,15 @@ type PrepareThreadNotificationEmailOptions<U extends BaseUserMeta = DU> = {
213
229
  */
214
230
  resolveRoomInfo?: (args: ResolveRoomInfoArgs) => Awaitable<DRI | undefined>;
215
231
  /**
216
- * A function that returns info from user IDs.
232
+ * A function that returns user info from user IDs.
233
+ * You should return a list of user objects of the same size, in the same order.
217
234
  */
218
235
  resolveUsers?: (args: ResolveUsersArgs) => Awaitable<(U["info"] | undefined)[] | undefined>;
236
+ /**
237
+ * A function that returns group info from group IDs.
238
+ * You should return a list of group info objects of the same size, in the same order.
239
+ */
240
+ resolveGroupsInfo?: (args: ResolveGroupsInfoArgs) => Awaitable<(DGI | undefined)[] | undefined>;
219
241
  };
220
242
  /**
221
243
  * The styles used to customize the html elements in the resulting html safe string.
@@ -312,9 +334,13 @@ type CommentBodyMentionComponentProps<U extends BaseUserMeta = DU> = {
312
334
  */
313
335
  element: CommentBodyMention;
314
336
  /**
315
- * The mention's user info, if the `resolvedUsers` option was provided.
337
+ * The mention's user info, if the mention is a user mention and the `resolvedUsers` option was provided.
316
338
  */
317
339
  user?: U["info"];
340
+ /**
341
+ * The mention's group info, if the mention is a group mention and the `resolvedGroupsInfo` option was provided.
342
+ */
343
+ group?: DGI;
318
344
  };
319
345
  type ConvertCommentBodyAsReactComponents<U extends BaseUserMeta = DU> = {
320
346
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Relax, BaseUserMeta, DU, MentionData, DRI, Awaitable, ResolveUsersArgs, CommentBodyText, CommentBodyLink, CommentBodyMention } from '@liveblocks/core';
2
- export { ResolveUsersArgs } from '@liveblocks/core';
1
+ import { Relax, BaseUserMeta, DU, DGI, MentionData, DRI, Awaitable, ResolveUsersArgs, ResolveGroupsInfoArgs, CommentBodyText, CommentBodyLink, CommentBodyMention } from '@liveblocks/core';
2
+ export { ResolveGroupsInfoArgs, ResolveUsersArgs } from '@liveblocks/core';
3
3
  import { Liveblocks, TextMentionNotificationEvent, ThreadNotificationEvent } from '@liveblocks/node';
4
4
  import { ReactNode, ComponentType } from 'react';
5
5
  import { Properties } from 'csstype';
@@ -35,12 +35,18 @@ type LiveblocksTextEditorTextNode = {
35
35
  type: "text";
36
36
  text: string;
37
37
  } & LiveblocksTextEditorTextFormat;
38
- type LiveblocksTextEditorMentionNode = Relax<LiveblocksTextEditorUserMentionNode>;
38
+ type LiveblocksTextEditorMentionNode = Relax<LiveblocksTextEditorUserMentionNode | LiveblocksTextEditorGroupMentionNode>;
39
39
  type LiveblocksTextEditorUserMentionNode = {
40
40
  type: "mention";
41
41
  kind: "user";
42
42
  id: string;
43
43
  };
44
+ type LiveblocksTextEditorGroupMentionNode = {
45
+ type: "mention";
46
+ kind: "group";
47
+ id: string;
48
+ userIds?: string[];
49
+ };
44
50
 
45
51
  type MentionEmailData<ContentType, U extends BaseUserMeta = DU> = MentionData & {
46
52
  textMentionId: string;
@@ -61,9 +67,15 @@ type PrepareTextMentionNotificationEmailOptions<U extends BaseUserMeta = DU> = {
61
67
  */
62
68
  resolveRoomInfo?: (args: ResolveRoomInfoArgs) => Awaitable<DRI | undefined>;
63
69
  /**
64
- * A function that returns info from user IDs.
70
+ * A function that returns user info from user IDs.
71
+ * You should return a list of user objects of the same size, in the same order.
65
72
  */
66
73
  resolveUsers?: (args: ResolveUsersArgs) => Awaitable<(U["info"] | undefined)[] | undefined>;
74
+ /**
75
+ * A function that returns group info from group IDs.
76
+ * You should return a list of group info objects of the same size, in the same order.
77
+ */
78
+ resolveGroupsInfo?: (args: ResolveGroupsInfoArgs) => Awaitable<(DGI | undefined)[] | undefined>;
67
79
  };
68
80
  type TextEditorContainerComponentProps = {
69
81
  /**
@@ -77,9 +89,13 @@ type TextEditorMentionComponentProps<U extends BaseUserMeta = DU> = {
77
89
  */
78
90
  element: LiveblocksTextEditorMentionNode;
79
91
  /**
80
- * The mention's user info, if the `resolvedUsers` option was provided.
92
+ * The mention's user info, if the mention is a user mention and the `resolvedUsers` option was provided.
81
93
  */
82
94
  user?: U["info"];
95
+ /**
96
+ * The mention's group info, if the mention is a group mention and the `resolvedGroupsInfo` option was provided.
97
+ */
98
+ group?: DGI;
83
99
  };
84
100
  type TextEditorTextComponentProps = {
85
101
  /**
@@ -213,9 +229,15 @@ type PrepareThreadNotificationEmailOptions<U extends BaseUserMeta = DU> = {
213
229
  */
214
230
  resolveRoomInfo?: (args: ResolveRoomInfoArgs) => Awaitable<DRI | undefined>;
215
231
  /**
216
- * A function that returns info from user IDs.
232
+ * A function that returns user info from user IDs.
233
+ * You should return a list of user objects of the same size, in the same order.
217
234
  */
218
235
  resolveUsers?: (args: ResolveUsersArgs) => Awaitable<(U["info"] | undefined)[] | undefined>;
236
+ /**
237
+ * A function that returns group info from group IDs.
238
+ * You should return a list of group info objects of the same size, in the same order.
239
+ */
240
+ resolveGroupsInfo?: (args: ResolveGroupsInfoArgs) => Awaitable<(DGI | undefined)[] | undefined>;
219
241
  };
220
242
  /**
221
243
  * The styles used to customize the html elements in the resulting html safe string.
@@ -312,9 +334,13 @@ type CommentBodyMentionComponentProps<U extends BaseUserMeta = DU> = {
312
334
  */
313
335
  element: CommentBodyMention;
314
336
  /**
315
- * The mention's user info, if the `resolvedUsers` option was provided.
337
+ * The mention's user info, if the mention is a user mention and the `resolvedUsers` option was provided.
316
338
  */
317
339
  user?: U["info"];
340
+ /**
341
+ * The mention's group info, if the mention is a group mention and the `resolvedGroupsInfo` option was provided.
342
+ */
343
+ group?: DGI;
318
344
  };
319
345
  type ConvertCommentBodyAsReactComponents<U extends BaseUserMeta = DU> = {
320
346
  /**