@liveblocks/emails 2.15.2 → 2.16.0-toolbars1
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.mts +38 -38
- package/dist/index.d.ts +38 -38
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -9,27 +9,27 @@ import { Liveblocks, TextMentionNotificationEvent, ThreadNotificationEvent } fro
|
|
|
9
9
|
* Type alias for DX purposes.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
type CSSProperties = Properties;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
type CommentBodyContainerComponentProps = {
|
|
15
15
|
/**
|
|
16
16
|
* The blocks of the comment body
|
|
17
17
|
*/
|
|
18
18
|
children: ReactNode;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type CommentBodyParagraphComponentProps = {
|
|
21
21
|
/**
|
|
22
22
|
* The text content of the paragraph.
|
|
23
23
|
*/
|
|
24
24
|
children: ReactNode;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
type CommentBodyTextComponentProps = {
|
|
27
27
|
/**
|
|
28
28
|
* The text element.
|
|
29
29
|
*/
|
|
30
30
|
element: CommentBodyText;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
type CommentBodyLinkComponentProps = {
|
|
33
33
|
/**
|
|
34
34
|
* The link element.
|
|
35
35
|
*/
|
|
@@ -39,7 +39,7 @@ declare type CommentBodyLinkComponentProps = {
|
|
|
39
39
|
*/
|
|
40
40
|
href: string;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
type CommentBodyMentionComponentProps<U extends BaseUserMeta = DU> = {
|
|
43
43
|
/**
|
|
44
44
|
* The mention element.
|
|
45
45
|
*/
|
|
@@ -49,7 +49,7 @@ declare type CommentBodyMentionComponentProps<U extends BaseUserMeta = DU> = {
|
|
|
49
49
|
*/
|
|
50
50
|
user?: U["info"];
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
type ConvertCommentBodyAsReactComponents<U extends BaseUserMeta = DU> = {
|
|
53
53
|
/**
|
|
54
54
|
*
|
|
55
55
|
* The component used to act as a container to wrap comment body blocks,
|
|
@@ -72,7 +72,7 @@ declare type ConvertCommentBodyAsReactComponents<U extends BaseUserMeta = DU> =
|
|
|
72
72
|
*/
|
|
73
73
|
Mention: ComponentType<CommentBodyMentionComponentProps<U>>;
|
|
74
74
|
};
|
|
75
|
-
|
|
75
|
+
type ConvertCommentBodyAsHtmlStyles = {
|
|
76
76
|
/**
|
|
77
77
|
* The default inline CSS styles used to display paragraphs.
|
|
78
78
|
*/
|
|
@@ -95,7 +95,7 @@ declare type ConvertCommentBodyAsHtmlStyles = {
|
|
|
95
95
|
link: CSSProperties;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
type ResolveRoomInfoArgs = {
|
|
99
99
|
/**
|
|
100
100
|
* The ID of the room to resolve
|
|
101
101
|
*/
|
|
@@ -109,17 +109,17 @@ declare type ResolveRoomInfoArgs = {
|
|
|
109
109
|
* and then convert them more easily as React or as html.
|
|
110
110
|
*/
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
type LiveblocksTextEditorTextFormat = {
|
|
113
113
|
bold: boolean;
|
|
114
114
|
italic: boolean;
|
|
115
115
|
strikethrough: boolean;
|
|
116
116
|
code: boolean;
|
|
117
117
|
};
|
|
118
|
-
|
|
118
|
+
type LiveblocksTextEditorTextNode = {
|
|
119
119
|
type: "text";
|
|
120
120
|
text: string;
|
|
121
121
|
} & LiveblocksTextEditorTextFormat;
|
|
122
|
-
|
|
122
|
+
type LiveblocksTextEditorMentionNode = {
|
|
123
123
|
type: "mention";
|
|
124
124
|
userId: string;
|
|
125
125
|
};
|
|
@@ -136,14 +136,14 @@ declare type LiveblocksTextEditorMentionNode = {
|
|
|
136
136
|
* to represents a text mention with its surrounding text.
|
|
137
137
|
* -------------------------------------------------------------------------------------------------
|
|
138
138
|
*/
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
type LiveblocksTextEditorNode = LiveblocksTextEditorTextNode | LiveblocksTextEditorMentionNode;
|
|
140
|
+
type TextEditorContainerComponentProps = {
|
|
141
141
|
/**
|
|
142
142
|
* The nodes of the text editor
|
|
143
143
|
*/
|
|
144
144
|
children: ReactNode;
|
|
145
145
|
};
|
|
146
|
-
|
|
146
|
+
type TextEditorMentionComponentProps<U extends BaseUserMeta = DU> = {
|
|
147
147
|
/**
|
|
148
148
|
* The mention element.
|
|
149
149
|
*/
|
|
@@ -153,13 +153,13 @@ declare type TextEditorMentionComponentProps<U extends BaseUserMeta = DU> = {
|
|
|
153
153
|
*/
|
|
154
154
|
user?: U["info"];
|
|
155
155
|
};
|
|
156
|
-
|
|
156
|
+
type TextEditorTextComponentProps = {
|
|
157
157
|
/**
|
|
158
158
|
* The text element.
|
|
159
159
|
*/
|
|
160
160
|
element: LiveblocksTextEditorTextNode;
|
|
161
161
|
};
|
|
162
|
-
|
|
162
|
+
type ConvertTextEditorNodesAsReactComponents<U extends BaseUserMeta = DU> = {
|
|
163
163
|
/**
|
|
164
164
|
*
|
|
165
165
|
* The component used to act as a container to wrap text editor nodes,
|
|
@@ -174,7 +174,7 @@ declare type ConvertTextEditorNodesAsReactComponents<U extends BaseUserMeta = DU
|
|
|
174
174
|
*/
|
|
175
175
|
Text: ComponentType<TextEditorTextComponentProps>;
|
|
176
176
|
};
|
|
177
|
-
|
|
177
|
+
type ConvertTextEditorNodesAsHtmlStyles = {
|
|
178
178
|
/**
|
|
179
179
|
* The default inline CSS styles used to display container element.
|
|
180
180
|
*/
|
|
@@ -193,28 +193,28 @@ declare type ConvertTextEditorNodesAsHtmlStyles = {
|
|
|
193
193
|
mention: CSSProperties;
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
type MentionEmailBaseData = {
|
|
197
197
|
id: string;
|
|
198
198
|
roomId: string;
|
|
199
199
|
userId: string;
|
|
200
200
|
textEditorNodes: LiveblocksTextEditorNode[];
|
|
201
201
|
createdAt: Date;
|
|
202
202
|
};
|
|
203
|
-
|
|
203
|
+
type PrepareTextMentionNotificationEmailBaseDataOptions = {
|
|
204
204
|
/**
|
|
205
205
|
* A function that returns room info from room IDs.
|
|
206
206
|
*/
|
|
207
207
|
resolveRoomInfo?: (args: ResolveRoomInfoArgs) => OptionalPromise<DRI | undefined>;
|
|
208
208
|
};
|
|
209
|
-
|
|
209
|
+
type MentionEmailAsReactData<U extends BaseUserMeta = DU> = Omit<MentionEmailBaseData, "userId" | "textEditorNodes"> & {
|
|
210
210
|
author: U;
|
|
211
211
|
reactContent: ReactNode;
|
|
212
212
|
};
|
|
213
|
-
|
|
213
|
+
type MentionEmailAsHtmlData<U extends BaseUserMeta = DU> = Omit<MentionEmailBaseData, "userId" | "textEditorNodes"> & {
|
|
214
214
|
author: U;
|
|
215
215
|
htmlContent: string;
|
|
216
216
|
};
|
|
217
|
-
|
|
217
|
+
type PrepareTextMentionNotificationEmailAsReactOptions<U extends BaseUserMeta = DU> = PrepareTextMentionNotificationEmailBaseDataOptions & {
|
|
218
218
|
/**
|
|
219
219
|
* A function that returns info from user IDs.
|
|
220
220
|
*/
|
|
@@ -225,11 +225,11 @@ declare type PrepareTextMentionNotificationEmailAsReactOptions<U extends BaseUse
|
|
|
225
225
|
*/
|
|
226
226
|
components?: Partial<ConvertTextEditorNodesAsReactComponents<U>>;
|
|
227
227
|
};
|
|
228
|
-
|
|
228
|
+
type TextMentionNotificationEmailData<U extends BaseUserMeta, M extends MentionEmailAsReactData<U> | MentionEmailAsHtmlData<U>> = {
|
|
229
229
|
mention: M;
|
|
230
230
|
roomInfo: DRI;
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
type TextMentionNotificationEmailDataAsReact = TextMentionNotificationEmailData<BaseUserMeta, MentionEmailAsReactData>;
|
|
233
233
|
/**
|
|
234
234
|
* Prepares data from a `TextMentionNotificationEvent` and convert content as React nodes.
|
|
235
235
|
*
|
|
@@ -255,7 +255,7 @@ declare type TextMentionNotificationEmailDataAsReact = TextMentionNotificationEm
|
|
|
255
255
|
* )
|
|
256
256
|
*/
|
|
257
257
|
declare function prepareTextMentionNotificationEmailAsReact(client: Liveblocks, event: TextMentionNotificationEvent, options?: PrepareTextMentionNotificationEmailAsReactOptions<BaseUserMeta>): Promise<TextMentionNotificationEmailDataAsReact | null>;
|
|
258
|
-
|
|
258
|
+
type PrepareTextMentionNotificationEmailAsHtmlOptions<U extends BaseUserMeta = DU> = PrepareTextMentionNotificationEmailBaseDataOptions & {
|
|
259
259
|
/**
|
|
260
260
|
* A function that returns info from user IDs.
|
|
261
261
|
*/
|
|
@@ -266,7 +266,7 @@ declare type PrepareTextMentionNotificationEmailAsHtmlOptions<U extends BaseUser
|
|
|
266
266
|
*/
|
|
267
267
|
styles?: Partial<ConvertTextEditorNodesAsHtmlStyles>;
|
|
268
268
|
};
|
|
269
|
-
|
|
269
|
+
type TextMentionNotificationEmailDataAsHtml = TextMentionNotificationEmailData<BaseUserMeta, MentionEmailAsHtmlData>;
|
|
270
270
|
/**
|
|
271
271
|
* Prepares data from a `TextMentionNotificationEvent` and convert content as an html safe string.
|
|
272
272
|
*
|
|
@@ -293,7 +293,7 @@ declare type TextMentionNotificationEmailDataAsHtml = TextMentionNotificationEma
|
|
|
293
293
|
*/
|
|
294
294
|
declare function prepareTextMentionNotificationEmailAsHtml(client: Liveblocks, event: TextMentionNotificationEvent, options?: PrepareTextMentionNotificationEmailAsHtmlOptions<BaseUserMeta>): Promise<TextMentionNotificationEmailDataAsHtml | null>;
|
|
295
295
|
|
|
296
|
-
|
|
296
|
+
type CommentEmailBaseData = {
|
|
297
297
|
id: string;
|
|
298
298
|
threadId: string;
|
|
299
299
|
roomId: string;
|
|
@@ -302,32 +302,32 @@ declare type CommentEmailBaseData = {
|
|
|
302
302
|
url?: string;
|
|
303
303
|
rawBody: CommentBody;
|
|
304
304
|
};
|
|
305
|
-
|
|
305
|
+
type PrepareThreadNotificationEmailBaseDataOptions = {
|
|
306
306
|
/**
|
|
307
307
|
* A function that returns room info from room IDs.
|
|
308
308
|
*/
|
|
309
309
|
resolveRoomInfo?: (args: ResolveRoomInfoArgs) => OptionalPromise<DRI | undefined>;
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
type CommentEmailAsHtmlData<U extends BaseUserMeta = DU> = Omit<CommentEmailBaseData, "userId" | "rawBody"> & {
|
|
312
312
|
author: U;
|
|
313
313
|
htmlBody: string;
|
|
314
314
|
};
|
|
315
|
-
|
|
315
|
+
type CommentEmailAsReactData<U extends BaseUserMeta = DU> = Omit<CommentEmailBaseData, "userId" | "rawBody"> & {
|
|
316
316
|
author: U;
|
|
317
317
|
reactBody: ReactNode;
|
|
318
318
|
};
|
|
319
|
-
|
|
319
|
+
type ThreadNotificationEmailUnreadRepliesData<U extends BaseUserMeta, C extends CommentEmailAsHtmlData<U> | CommentEmailAsReactData<U>> = {
|
|
320
320
|
type: "unreadReplies";
|
|
321
321
|
comments: C[];
|
|
322
322
|
};
|
|
323
|
-
|
|
323
|
+
type ThreadNotificationEmailUnreadMentionsData<U extends BaseUserMeta, C extends CommentEmailAsHtmlData<U> | CommentEmailAsReactData<U>> = {
|
|
324
324
|
type: "unreadMention";
|
|
325
325
|
comment: C;
|
|
326
326
|
};
|
|
327
|
-
|
|
327
|
+
type ThreadNotificationEmailData<U extends BaseUserMeta, C extends CommentEmailAsHtmlData<U> | CommentEmailAsReactData<U>> = (ThreadNotificationEmailUnreadRepliesData<U, C> | ThreadNotificationEmailUnreadMentionsData<U, C>) & {
|
|
328
328
|
roomInfo: DRI;
|
|
329
329
|
};
|
|
330
|
-
|
|
330
|
+
type PrepareThreadNotificationEmailAsHtmlOptions<U extends BaseUserMeta = DU> = PrepareThreadNotificationEmailBaseDataOptions & {
|
|
331
331
|
/**
|
|
332
332
|
* A function that returns info from user IDs.
|
|
333
333
|
*/
|
|
@@ -338,7 +338,7 @@ declare type PrepareThreadNotificationEmailAsHtmlOptions<U extends BaseUserMeta
|
|
|
338
338
|
*/
|
|
339
339
|
styles?: Partial<ConvertCommentBodyAsHtmlStyles>;
|
|
340
340
|
};
|
|
341
|
-
|
|
341
|
+
type ThreadNotificationEmailDataAsHtml = ThreadNotificationEmailData<BaseUserMeta, CommentEmailAsHtmlData>;
|
|
342
342
|
/**
|
|
343
343
|
* Prepares data from a `ThreadNotificationEvent` and convert comment bodies as an html safe string.
|
|
344
344
|
*
|
|
@@ -366,7 +366,7 @@ declare type ThreadNotificationEmailDataAsHtml = ThreadNotificationEmailData<Bas
|
|
|
366
366
|
*
|
|
367
367
|
*/
|
|
368
368
|
declare function prepareThreadNotificationEmailAsHtml(client: Liveblocks, event: ThreadNotificationEvent, options?: PrepareThreadNotificationEmailAsHtmlOptions<BaseUserMeta>): Promise<ThreadNotificationEmailDataAsHtml | null>;
|
|
369
|
-
|
|
369
|
+
type PrepareThreadNotificationEmailAsReactOptions<U extends BaseUserMeta = DU> = PrepareThreadNotificationEmailBaseDataOptions & {
|
|
370
370
|
/**
|
|
371
371
|
* A function that returns info from user IDs.
|
|
372
372
|
*/
|
|
@@ -377,7 +377,7 @@ declare type PrepareThreadNotificationEmailAsReactOptions<U extends BaseUserMeta
|
|
|
377
377
|
*/
|
|
378
378
|
components?: Partial<ConvertCommentBodyAsReactComponents<U>>;
|
|
379
379
|
};
|
|
380
|
-
|
|
380
|
+
type ThreadNotificationEmailDataAsReact = ThreadNotificationEmailData<BaseUserMeta, CommentEmailAsReactData>;
|
|
381
381
|
/**
|
|
382
382
|
* Prepares data from a `ThreadNotificationEvent` and convert comment bodies as React nodes.
|
|
383
383
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -9,27 +9,27 @@ import { Liveblocks, TextMentionNotificationEvent, ThreadNotificationEvent } fro
|
|
|
9
9
|
* Type alias for DX purposes.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
type CSSProperties = Properties;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
type CommentBodyContainerComponentProps = {
|
|
15
15
|
/**
|
|
16
16
|
* The blocks of the comment body
|
|
17
17
|
*/
|
|
18
18
|
children: ReactNode;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type CommentBodyParagraphComponentProps = {
|
|
21
21
|
/**
|
|
22
22
|
* The text content of the paragraph.
|
|
23
23
|
*/
|
|
24
24
|
children: ReactNode;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
type CommentBodyTextComponentProps = {
|
|
27
27
|
/**
|
|
28
28
|
* The text element.
|
|
29
29
|
*/
|
|
30
30
|
element: CommentBodyText;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
type CommentBodyLinkComponentProps = {
|
|
33
33
|
/**
|
|
34
34
|
* The link element.
|
|
35
35
|
*/
|
|
@@ -39,7 +39,7 @@ declare type CommentBodyLinkComponentProps = {
|
|
|
39
39
|
*/
|
|
40
40
|
href: string;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
type CommentBodyMentionComponentProps<U extends BaseUserMeta = DU> = {
|
|
43
43
|
/**
|
|
44
44
|
* The mention element.
|
|
45
45
|
*/
|
|
@@ -49,7 +49,7 @@ declare type CommentBodyMentionComponentProps<U extends BaseUserMeta = DU> = {
|
|
|
49
49
|
*/
|
|
50
50
|
user?: U["info"];
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
type ConvertCommentBodyAsReactComponents<U extends BaseUserMeta = DU> = {
|
|
53
53
|
/**
|
|
54
54
|
*
|
|
55
55
|
* The component used to act as a container to wrap comment body blocks,
|
|
@@ -72,7 +72,7 @@ declare type ConvertCommentBodyAsReactComponents<U extends BaseUserMeta = DU> =
|
|
|
72
72
|
*/
|
|
73
73
|
Mention: ComponentType<CommentBodyMentionComponentProps<U>>;
|
|
74
74
|
};
|
|
75
|
-
|
|
75
|
+
type ConvertCommentBodyAsHtmlStyles = {
|
|
76
76
|
/**
|
|
77
77
|
* The default inline CSS styles used to display paragraphs.
|
|
78
78
|
*/
|
|
@@ -95,7 +95,7 @@ declare type ConvertCommentBodyAsHtmlStyles = {
|
|
|
95
95
|
link: CSSProperties;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
type ResolveRoomInfoArgs = {
|
|
99
99
|
/**
|
|
100
100
|
* The ID of the room to resolve
|
|
101
101
|
*/
|
|
@@ -109,17 +109,17 @@ declare type ResolveRoomInfoArgs = {
|
|
|
109
109
|
* and then convert them more easily as React or as html.
|
|
110
110
|
*/
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
type LiveblocksTextEditorTextFormat = {
|
|
113
113
|
bold: boolean;
|
|
114
114
|
italic: boolean;
|
|
115
115
|
strikethrough: boolean;
|
|
116
116
|
code: boolean;
|
|
117
117
|
};
|
|
118
|
-
|
|
118
|
+
type LiveblocksTextEditorTextNode = {
|
|
119
119
|
type: "text";
|
|
120
120
|
text: string;
|
|
121
121
|
} & LiveblocksTextEditorTextFormat;
|
|
122
|
-
|
|
122
|
+
type LiveblocksTextEditorMentionNode = {
|
|
123
123
|
type: "mention";
|
|
124
124
|
userId: string;
|
|
125
125
|
};
|
|
@@ -136,14 +136,14 @@ declare type LiveblocksTextEditorMentionNode = {
|
|
|
136
136
|
* to represents a text mention with its surrounding text.
|
|
137
137
|
* -------------------------------------------------------------------------------------------------
|
|
138
138
|
*/
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
type LiveblocksTextEditorNode = LiveblocksTextEditorTextNode | LiveblocksTextEditorMentionNode;
|
|
140
|
+
type TextEditorContainerComponentProps = {
|
|
141
141
|
/**
|
|
142
142
|
* The nodes of the text editor
|
|
143
143
|
*/
|
|
144
144
|
children: ReactNode;
|
|
145
145
|
};
|
|
146
|
-
|
|
146
|
+
type TextEditorMentionComponentProps<U extends BaseUserMeta = DU> = {
|
|
147
147
|
/**
|
|
148
148
|
* The mention element.
|
|
149
149
|
*/
|
|
@@ -153,13 +153,13 @@ declare type TextEditorMentionComponentProps<U extends BaseUserMeta = DU> = {
|
|
|
153
153
|
*/
|
|
154
154
|
user?: U["info"];
|
|
155
155
|
};
|
|
156
|
-
|
|
156
|
+
type TextEditorTextComponentProps = {
|
|
157
157
|
/**
|
|
158
158
|
* The text element.
|
|
159
159
|
*/
|
|
160
160
|
element: LiveblocksTextEditorTextNode;
|
|
161
161
|
};
|
|
162
|
-
|
|
162
|
+
type ConvertTextEditorNodesAsReactComponents<U extends BaseUserMeta = DU> = {
|
|
163
163
|
/**
|
|
164
164
|
*
|
|
165
165
|
* The component used to act as a container to wrap text editor nodes,
|
|
@@ -174,7 +174,7 @@ declare type ConvertTextEditorNodesAsReactComponents<U extends BaseUserMeta = DU
|
|
|
174
174
|
*/
|
|
175
175
|
Text: ComponentType<TextEditorTextComponentProps>;
|
|
176
176
|
};
|
|
177
|
-
|
|
177
|
+
type ConvertTextEditorNodesAsHtmlStyles = {
|
|
178
178
|
/**
|
|
179
179
|
* The default inline CSS styles used to display container element.
|
|
180
180
|
*/
|
|
@@ -193,28 +193,28 @@ declare type ConvertTextEditorNodesAsHtmlStyles = {
|
|
|
193
193
|
mention: CSSProperties;
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
type MentionEmailBaseData = {
|
|
197
197
|
id: string;
|
|
198
198
|
roomId: string;
|
|
199
199
|
userId: string;
|
|
200
200
|
textEditorNodes: LiveblocksTextEditorNode[];
|
|
201
201
|
createdAt: Date;
|
|
202
202
|
};
|
|
203
|
-
|
|
203
|
+
type PrepareTextMentionNotificationEmailBaseDataOptions = {
|
|
204
204
|
/**
|
|
205
205
|
* A function that returns room info from room IDs.
|
|
206
206
|
*/
|
|
207
207
|
resolveRoomInfo?: (args: ResolveRoomInfoArgs) => OptionalPromise<DRI | undefined>;
|
|
208
208
|
};
|
|
209
|
-
|
|
209
|
+
type MentionEmailAsReactData<U extends BaseUserMeta = DU> = Omit<MentionEmailBaseData, "userId" | "textEditorNodes"> & {
|
|
210
210
|
author: U;
|
|
211
211
|
reactContent: ReactNode;
|
|
212
212
|
};
|
|
213
|
-
|
|
213
|
+
type MentionEmailAsHtmlData<U extends BaseUserMeta = DU> = Omit<MentionEmailBaseData, "userId" | "textEditorNodes"> & {
|
|
214
214
|
author: U;
|
|
215
215
|
htmlContent: string;
|
|
216
216
|
};
|
|
217
|
-
|
|
217
|
+
type PrepareTextMentionNotificationEmailAsReactOptions<U extends BaseUserMeta = DU> = PrepareTextMentionNotificationEmailBaseDataOptions & {
|
|
218
218
|
/**
|
|
219
219
|
* A function that returns info from user IDs.
|
|
220
220
|
*/
|
|
@@ -225,11 +225,11 @@ declare type PrepareTextMentionNotificationEmailAsReactOptions<U extends BaseUse
|
|
|
225
225
|
*/
|
|
226
226
|
components?: Partial<ConvertTextEditorNodesAsReactComponents<U>>;
|
|
227
227
|
};
|
|
228
|
-
|
|
228
|
+
type TextMentionNotificationEmailData<U extends BaseUserMeta, M extends MentionEmailAsReactData<U> | MentionEmailAsHtmlData<U>> = {
|
|
229
229
|
mention: M;
|
|
230
230
|
roomInfo: DRI;
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
type TextMentionNotificationEmailDataAsReact = TextMentionNotificationEmailData<BaseUserMeta, MentionEmailAsReactData>;
|
|
233
233
|
/**
|
|
234
234
|
* Prepares data from a `TextMentionNotificationEvent` and convert content as React nodes.
|
|
235
235
|
*
|
|
@@ -255,7 +255,7 @@ declare type TextMentionNotificationEmailDataAsReact = TextMentionNotificationEm
|
|
|
255
255
|
* )
|
|
256
256
|
*/
|
|
257
257
|
declare function prepareTextMentionNotificationEmailAsReact(client: Liveblocks, event: TextMentionNotificationEvent, options?: PrepareTextMentionNotificationEmailAsReactOptions<BaseUserMeta>): Promise<TextMentionNotificationEmailDataAsReact | null>;
|
|
258
|
-
|
|
258
|
+
type PrepareTextMentionNotificationEmailAsHtmlOptions<U extends BaseUserMeta = DU> = PrepareTextMentionNotificationEmailBaseDataOptions & {
|
|
259
259
|
/**
|
|
260
260
|
* A function that returns info from user IDs.
|
|
261
261
|
*/
|
|
@@ -266,7 +266,7 @@ declare type PrepareTextMentionNotificationEmailAsHtmlOptions<U extends BaseUser
|
|
|
266
266
|
*/
|
|
267
267
|
styles?: Partial<ConvertTextEditorNodesAsHtmlStyles>;
|
|
268
268
|
};
|
|
269
|
-
|
|
269
|
+
type TextMentionNotificationEmailDataAsHtml = TextMentionNotificationEmailData<BaseUserMeta, MentionEmailAsHtmlData>;
|
|
270
270
|
/**
|
|
271
271
|
* Prepares data from a `TextMentionNotificationEvent` and convert content as an html safe string.
|
|
272
272
|
*
|
|
@@ -293,7 +293,7 @@ declare type TextMentionNotificationEmailDataAsHtml = TextMentionNotificationEma
|
|
|
293
293
|
*/
|
|
294
294
|
declare function prepareTextMentionNotificationEmailAsHtml(client: Liveblocks, event: TextMentionNotificationEvent, options?: PrepareTextMentionNotificationEmailAsHtmlOptions<BaseUserMeta>): Promise<TextMentionNotificationEmailDataAsHtml | null>;
|
|
295
295
|
|
|
296
|
-
|
|
296
|
+
type CommentEmailBaseData = {
|
|
297
297
|
id: string;
|
|
298
298
|
threadId: string;
|
|
299
299
|
roomId: string;
|
|
@@ -302,32 +302,32 @@ declare type CommentEmailBaseData = {
|
|
|
302
302
|
url?: string;
|
|
303
303
|
rawBody: CommentBody;
|
|
304
304
|
};
|
|
305
|
-
|
|
305
|
+
type PrepareThreadNotificationEmailBaseDataOptions = {
|
|
306
306
|
/**
|
|
307
307
|
* A function that returns room info from room IDs.
|
|
308
308
|
*/
|
|
309
309
|
resolveRoomInfo?: (args: ResolveRoomInfoArgs) => OptionalPromise<DRI | undefined>;
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
type CommentEmailAsHtmlData<U extends BaseUserMeta = DU> = Omit<CommentEmailBaseData, "userId" | "rawBody"> & {
|
|
312
312
|
author: U;
|
|
313
313
|
htmlBody: string;
|
|
314
314
|
};
|
|
315
|
-
|
|
315
|
+
type CommentEmailAsReactData<U extends BaseUserMeta = DU> = Omit<CommentEmailBaseData, "userId" | "rawBody"> & {
|
|
316
316
|
author: U;
|
|
317
317
|
reactBody: ReactNode;
|
|
318
318
|
};
|
|
319
|
-
|
|
319
|
+
type ThreadNotificationEmailUnreadRepliesData<U extends BaseUserMeta, C extends CommentEmailAsHtmlData<U> | CommentEmailAsReactData<U>> = {
|
|
320
320
|
type: "unreadReplies";
|
|
321
321
|
comments: C[];
|
|
322
322
|
};
|
|
323
|
-
|
|
323
|
+
type ThreadNotificationEmailUnreadMentionsData<U extends BaseUserMeta, C extends CommentEmailAsHtmlData<U> | CommentEmailAsReactData<U>> = {
|
|
324
324
|
type: "unreadMention";
|
|
325
325
|
comment: C;
|
|
326
326
|
};
|
|
327
|
-
|
|
327
|
+
type ThreadNotificationEmailData<U extends BaseUserMeta, C extends CommentEmailAsHtmlData<U> | CommentEmailAsReactData<U>> = (ThreadNotificationEmailUnreadRepliesData<U, C> | ThreadNotificationEmailUnreadMentionsData<U, C>) & {
|
|
328
328
|
roomInfo: DRI;
|
|
329
329
|
};
|
|
330
|
-
|
|
330
|
+
type PrepareThreadNotificationEmailAsHtmlOptions<U extends BaseUserMeta = DU> = PrepareThreadNotificationEmailBaseDataOptions & {
|
|
331
331
|
/**
|
|
332
332
|
* A function that returns info from user IDs.
|
|
333
333
|
*/
|
|
@@ -338,7 +338,7 @@ declare type PrepareThreadNotificationEmailAsHtmlOptions<U extends BaseUserMeta
|
|
|
338
338
|
*/
|
|
339
339
|
styles?: Partial<ConvertCommentBodyAsHtmlStyles>;
|
|
340
340
|
};
|
|
341
|
-
|
|
341
|
+
type ThreadNotificationEmailDataAsHtml = ThreadNotificationEmailData<BaseUserMeta, CommentEmailAsHtmlData>;
|
|
342
342
|
/**
|
|
343
343
|
* Prepares data from a `ThreadNotificationEvent` and convert comment bodies as an html safe string.
|
|
344
344
|
*
|
|
@@ -366,7 +366,7 @@ declare type ThreadNotificationEmailDataAsHtml = ThreadNotificationEmailData<Bas
|
|
|
366
366
|
*
|
|
367
367
|
*/
|
|
368
368
|
declare function prepareThreadNotificationEmailAsHtml(client: Liveblocks, event: ThreadNotificationEvent, options?: PrepareThreadNotificationEmailAsHtmlOptions<BaseUserMeta>): Promise<ThreadNotificationEmailDataAsHtml | null>;
|
|
369
|
-
|
|
369
|
+
type PrepareThreadNotificationEmailAsReactOptions<U extends BaseUserMeta = DU> = PrepareThreadNotificationEmailBaseDataOptions & {
|
|
370
370
|
/**
|
|
371
371
|
* A function that returns info from user IDs.
|
|
372
372
|
*/
|
|
@@ -377,7 +377,7 @@ declare type PrepareThreadNotificationEmailAsReactOptions<U extends BaseUserMeta
|
|
|
377
377
|
*/
|
|
378
378
|
components?: Partial<ConvertCommentBodyAsReactComponents<U>>;
|
|
379
379
|
};
|
|
380
|
-
|
|
380
|
+
type ThreadNotificationEmailDataAsReact = ThreadNotificationEmailData<BaseUserMeta, CommentEmailAsReactData>;
|
|
381
381
|
/**
|
|
382
382
|
* Prepares data from a `ThreadNotificationEvent` and convert comment bodies as React nodes.
|
|
383
383
|
*
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var _core = require('@liveblocks/core');
|
|
|
3
3
|
|
|
4
4
|
// src/version.ts
|
|
5
5
|
var PKG_NAME = "@liveblocks/emails";
|
|
6
|
-
var PKG_VERSION = "2.
|
|
6
|
+
var PKG_VERSION = "2.16.0-toolbars1";
|
|
7
7
|
var PKG_FORMAT = "cjs";
|
|
8
8
|
|
|
9
9
|
// ../../node_modules/lib0/map.js
|
|
@@ -7428,7 +7428,9 @@ function createSerializedLexicalElementNode(item) {
|
|
|
7428
7428
|
} else if (content instanceof YMap) {
|
|
7429
7429
|
children.push(createSerializedLexicalMapNode(content));
|
|
7430
7430
|
} else if (content instanceof YXmlElement) {
|
|
7431
|
-
children.push(
|
|
7431
|
+
children.push(
|
|
7432
|
+
createSerializedLexicalDecoratorNode(content)
|
|
7433
|
+
);
|
|
7432
7434
|
}
|
|
7433
7435
|
} else if (start.content instanceof ContentString) {
|
|
7434
7436
|
if (children.length > 0) {
|
|
@@ -7461,7 +7463,9 @@ function createSerializedLexicalRootNode(root) {
|
|
|
7461
7463
|
if (content instanceof YXmlText) {
|
|
7462
7464
|
children.push(createSerializedLexicalElementNode(content));
|
|
7463
7465
|
} else if (content instanceof YXmlElement) {
|
|
7464
|
-
children.push(
|
|
7466
|
+
children.push(
|
|
7467
|
+
createSerializedLexicalDecoratorNode(content)
|
|
7468
|
+
);
|
|
7465
7469
|
}
|
|
7466
7470
|
}
|
|
7467
7471
|
start = start.right;
|