@vouchfor/embeds 0.0.0-experiment.dcc3e68 → 0.0.0-experiment.dd49cfd

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/dist/es/embeds.js +1009 -1099
  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/{components/Embed → src/components/PlayerEmbed}/controllers/event-forwarder.d.ts +6 -5
  7. package/dist/es/src/components/PlayerEmbed/controllers/fetcher.d.ts +14 -0
  8. package/dist/es/src/components/PlayerEmbed/controllers/tracking/index.d.ts +36 -0
  9. package/dist/es/src/components/PlayerEmbed/controllers/tracking/utils.d.ts +17 -0
  10. package/dist/es/src/components/PlayerEmbed/index.d.ts +75 -0
  11. package/dist/es/src/components/PlayerEmbed/tests/data.d.ts +3 -0
  12. package/dist/es/src/index.d.ts +2 -0
  13. package/dist/es/src/utils/env.d.ts +12 -0
  14. package/dist/iife/dialog-embed/embed.iife.js +1755 -0
  15. package/dist/iife/dialog-embed/embed.iife.js.map +1 -0
  16. package/dist/iife/embeds.iife.js +705 -440
  17. package/dist/iife/embeds.iife.js.map +1 -1
  18. package/dist/iife/player-embed/embed.iife.js +1617 -0
  19. package/dist/iife/player-embed/embed.iife.js.map +1 -0
  20. package/package.json +45 -33
  21. package/src/components/DialogEmbed/Dialog.stories.ts +91 -0
  22. package/src/components/DialogEmbed/DialogOverlay.ts +131 -0
  23. package/src/components/DialogEmbed/DialogPortal.ts +126 -0
  24. package/src/components/DialogEmbed/index.ts +97 -0
  25. package/src/components/{Embed/Embed.stories.ts → PlayerEmbed/PlayerEmbed.stories.ts} +38 -24
  26. package/src/components/{Embed → PlayerEmbed}/controllers/event-forwarder.ts +6 -5
  27. package/src/components/PlayerEmbed/controllers/fetcher.ts +152 -0
  28. package/src/components/PlayerEmbed/controllers/tracking/index.ts +224 -0
  29. package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
  30. package/src/components/{Embed → PlayerEmbed}/index.ts +82 -35
  31. package/src/components/PlayerEmbed/tests/PlayerEmbed.spec.ts +80 -0
  32. package/src/components/PlayerEmbed/tests/data.ts +183 -0
  33. package/src/index.ts +2 -1
  34. package/src/utils/env.ts +18 -32
  35. package/dist/es/components/Embed/controllers/fetcher.d.ts +0 -20
  36. package/dist/es/components/Embed/controllers/tracking.d.ts +0 -28
  37. package/dist/es/components/Embed/index.d.ts +0 -63
  38. package/dist/es/index.d.ts +0 -1
  39. package/dist/es/utils/env.d.ts +0 -18
  40. package/src/components/Embed/controllers/fetcher.ts +0 -115
  41. package/src/components/Embed/controllers/tracking.ts +0 -261
  42. /package/dist/es/{utils → src/utils}/events.d.ts +0 -0
@@ -0,0 +1,75 @@
1
+ import { LitElement } from 'lit';
2
+ import type { Scene, Scenes, TemplateInstance } from '@vouchfor/canvas-video';
3
+ import type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';
4
+ import type { Environment } from '../../utils/env';
5
+ import '@vouchfor/media-player';
6
+ type PlayerEmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'language' | 'preload' | 'autoplay' | 'controls'> & {
7
+ env: Environment;
8
+ apiKey: string;
9
+ disableTracking?: boolean;
10
+ trackingSource?: string;
11
+ vouchId?: string;
12
+ templateId?: string;
13
+ questions?: number[];
14
+ };
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'];
29
+ language?: MediaPlayerProps['language'];
30
+ private eventController;
31
+ private _fetcherController;
32
+ private _trackingController;
33
+ vouch: PlayerEmbedProps['data'];
34
+ template: TemplateInstance | undefined;
35
+ get fetching(): boolean;
36
+ private _mediaPlayerRef;
37
+ get waiting(): boolean | undefined;
38
+ get initialised(): Promise<boolean> | undefined;
39
+ get seeking(): boolean | undefined;
40
+ get paused(): boolean | undefined;
41
+ get captions(): boolean | undefined;
42
+ get fullscreen(): boolean | undefined;
43
+ get duration(): number | undefined;
44
+ set currentTime(value: number);
45
+ get currentTime(): number;
46
+ set playbackRate(value: number);
47
+ get playbackRate(): number;
48
+ set volume(value: number);
49
+ get volume(): number;
50
+ set muted(value: boolean);
51
+ get muted(): boolean;
52
+ get scene(): Scene | null;
53
+ get scenes(): Scene[];
54
+ get sceneConfig(): Scenes | null;
55
+ get videoState(): import("@vouchfor/media-player").VideoStateMap | undefined;
56
+ get mediaPlayer(): MediaPlayer | undefined;
57
+ play(): void;
58
+ pause(): void;
59
+ reset(time?: number, play?: boolean): void;
60
+ setScene(index: number): void;
61
+ private _renderStyles;
62
+ render(): import("lit-html").TemplateResult<1>;
63
+ }
64
+ declare global {
65
+ interface HTMLElementTagNameMap {
66
+ 'vouch-embed-player': PlayerEmbed;
67
+ }
68
+ namespace JSX {
69
+ interface IntrinsicElements {
70
+ 'vouch-embed-player': PlayerEmbed;
71
+ }
72
+ }
73
+ }
74
+ export { PlayerEmbed };
75
+ export type { PlayerEmbedProps };
@@ -0,0 +1,3 @@
1
+ import type { Vouch } from '@vouchfor/video-utils';
2
+ declare const data: Vouch;
3
+ export { data };
@@ -0,0 +1,2 @@
1
+ export { PlayerEmbed } from './components/PlayerEmbed';
2
+ export { DialogEmbed } from './components/DialogEmbed';
@@ -0,0 +1,12 @@
1
+ type Environment = 'local' | 'dev' | 'staging' | 'prod';
2
+ type GetEnvUrlsReturn = {
3
+ videoUrl: string;
4
+ publicApiUrl: string;
5
+ embedApiUrl: string;
6
+ };
7
+ declare const devEmbedApiUrl = "https://embed-dev.vouchfor.com/v2";
8
+ declare const stagingEmbedApiUrl = "https://embed-staging.vouchfor.com/v2";
9
+ declare const prodEmbedApiUrl = "https://embed.vouchfor.com/v2";
10
+ declare function getEnvUrls(env: Environment): GetEnvUrlsReturn;
11
+ export { devEmbedApiUrl, stagingEmbedApiUrl, prodEmbedApiUrl, getEnvUrls };
12
+ export type { Environment };