@vouchfor/embeds 0.0.0-experiment.2ab669a → 0.0.0-experiment.2ceda41

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 +1018 -1084
  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/{components/Embed → src/components/PlayerEmbed}/controllers/fetcher.d.ts +5 -4
  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 +77 -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 +1759 -0
  15. package/dist/iife/dialog-embed/embed.iife.js.map +1 -0
  16. package/dist/iife/embeds.iife.js +763 -426
  17. package/dist/iife/embeds.iife.js.map +1 -1
  18. package/dist/iife/player-embed/embed.iife.js +1621 -0
  19. package/dist/iife/player-embed/embed.iife.js.map +1 -0
  20. package/package.json +44 -31
  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/PlayerEmbed/MultiEmbed.stories.ts +135 -0
  26. package/src/components/{Embed/Embed.stories.ts → PlayerEmbed/PlayerEmbed.stories.ts} +43 -16
  27. package/src/components/{Embed → PlayerEmbed}/controllers/event-forwarder.ts +6 -5
  28. package/src/components/PlayerEmbed/controllers/fetcher.ts +152 -0
  29. package/src/components/PlayerEmbed/controllers/tracking/index.ts +224 -0
  30. package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
  31. package/src/components/{Embed → PlayerEmbed}/index.ts +94 -26
  32. package/src/components/PlayerEmbed/tests/PlayerEmbed.spec.ts +80 -0
  33. package/src/components/PlayerEmbed/tests/data.ts +183 -0
  34. package/src/index.ts +2 -1
  35. package/src/utils/env.ts +15 -29
  36. package/dist/es/components/Embed/controllers/tracking.d.ts +0 -28
  37. package/dist/es/components/Embed/index.d.ts +0 -62
  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 -88
  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,77 @@
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 { PropertyValueMap } from 'lit';
5
+ import type { Environment } from '../../utils/env';
6
+ import '@vouchfor/media-player';
7
+ type PlayerEmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'language' | 'preload' | 'autoplay' | 'controls'> & {
8
+ env: Environment;
9
+ apiKey: string;
10
+ disableTracking?: boolean;
11
+ trackingSource?: string;
12
+ vouchId?: string;
13
+ templateId?: string;
14
+ questions?: number[];
15
+ };
16
+ declare class PlayerEmbed extends LitElement {
17
+ static styles: import("lit").CSSResult[];
18
+ data: PlayerEmbedProps['data'];
19
+ vouchId: PlayerEmbedProps['vouchId'];
20
+ templateId: PlayerEmbedProps['templateId'];
21
+ questions: PlayerEmbedProps['questions'];
22
+ env: PlayerEmbedProps['env'];
23
+ apiKey: PlayerEmbedProps['apiKey'];
24
+ disableTracking: PlayerEmbedProps['disableTracking'];
25
+ trackingSource: PlayerEmbedProps['trackingSource'];
26
+ controls: PlayerEmbedProps['controls'];
27
+ preload: PlayerEmbedProps['preload'];
28
+ autoplay: PlayerEmbedProps['autoplay'];
29
+ aspectRatio: PlayerEmbedProps['aspectRatio'];
30
+ language?: MediaPlayerProps['language'];
31
+ private eventController;
32
+ private _fetcherController;
33
+ private _trackingController;
34
+ vouch: PlayerEmbedProps['data'];
35
+ template: TemplateInstance | undefined;
36
+ get fetching(): boolean;
37
+ private _mediaPlayerRef;
38
+ get waiting(): boolean | undefined;
39
+ get initialised(): Promise<boolean> | undefined;
40
+ get seeking(): boolean | undefined;
41
+ get paused(): boolean | undefined;
42
+ get captions(): boolean | undefined;
43
+ get fullscreen(): boolean | undefined;
44
+ get duration(): number | undefined;
45
+ set currentTime(value: number);
46
+ get currentTime(): number;
47
+ set playbackRate(value: number);
48
+ get playbackRate(): number;
49
+ set volume(value: number);
50
+ get volume(): number;
51
+ set muted(value: boolean);
52
+ get muted(): boolean;
53
+ get scene(): Scene | null;
54
+ get scenes(): Scene[];
55
+ get sceneConfig(): Scenes | null;
56
+ get videoState(): import("@vouchfor/media-player").VideoStateMap | undefined;
57
+ get mediaPlayer(): MediaPlayer | undefined;
58
+ play(): void;
59
+ pause(): void;
60
+ reset(time?: number, play?: boolean): void;
61
+ setScene(index: number): void;
62
+ private _renderStyles;
63
+ protected willUpdate(changedProperties: PropertyValueMap<PlayerEmbedProps>): void;
64
+ render(): import("lit-html").TemplateResult<1>;
65
+ }
66
+ declare global {
67
+ interface HTMLElementTagNameMap {
68
+ 'vouch-embed-player': PlayerEmbed;
69
+ }
70
+ namespace JSX {
71
+ interface IntrinsicElements {
72
+ 'vouch-embed-player': PlayerEmbed;
73
+ }
74
+ }
75
+ }
76
+ export { PlayerEmbed };
77
+ 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 };