@engagently/types 2.4.0 → 2.6.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/common/_types/ConfigDefinition.d.ts +13 -3
- package/dist/common/_types/WidgetDefinitions.d.ts +9 -3
- package/dist/common/lib/api/enums.d.ts +2 -0
- package/dist/i18n/i18n.d.ts +36 -11
- package/dist/main/lib/engagently.d.ts +2 -1
- package/dist/ui/themes/_types.d.ts +2 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ export type CallbackFn = (data: {
|
|
|
12
12
|
export type ErrorCallbackFn = (error: CombinedError, operation: Operation) => void;
|
|
13
13
|
export type EventHooks = 'onAny' | 'onChangeViewMode' | 'onLoadMoreComments' | 'onLoadMoreReplies';
|
|
14
14
|
export declare const EventHookMessageEventMap: Record<EventHooks, MessageEvents | MessageEvents[]>;
|
|
15
|
+
export type Translations = Record<string, DeepPartial<typeof defaultResources.en>>;
|
|
15
16
|
/**
|
|
16
17
|
* Definition for the configuration that the client will pass when
|
|
17
18
|
* initializing engagently
|
|
@@ -23,7 +24,7 @@ export interface EngageConfig {
|
|
|
23
24
|
palette?: PaletteConfig;
|
|
24
25
|
theme?: `${AvailableThemes}`;
|
|
25
26
|
defaultLanguage?: string;
|
|
26
|
-
translations?:
|
|
27
|
+
translations?: Translations;
|
|
27
28
|
dev?: boolean;
|
|
28
29
|
colorScheme?: `${ColorSchemesConfig}`;
|
|
29
30
|
cta?: Partial<Record<DsmFeatureName | PlmFeatureName, CallbackFn>>;
|
|
@@ -46,8 +47,17 @@ export type CommunityConfig = {
|
|
|
46
47
|
settings: Record<string, number>;
|
|
47
48
|
};
|
|
48
49
|
discussion: {
|
|
49
|
-
settings:
|
|
50
|
+
settings: {
|
|
51
|
+
COMMENTARY_MAX_LENGTH: number;
|
|
52
|
+
COMMENTARY_PREVIEW_LENGTH: number;
|
|
53
|
+
PREAMBLE_ENABLED: boolean;
|
|
54
|
+
THREAD_MORE_COMMENTS_SIZE: number;
|
|
55
|
+
THREAD_REPLIES_SIZE: number;
|
|
56
|
+
THREAD_COMMENTS_SIZE: number;
|
|
57
|
+
THREAD_MORE_REPLIES_SIZE: number;
|
|
58
|
+
LIST_COMMENTARIES_SIZE: number;
|
|
59
|
+
LIST_MORE_COMMENTARIES_SIZE: number;
|
|
60
|
+
};
|
|
50
61
|
};
|
|
51
62
|
} | null;
|
|
52
63
|
};
|
|
53
|
-
export type CommentarySetting = 'COMMENTARY_MAX_LENGTH' | 'COMMENTARY_PREVIEW_LENGTH' | 'THREAD_MORE_COMMENTS_SIZE' | 'THREAD_REPLIES_SIZE' | 'THREAD_COMMENTS_SIZE' | 'THREAD_MORE_REPLIES_SIZE' | 'LIST_COMMENTARIES_SIZE' | 'LIST_MORE_COMMENTARIES_SIZE';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VNode } from 'preact';
|
|
1
2
|
/**
|
|
2
3
|
* Type Definitions for all available entities
|
|
3
4
|
*
|
|
@@ -46,14 +47,19 @@ export type DiscussionAttributesComponent = {
|
|
|
46
47
|
imageUrl?: string;
|
|
47
48
|
};
|
|
48
49
|
export declare enum DiscussionSlots {
|
|
50
|
+
PROFILE_ICON = "dialogProfileIcon",
|
|
51
|
+
COMMENTS_ICON = "dialogCommentsIcon",
|
|
52
|
+
BOOKMARK = "dialogBookmarkIcon",
|
|
53
|
+
ACCOUNT_ICON = "dialogAccountIcon",
|
|
54
|
+
SETTINGS_ICON = "dialogSettingsIcon",
|
|
55
|
+
LIVE_MODE_ICON = "liveModeIcon",
|
|
49
56
|
REPLY_ICON = "replyIcon",
|
|
50
57
|
REACTION1 = "reaction1",
|
|
51
58
|
REACTION1_active = "reaction1_active",
|
|
52
59
|
REACTION2 = "reaction2",
|
|
53
60
|
REACTION2_active = "reaction2_active",
|
|
54
61
|
REACTION3 = "reaction3",
|
|
55
|
-
REACTION3_active = "reaction3_active"
|
|
56
|
-
WELCOME_MESSAGE = "welcome"
|
|
62
|
+
REACTION3_active = "reaction3_active"
|
|
57
63
|
}
|
|
58
64
|
export interface DiscussionWidget {
|
|
59
65
|
name: EgyEntities.EGY_DISCUSSION;
|
|
@@ -112,5 +118,5 @@ export type AttributesToComponentProps<T extends Array<string>> = {
|
|
|
112
118
|
* requiring React Elements -> { foo: JSX.Element; bar: JSX.Element }
|
|
113
119
|
*/
|
|
114
120
|
export type SlotsToComponentProps<T extends Array<string>> = {
|
|
115
|
-
[Key in T[number]]:
|
|
121
|
+
[Key in T[number]]: VNode;
|
|
116
122
|
};
|
|
@@ -16,6 +16,8 @@ export declare enum DsmDiscussionState {
|
|
|
16
16
|
export declare enum DsmFeatureName {
|
|
17
17
|
Comment = "COMMENT",
|
|
18
18
|
CommentaryRead = "COMMENTARY_READ",
|
|
19
|
+
InstantContext = "INSTANT_CONTEXT",
|
|
20
|
+
MyProfile = "MY_PROFILE",
|
|
19
21
|
Profile = "PROFILE",
|
|
20
22
|
Reaction = "REACTION",
|
|
21
23
|
Reply = "REPLY",
|
package/dist/i18n/i18n.d.ts
CHANGED
|
@@ -40,16 +40,19 @@ export declare const defaultResources: {
|
|
|
40
40
|
commentary_other: string;
|
|
41
41
|
"copy-to-clipboard": string;
|
|
42
42
|
"date-and-time": string;
|
|
43
|
+
edited: string;
|
|
43
44
|
"featured-comment": string;
|
|
44
45
|
live: string;
|
|
45
46
|
"load-more": string;
|
|
46
47
|
"load-newer-comments": string;
|
|
47
48
|
"load-older-comments": string;
|
|
49
|
+
options: string;
|
|
48
50
|
reply: string;
|
|
49
51
|
"reply-do": string;
|
|
50
52
|
reply_other: string;
|
|
51
53
|
"reply-count": string;
|
|
52
54
|
"reply-count_other": string;
|
|
55
|
+
share: string;
|
|
53
56
|
"shared-comment": string;
|
|
54
57
|
user: {
|
|
55
58
|
bio: string;
|
|
@@ -93,12 +96,10 @@ export declare const defaultResources: {
|
|
|
93
96
|
};
|
|
94
97
|
LIST: {
|
|
95
98
|
description: string;
|
|
96
|
-
header: string;
|
|
97
99
|
title: string;
|
|
98
100
|
};
|
|
99
101
|
THREAD: {
|
|
100
102
|
description: string;
|
|
101
|
-
header: string;
|
|
102
103
|
title: string;
|
|
103
104
|
};
|
|
104
105
|
sort: string;
|
|
@@ -127,6 +128,13 @@ export declare const defaultResources: {
|
|
|
127
128
|
"reply-to": string;
|
|
128
129
|
"show-less": string;
|
|
129
130
|
"show-more": string;
|
|
131
|
+
"text-editor": {
|
|
132
|
+
bold: string;
|
|
133
|
+
emojis: string;
|
|
134
|
+
italic: string;
|
|
135
|
+
underline: string;
|
|
136
|
+
};
|
|
137
|
+
"view-mode": string;
|
|
130
138
|
"view-modes": {
|
|
131
139
|
"all-comments": string;
|
|
132
140
|
featured: string;
|
|
@@ -163,6 +171,12 @@ export declare const defaultResources: {
|
|
|
163
171
|
COMMENTARY_READ: {
|
|
164
172
|
"call-to-action": string;
|
|
165
173
|
};
|
|
174
|
+
INSTANT_CONTEXT: {
|
|
175
|
+
"call-to-action": string;
|
|
176
|
+
};
|
|
177
|
+
MY_PROFILE: {
|
|
178
|
+
"call-to-action": string;
|
|
179
|
+
};
|
|
166
180
|
PROFILE: {
|
|
167
181
|
"call-to-action": string;
|
|
168
182
|
};
|
|
@@ -202,8 +216,6 @@ export declare const defaultResources: {
|
|
|
202
216
|
replies: string;
|
|
203
217
|
reply: string;
|
|
204
218
|
"reply-do": string;
|
|
205
|
-
"sub-thread": string;
|
|
206
|
-
"sub-threads": string;
|
|
207
219
|
thread: string;
|
|
208
220
|
threads: string;
|
|
209
221
|
vote: string;
|
|
@@ -212,8 +224,10 @@ export declare const defaultResources: {
|
|
|
212
224
|
messages: {
|
|
213
225
|
"discussion-closed": string;
|
|
214
226
|
"discussion-global-closed": string;
|
|
227
|
+
"discussion-preamble": string;
|
|
215
228
|
"log-in-to-comment": string;
|
|
216
229
|
"user-suspended": string;
|
|
230
|
+
"username-change": string;
|
|
217
231
|
};
|
|
218
232
|
poll: {
|
|
219
233
|
"thank-you-for-vote": string;
|
|
@@ -230,8 +244,6 @@ export declare const defaultResources: {
|
|
|
230
244
|
"profile-not-public": string;
|
|
231
245
|
"recent-activity": string;
|
|
232
246
|
settings: string;
|
|
233
|
-
"sign-in": string;
|
|
234
|
-
"sign-out": string;
|
|
235
247
|
};
|
|
236
248
|
actions: {
|
|
237
249
|
bookmarked: string;
|
|
@@ -261,16 +273,19 @@ export declare const defaultResources: {
|
|
|
261
273
|
commentary_other: string;
|
|
262
274
|
"copy-to-clipboard": string;
|
|
263
275
|
"date-and-time": string;
|
|
276
|
+
edited: string;
|
|
264
277
|
"featured-comment": string;
|
|
265
278
|
live: string;
|
|
266
279
|
"load-more": string;
|
|
267
280
|
"load-newer-comments": string;
|
|
268
281
|
"load-older-comments": string;
|
|
282
|
+
options: string;
|
|
269
283
|
reply: string;
|
|
270
284
|
"reply-do": string;
|
|
271
285
|
reply_other: string;
|
|
272
286
|
"reply-count": string;
|
|
273
287
|
"reply-count_other": string;
|
|
288
|
+
share: string;
|
|
274
289
|
"shared-comment": string;
|
|
275
290
|
user: {
|
|
276
291
|
bio: string;
|
|
@@ -314,12 +329,10 @@ export declare const defaultResources: {
|
|
|
314
329
|
};
|
|
315
330
|
LIST: {
|
|
316
331
|
description: string;
|
|
317
|
-
header: string;
|
|
318
332
|
title: string;
|
|
319
333
|
};
|
|
320
334
|
THREAD: {
|
|
321
335
|
description: string;
|
|
322
|
-
header: string;
|
|
323
336
|
title: string;
|
|
324
337
|
};
|
|
325
338
|
sort: string;
|
|
@@ -348,13 +361,19 @@ export declare const defaultResources: {
|
|
|
348
361
|
"reply-to": string;
|
|
349
362
|
"show-less": string;
|
|
350
363
|
"show-more": string;
|
|
364
|
+
"text-editor": {
|
|
365
|
+
bold: string;
|
|
366
|
+
emojis: string;
|
|
367
|
+
italic: string;
|
|
368
|
+
underline: string;
|
|
369
|
+
};
|
|
370
|
+
"view-mode": string;
|
|
351
371
|
"view-modes": {
|
|
352
372
|
"all-comments": string;
|
|
353
373
|
featured: string;
|
|
354
374
|
focus: string;
|
|
355
375
|
list: string;
|
|
356
376
|
live: string;
|
|
357
|
-
thread: string;
|
|
358
377
|
};
|
|
359
378
|
};
|
|
360
379
|
emojis: {
|
|
@@ -384,6 +403,12 @@ export declare const defaultResources: {
|
|
|
384
403
|
COMMENTARY_READ: {
|
|
385
404
|
"call-to-action": string;
|
|
386
405
|
};
|
|
406
|
+
INSTANT_CONTEXT: {
|
|
407
|
+
"call-to-action": string;
|
|
408
|
+
};
|
|
409
|
+
MY_PROFILE: {
|
|
410
|
+
"call-to-action": string;
|
|
411
|
+
};
|
|
387
412
|
PROFILE: {
|
|
388
413
|
"call-to-action": string;
|
|
389
414
|
};
|
|
@@ -423,8 +448,6 @@ export declare const defaultResources: {
|
|
|
423
448
|
replies: string;
|
|
424
449
|
reply: string;
|
|
425
450
|
"reply-do": string;
|
|
426
|
-
"sub-thread": string;
|
|
427
|
-
"sub-threads": string;
|
|
428
451
|
thread: string;
|
|
429
452
|
threads: string;
|
|
430
453
|
vote: string;
|
|
@@ -433,8 +456,10 @@ export declare const defaultResources: {
|
|
|
433
456
|
messages: {
|
|
434
457
|
"discussion-closed": string;
|
|
435
458
|
"discussion-global-closed": string;
|
|
459
|
+
"discussion-preamble": string;
|
|
436
460
|
"log-in-to-comment": string;
|
|
437
461
|
"user-suspended": string;
|
|
462
|
+
"username-change": string;
|
|
438
463
|
};
|
|
439
464
|
poll: {
|
|
440
465
|
"thank-you-for-vote": string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommunityConfig, EngageConfig } from '../../common/_types/ConfigDefinition';
|
|
1
|
+
import type { CommunityConfig, EngageConfig, Translations } from '../../common/_types/ConfigDefinition';
|
|
2
2
|
import type { SignOutOptions } from '../../common/lib/api/session';
|
|
3
3
|
export type Engagently = {
|
|
4
4
|
config?: EngageConfig;
|
|
@@ -7,6 +7,7 @@ export type Engagently = {
|
|
|
7
7
|
toggleColorScheme: (mode: 'auto' | 'dark' | 'light') => void;
|
|
8
8
|
signOut: (options?: SignOutOptions) => Promise<null | void>;
|
|
9
9
|
reinit: (config: Partial<EngageConfig>) => Promise<void>;
|
|
10
|
+
remoteTranslations?: Translations | null;
|
|
10
11
|
} & {
|
|
11
12
|
Configuration: (config: EngageConfig) => Promise<EngageConfig>;
|
|
12
13
|
};
|