@engagently/types 4.7.0 → 4.8.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.
@@ -1,6 +1,6 @@
1
1
  import type { VNode } from 'preact';
2
2
  import type { ExperienceParticipationFragment } from '../../widgets/src/poll/data/ExperienceFragments.generated';
3
- import type { PollBarData, PollGridData, ChartData } from '../../ui/core/_types';
3
+ import type { PollBarData, PollGridData, ChartData, PollStats } from '../../ui/core/_types';
4
4
  /**
5
5
  * Type Definitions for all available entities
6
6
  *
@@ -179,7 +179,11 @@ export declare enum PollBarAttributes {
179
179
  RESULT_DISPLAY = "result-display",
180
180
  RESULT_CTA_ENABLED = "result-cta-enabled",
181
181
  RESULT_CTA_MESSAGE = "result-cta-message",
182
- DISPLAY_STATS = "display-stats"
182
+ DISPLAY_STATS = "display-stats",
183
+ STATS = "stats",
184
+ SHOW_VIEWS = "show-views",
185
+ SHOW_CLICKS = "show-clicks",
186
+ COLOR_SCHEME = "color-scheme"
183
187
  }
184
188
  export interface PollBarAttributesHTMLElement {
185
189
  ['poll-data']?: PollBarData | null;
@@ -196,6 +200,10 @@ export interface PollBarAttributesHTMLElement {
196
200
  ['result-cta-enabled']?: boolean | string;
197
201
  ['result-cta-message']?: string | null;
198
202
  ['display-stats']?: boolean | string;
203
+ ['stats']?: PollStats | null;
204
+ ['show-views']?: boolean | string;
205
+ ['show-clicks']?: boolean | string;
206
+ ['color-scheme']?: string;
199
207
  }
200
208
  export interface PollBarAttributesComponent {
201
209
  pollData?: PollBarData | null;
@@ -212,6 +220,10 @@ export interface PollBarAttributesComponent {
212
220
  resultCtaEnabled?: boolean;
213
221
  resultCtaMessage?: string | null;
214
222
  displayStats?: boolean;
223
+ stats?: PollStats | null;
224
+ showViews?: boolean;
225
+ showClicks?: boolean;
226
+ colorScheme?: 'dark' | 'light';
215
227
  }
216
228
  export interface PollBarWidget {
217
229
  name: EgyEntities.EGY_POLL_BAR;
@@ -240,7 +252,11 @@ export declare enum PollGridAttributes {
240
252
  RESULT_DISPLAY = "result-display",
241
253
  RESULT_CTA_ENABLED = "result-cta-enabled",
242
254
  RESULT_CTA_MESSAGE = "result-cta-message",
243
- DISPLAY_STATS = "display-stats"
255
+ DISPLAY_STATS = "display-stats",
256
+ STATS = "stats",
257
+ SHOW_VIEWS = "show-views",
258
+ SHOW_CLICKS = "show-clicks",
259
+ COLOR_SCHEME = "color-scheme"
244
260
  }
245
261
  export interface PollGridAttributesHTMLElement {
246
262
  ['poll-data']?: PollGridData | null;
@@ -257,6 +273,10 @@ export interface PollGridAttributesHTMLElement {
257
273
  ['result-cta-enabled']?: boolean | string;
258
274
  ['result-cta-message']?: string | null;
259
275
  ['display-stats']?: boolean | string;
276
+ ['stats']?: PollStats | null;
277
+ ['show-views']?: boolean | string;
278
+ ['show-clicks']?: boolean | string;
279
+ ['color-scheme']?: string;
260
280
  }
261
281
  export interface PollGridAttributesComponent {
262
282
  pollData?: PollGridData | null;
@@ -273,6 +293,10 @@ export interface PollGridAttributesComponent {
273
293
  resultCtaEnabled?: boolean;
274
294
  resultCtaMessage?: string | null;
275
295
  displayStats?: boolean;
296
+ stats?: PollStats | null;
297
+ showViews?: boolean;
298
+ showClicks?: boolean;
299
+ colorScheme?: 'dark' | 'light';
276
300
  }
277
301
  export interface PollGridWidget {
278
302
  name: EgyEntities.EGY_POLL_GRID;
@@ -300,7 +324,11 @@ export declare enum PollSliderAttributes {
300
324
  USER_NAME = "user-name",
301
325
  USER_THUMBNAIL_URL = "user-thumbnail-url",
302
326
  REFRESH_KEY = "refresh-key",
303
- DISPLAY_STATS = "display-stats"
327
+ DISPLAY_STATS = "display-stats",
328
+ STATS = "stats",
329
+ SHOW_VIEWS = "show-views",
330
+ SHOW_CLICKS = "show-clicks",
331
+ COLOR_SCHEME = "color-scheme"
304
332
  }
305
333
  export interface PollSliderAttributesHTMLElement {
306
334
  ['poll-data']?: ChartData | null;
@@ -316,6 +344,10 @@ export interface PollSliderAttributesHTMLElement {
316
344
  ['user-thumbnail-url']?: string | null;
317
345
  ['refresh-key']?: string;
318
346
  ['display-stats']?: boolean | string;
347
+ ['stats']?: PollStats | null;
348
+ ['show-views']?: boolean | string;
349
+ ['show-clicks']?: boolean | string;
350
+ ['color-scheme']?: string;
319
351
  }
320
352
  export interface PollSliderAttributesComponent {
321
353
  pollData?: ChartData | null;
@@ -331,6 +363,10 @@ export interface PollSliderAttributesComponent {
331
363
  userThumbnailUrl?: string | null;
332
364
  refreshKey?: string;
333
365
  displayStats?: boolean;
366
+ stats?: PollStats | null;
367
+ showViews?: boolean;
368
+ showClicks?: boolean;
369
+ colorScheme?: 'dark' | 'light';
334
370
  }
335
371
  export interface PollSliderWidget {
336
372
  name: EgyEntities.EGY_POLL_SLIDER;
@@ -1,6 +1,7 @@
1
1
  import type { InitOptions, TFuncKey } from 'i18next';
2
2
  import i18n from 'i18next';
3
3
  export type TranslationKeys = TFuncKey<[keyof (typeof resources)['en']]>;
4
+ export type Language = 'de' | 'en';
4
5
  export declare const defaultResources: {
5
6
  de: {
6
7
  readonly common: {
@@ -248,6 +249,11 @@ export declare const defaultResources: {
248
249
  EGY_USERNAME_LOCKED: string;
249
250
  EGY_USERNAME_INVALID: string;
250
251
  };
252
+ login: {
253
+ assertion_failed: {
254
+ NEEDS_VERIFIED_EMAIL: string;
255
+ };
256
+ };
251
257
  };
252
258
  readonly features: {
253
259
  COMMENT: {
@@ -320,6 +326,10 @@ export declare const defaultResources: {
320
326
  readonly poll: {
321
327
  "thank-you-for-vote": string;
322
328
  "call-to-action": string;
329
+ "live-poll": string;
330
+ viewed: string;
331
+ vote_one: string;
332
+ vote_other: string;
323
333
  };
324
334
  };
325
335
  en: {
@@ -567,6 +577,11 @@ export declare const defaultResources: {
567
577
  EGY_USERNAME_LOCKED: string;
568
578
  EGY_USERNAME_INVALID: string;
569
579
  };
580
+ login: {
581
+ assertion_failed: {
582
+ NEEDS_VERIFIED_EMAIL: string;
583
+ };
584
+ };
570
585
  };
571
586
  readonly features: {
572
587
  COMMENT: {
@@ -639,6 +654,10 @@ export declare const defaultResources: {
639
654
  readonly poll: {
640
655
  "thank-you-for-vote": string;
641
656
  "call-to-action": string;
657
+ "live-poll": string;
658
+ viewed: string;
659
+ vote_one: string;
660
+ vote_other: string;
642
661
  };
643
662
  };
644
663
  };
@@ -889,6 +908,11 @@ declare const resources: {
889
908
  EGY_USERNAME_LOCKED: string;
890
909
  EGY_USERNAME_INVALID: string;
891
910
  };
911
+ login: {
912
+ assertion_failed: {
913
+ NEEDS_VERIFIED_EMAIL: string;
914
+ };
915
+ };
892
916
  };
893
917
  readonly features: {
894
918
  COMMENT: {
@@ -961,6 +985,10 @@ declare const resources: {
961
985
  readonly poll: {
962
986
  "thank-you-for-vote": string;
963
987
  "call-to-action": string;
988
+ "live-poll": string;
989
+ viewed: string;
990
+ vote_one: string;
991
+ vote_other: string;
964
992
  };
965
993
  };
966
994
  en: {
@@ -1208,6 +1236,11 @@ declare const resources: {
1208
1236
  EGY_USERNAME_LOCKED: string;
1209
1237
  EGY_USERNAME_INVALID: string;
1210
1238
  };
1239
+ login: {
1240
+ assertion_failed: {
1241
+ NEEDS_VERIFIED_EMAIL: string;
1242
+ };
1243
+ };
1211
1244
  };
1212
1245
  readonly features: {
1213
1246
  COMMENT: {
@@ -1280,6 +1313,10 @@ declare const resources: {
1280
1313
  readonly poll: {
1281
1314
  "thank-you-for-vote": string;
1282
1315
  "call-to-action": string;
1316
+ "live-poll": string;
1317
+ viewed: string;
1318
+ vote_one: string;
1319
+ vote_other: string;
1283
1320
  };
1284
1321
  };
1285
1322
  };
@@ -1,4 +1,5 @@
1
1
  import type { CommunityConfig, EngageConfig, Translations } from '../../common/_types/ConfigDefinition';
2
+ import type { AuthError } from '../../common/lib/api/session';
2
3
  import type { Exchange } from '@urql/preact';
3
4
  type SignInOptions = Partial<{
4
5
  token: string | null;
@@ -19,6 +20,7 @@ export type Engagently = {
19
20
  remoteTranslations?: Translations | null;
20
21
  core: {
21
22
  authExchange?: Exchange;
23
+ error?: AuthError | null;
22
24
  subscriptionExchange?: Exchange;
23
25
  canSignOut?: boolean;
24
26
  signOut?: (options?: SignOutOptions) => Promise<void>;
@@ -1,6 +1,11 @@
1
1
  /**
2
2
  * These types will be shared with the ts package
3
3
  */
4
+ /** Poll Stats for all poll widgets */
5
+ export type PollStats = {
6
+ clicks: number;
7
+ views: number;
8
+ };
4
9
  /** Poll Data for the PollBar widget */
5
10
  export type PollBarData = {
6
11
  question?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engagently/types",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "main": "./index.ts",
5
5
  "types": "dist/types/engagently.d.ts",
6
6
  "files": [