@vouchfor/embeds 0.0.0-experiment.0b5c8d1 → 0.0.0-experiment.0f953a2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. package/dist/es/embeds.js +979 -1453
  2. package/dist/es/embeds.js.map +1 -1
  3. package/dist/es/src/components/DialogEmbed/DialogOverlay.d.ts +20 -0
  4. package/dist/es/src/components/DialogEmbed/DialogPortal.d.ts +36 -0
  5. package/dist/es/src/components/DialogEmbed/index.d.ts +38 -0
  6. package/dist/es/src/components/PlayerEmbed/controllers/event-forwarder.d.ts +15 -0
  7. package/dist/es/src/components/{Embed → PlayerEmbed}/controllers/fetcher.d.ts +5 -4
  8. package/dist/es/src/components/{Embed/controllers/tracking.d.ts → PlayerEmbed/controllers/tracking/index.d.ts} +14 -11
  9. package/dist/es/src/components/PlayerEmbed/controllers/tracking/utils.d.ts +17 -0
  10. package/dist/es/src/components/{Embed → PlayerEmbed}/index.d.ts +28 -21
  11. package/dist/es/src/components/PlayerEmbed/tests/data.d.ts +3 -0
  12. package/dist/es/src/index.d.ts +2 -1
  13. package/dist/iife/dialog-embed/embed.iife.js +1750 -0
  14. package/dist/iife/dialog-embed/embed.iife.js.map +1 -0
  15. package/dist/iife/embeds.iife.js +715 -468
  16. package/dist/iife/embeds.iife.js.map +1 -1
  17. package/dist/iife/player-embed/embed.iife.js +1612 -0
  18. package/dist/iife/player-embed/embed.iife.js.map +1 -0
  19. package/package.json +43 -31
  20. package/src/components/DialogEmbed/Dialog.stories.ts +91 -0
  21. package/src/components/DialogEmbed/DialogOverlay.ts +131 -0
  22. package/src/components/DialogEmbed/DialogPortal.ts +126 -0
  23. package/src/components/DialogEmbed/index.ts +97 -0
  24. package/src/components/{Embed/Embed.stories.ts → PlayerEmbed/PlayerEmbed.stories.ts} +26 -14
  25. package/src/components/{Embed → PlayerEmbed}/controllers/event-forwarder.ts +6 -5
  26. package/src/components/{Embed → PlayerEmbed}/controllers/fetcher.ts +33 -14
  27. package/src/components/{Embed/controllers/tracking.ts → PlayerEmbed/controllers/tracking/index.ts} +47 -115
  28. package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
  29. package/src/components/{Embed → PlayerEmbed}/index.ts +71 -27
  30. package/src/components/PlayerEmbed/tests/PlayerEmbed.spec.ts +80 -0
  31. package/src/components/PlayerEmbed/tests/data.ts +183 -0
  32. package/src/index.ts +2 -1
@@ -0,0 +1,17 @@
1
+ import type { TrackingPayload } from '.';
2
+ import type { Vouch } from '@vouchfor/video-utils';
3
+ import type { Environment } from '../../../../utils/env';
4
+ declare function getUids(env: Environment): {
5
+ client: null;
6
+ tab: null;
7
+ request: string;
8
+ visitor?: undefined;
9
+ } | {
10
+ client: string;
11
+ tab: string;
12
+ request: string;
13
+ visitor: string;
14
+ };
15
+ declare function findVouchId(payload?: TrackingPayload, vouch?: Vouch): string | null | undefined;
16
+ declare function getReportingMetadata(source?: string): any;
17
+ export { getUids, findVouchId, getReportingMetadata };
@@ -2,34 +2,39 @@ import { LitElement } from 'lit';
2
2
  import type { Scene, Scenes, TemplateInstance } from '@vouchfor/canvas-video';
3
3
  import type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';
4
4
  import type { Environment } from '../../utils/env';
5
- type EmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'> & {
5
+ import '@vouchfor/media-player';
6
+ type PlayerEmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'> & {
6
7
  env: Environment;
7
8
  apiKey: string;
