@engagently/types 4.7.1 → 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;
@@ -249,6 +249,11 @@ export declare const defaultResources: {
249
249
  EGY_USERNAME_LOCKED: string;
250
250
  EGY_USERNAME_INVALID: string;
251
251
  };
252
+ login: {
253
+ assertion_failed: {
254
+ NEEDS_VERIFIED_EMAIL: string;
255
+ };
256
+ };
252
257
  };
253
258
  readonly features: {
254
259
  COMMENT: {
@@ -321,6 +326,10 @@ export declare const defaultResources: {
321
326
  readonly poll: {
322
327
  "thank-you-for-vote": string;
323
328
  "call-to-action": string;
329
+ "live-poll": string;
330
+ viewed: string;
331
+ vote_one: string;
332
+ vote_other: string;
324
333
  };
325
334
  };
326
335
  en: {
@@ -568,6 +577,11 @@ export declare const defaultResources: {
568
577
  EGY_USERNAME_LOCKED: string;
569
578
  EGY_USERNAME_INVALID: string;
570
579
  };
580
+ login: {
581
+ assertion_failed: {
582
+ NEEDS_VERIFIED_EMAIL: string;
583
+ };
584
+ };
571
585
  };
572
586
  readonly features: {
573
587
  COMMENT: {
@@ -640,6 +654,10 @@ export declare const defaultResources: {
640
654
  readonly poll: {
641
655
  "thank-you-for-vote": string;
642
656
  "call-to-action": string;
657
+ "live-poll": string;
658
+ viewed: string;
659
+ vote_one: string;
660
+ vote_other: string;
643
661
  };
644
662
  };
645
663
  };
@@ -890,6 +908,11 @@ declare const resources: {
890
908
  EGY_USERNAME_LOCKED: string;
891
909
  EGY_USERNAME_INVALID: string;
892
910
  };
911
+ login: {
912
+ assertion_failed: {
913
+ NEEDS_VERIFIED_EMAIL: string;
914
+ };
915
+ };
893
916
  };
894
917
  readonly features: {
895
918
  COMMENT: {
@@ -962,6 +985,10 @@ declare const resources: {
962
985
  readonly poll: {
963
986
  "thank-you-for-vote": string;
964
987
  "call-to-action": string;
988
+ "live-poll": string;
989
+ viewed: string;
990
+ vote_one: string;
991
+ vote_other: string;
965
992
  };
966
993
  };
967
994
  en: {
@@ -1209,6 +1236,11 @@ declare const resources: {
1209
1236
  EGY_USERNAME_LOCKED: string;
1210
1237
  EGY_USERNAME_INVALID: string;
1211
1238
  };
1239
+ login: {
1240
+ assertion_failed: {
1241
+ NEEDS_VERIFIED_EMAIL: string;
1242
+ };
1243
+ };
1212
1244
  };
1213
1245
  readonly features: {
1214
1246
  COMMENT: {
@@ -1281,6 +1313,10 @@ declare const resources: {
1281
1313
  readonly poll: {
1282
1314
  "thank-you-for-vote": string;
1283
1315
  "call-to-action": string;
1316
+ "live-poll": string;
1317
+ viewed: string;
1318
+ vote_one: string;
1319
+ vote_other: string;
1284
1320
  };
1285
1321
  };
1286
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.1",
3
+ "version": "4.8.0",
4
4
  "main": "./index.ts",
5
5
  "types": "dist/types/engagently.d.ts",
6
6
  "files": [