@engagently/types 2.3.0 → 2.5.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.
@@ -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?: Record<string, Partial<typeof defaultResources.en>>;
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: Record<CommentarySetting, number>;
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]]: HTMLElement;
121
+ [Key in T[number]]: VNode;
116
122
  };
@@ -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;
@@ -202,8 +210,6 @@ export declare const defaultResources: {
202
210
  replies: string;
203
211
  reply: string;
204
212
  "reply-do": string;
205
- "sub-thread": string;
206
- "sub-threads": string;
207
213
  thread: string;
208
214
  threads: string;
209
215
  vote: string;
@@ -212,6 +218,7 @@ export declare const defaultResources: {
212
218
  messages: {
213
219
  "discussion-closed": string;
214
220
  "discussion-global-closed": string;
221
+ "discussion-preamble": string;
215
222
  "log-in-to-comment": string;
216
223
  "user-suspended": string;
217
224
  };
@@ -230,8 +237,6 @@ export declare const defaultResources: {
230
237
  "profile-not-public": string;
231
238
  "recent-activity": string;
232
239
  settings: string;
233
- "sign-in": string;
234
- "sign-out": string;
235
240
  };
236
241
  actions: {
237
242
  bookmarked: string;
@@ -261,16 +266,19 @@ export declare const defaultResources: {
261
266
  commentary_other: string;
262
267
  "copy-to-clipboard": string;
263
268
  "date-and-time": string;
269
+ edited: string;
264
270
  "featured-comment": string;
265
271
  live: string;
266
272
  "load-more": string;
267
273
  "load-newer-comments": string;
268
274
  "load-older-comments": string;
275
+ options: string;
269
276
  reply: string;
270
277
  "reply-do": string;
271
278
  reply_other: string;
272
279
  "reply-count": string;
273
280
  "reply-count_other": string;
281
+ share: string;
274
282
  "shared-comment": string;
275
283
  user: {
276
284
  bio: string;
@@ -314,12 +322,10 @@ export declare const defaultResources: {
314
322
  };
315
323
  LIST: {
316
324
  description: string;
317
- header: string;
318
325
  title: string;
319
326
  };
320
327
  THREAD: {
321
328
  description: string;
322
- header: string;
323
329
  title: string;
324
330
  };
325
331
  sort: string;
@@ -348,13 +354,19 @@ export declare const defaultResources: {
348
354
  "reply-to": string;
349
355
  "show-less": string;
350
356
  "show-more": string;
357
+ "text-editor": {
358
+ bold: string;
359
+ emojis: string;
360
+ italic: string;
361
+ underline: string;
362
+ };
363
+ "view-mode": string;
351
364
  "view-modes": {
352
365
  "all-comments": string;
353
366
  featured: string;
354
367
  focus: string;
355
368
  list: string;
356
369
  live: string;
357
- thread: string;
358
370
  };
359
371
  };
360
372
  emojis: {
@@ -423,8 +435,6 @@ export declare const defaultResources: {
423
435
  replies: string;
424
436
  reply: string;
425
437
  "reply-do": string;
426
- "sub-thread": string;
427
- "sub-threads": string;
428
438
  thread: string;
429
439
  threads: string;
430
440
  vote: string;
@@ -433,6 +443,7 @@ export declare const defaultResources: {
433
443
  messages: {
434
444
  "discussion-closed": string;
435
445
  "discussion-global-closed": string;
446
+ "discussion-preamble": string;
436
447
  "log-in-to-comment": string;
437
448
  "user-suspended": string;
438
449
  };
@@ -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
  };
@@ -1,6 +1,7 @@
1
1
  export declare enum AvailableThemes {
2
2
  default = "default",
3
- unstyled = "unstyled"
3
+ unstyled = "unstyled",
4
+ thread = "thread"
4
5
  }
5
6
  export declare enum ColorSchemesConfig {
6
7
  auto = "auto",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engagently/types",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "main": "./index.ts",
5
5
  "types": "dist/types/engagently.d.ts",
6
6
  "files": [