8
9
  disableTracking?: boolean;
9
10
  trackingSource?: string;
10
11
  vouchId?: string;
11
12
  templateId?: string;
13
+ questions?: number[];
12
14
  };
13
- declare class Embed extends LitElement {
14
- private _mediaPlayerRef;
15
- data: EmbedProps['data'];
16
- vouchId: EmbedProps['vouchId'];
17
- templateId: EmbedProps['templateId'];
18
- env: EmbedProps['env'];
19
- apiKey: EmbedProps['apiKey'];
20
- disableTracking: EmbedProps['disableTracking'];
21
- trackingSource: EmbedProps['trackingSource'];
22
- controls: EmbedProps['controls'];
23
- preload: EmbedProps['preload'];
24
- autoplay: EmbedProps['autoplay'];
25
- aspectRatio: EmbedProps['aspectRatio'];
15
+ declare class PlayerEmbed extends LitElement {
16
+ static styles: import("lit").CSSResult[];
17
+ data: PlayerEmbedProps['data'];
18
+ vouchId: PlayerEmbedProps['vouchId'];
19
+ templateId: PlayerEmbedProps['templateId'];
20
+ questions: PlayerEmbedProps['questions'];
21
+ env: PlayerEmbedProps['env'];
22
+ apiKey: PlayerEmbedProps['apiKey'];
23
+ disableTracking: PlayerEmbedProps['disableTracking'];
24
+ trackingSource: PlayerEmbedProps['trackingSource'];
25
+ controls: PlayerEmbedProps['controls'];
26
+ preload: PlayerEmbedProps['preload'];
27
+ autoplay: PlayerEmbedProps['autoplay'];
28
+ aspectRatio: PlayerEmbedProps['aspectRatio'];
26
29
  private eventController;
27
30
  private _fetcherController;
28
31
  private _trackingController;
29
- vouch: EmbedProps['data'];
32
+ vouch: PlayerEmbedProps['data'];
30
33
  template: TemplateInstance | undefined;
31
34
  get fetching(): boolean;
35
+ private _mediaPlayerRef;
32
36
  get waiting(): boolean | undefined;
37
+ get initialised(): Promise<boolean> | undefined;
33
38
  get seeking(): boolean | undefined;
34
39
  get paused(): boolean | undefined;
35
40
  get captions(): boolean | undefined;
@@ -46,22 +51,24 @@ declare class Embed extends LitElement {
46
51
  get scene(): Scene | null;
47
52
  get scenes(): Scene[];
48
53
  get sceneConfig(): Scenes | null;
49
- get videoState(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/controllers/scenes").VideoStateMap | undefined;
54
+ get videoState(): import("@vouchfor/media-player").VideoStateMap | undefined;
50
55
  get mediaPlayer(): MediaPlayer | undefined;
51
56
  play(): void;
52
57
  pause(): void;
58
+ reset(time?: number, play?: boolean): void;
53
59
  setScene(index: number): void;
54
- render(): import("lit").TemplateResult<1>;
60
+ private _renderStyles;
61
+ render(): import("lit-html").TemplateResult<1>;
55
62
  }
56
63
  declare global {
57
64
  interface HTMLElementTagNameMap {
58
- 'vouch-embed': Embed;
65
+ 'vouch-embed-player': PlayerEmbed;
59
66
  }
60
67
  namespace JSX {
61
68
  interface IntrinsicElements {
62
- 'vouch-embed': Embed;
69
+ 'vouch-embed-player': PlayerEmbed;
63
70
  }
64
71
  }
65
72
  }
66
- export { Embed };
67
- export type { EmbedProps };
73
+ export { PlayerEmbed };
74
+ export type { PlayerEmbedProps };
@@ -0,0 +1,3 @@
1
+ import type { Vouch } from '@vouchfor/video-utils';
2
+ declare const data: Vouch;
3
+ export { data };
@@ -1 +1,2 @@
1
- export { Embed } from './components/Embed';
1
+ export { PlayerEmbed } from './components/PlayerEmbed';
2
+ export { DialogEmbed } from './components/DialogEmbed';