@vouchfor/embeds 0.0.0-experiment.df12bef → 0.0.0-experiment.e075b1c

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/es/embeds.js +981 -1426
  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/PlayerEmbed/index.d.ts +77 -0
  11. package/dist/es/src/components/PlayerEmbed/tests/data.d.ts +4 -0
  12. package/dist/es/src/components/PlayerEmbed/tests/media-data.d.ts +19 -0
  13. package/dist/es/src/index.d.ts +2 -1
  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 +671 -457
  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} +41 -15
  27. package/src/components/{Embed → PlayerEmbed}/controllers/event-forwarder.ts +6 -5
  28. package/src/components/{Embed → PlayerEmbed}/controllers/fetcher.ts +33 -14
  29. package/src/components/{Embed/controllers/tracking.ts → PlayerEmbed/controllers/tracking/index.ts} +47 -115
  30. package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
  31. package/src/components/{Embed → PlayerEmbed}/index.ts +86 -27
  32. package/src/components/PlayerEmbed/tests/PlayerEmbed.spec.ts +87 -0
  33. package/src/components/PlayerEmbed/tests/data.ts +224 -0
  34. package/src/components/PlayerEmbed/tests/media-data.ts +22 -0
  35. package/src/index.ts +2 -1
  36. package/dist/es/src/components/Embed/index.d.ts +0 -67
@@ -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,4 @@
1
+ import type { Vouch } from '@vouchfor/video-utils';
2
+ declare const data: Vouch;
3
+ declare const withNullAnswer: Vouch;
4
+ export { data, withNullAnswer };
@@ -0,0 +1,19 @@
1
+ declare const VIDEOA: {
2
+ mp4: string;
3
+ m3u8: string;
4
+ jpg: string;
5
+ duration: number;
6
+ };
7
+ declare const VIDEOB: {
8
+ mp4: string;
9
+ m3u8: string;
10
+ jpg: string;
11
+ duration: number;
12
+ };
13
+ declare const VIDEOC: {
14
+ mp4: string;
15
+ m3u8: string;
16
+ jpg: string;
17
+ duration: number;
18
+ };
19
+ export { VIDEOA, VIDEOB, VIDEOC };
@@ -1 +1,2 @@
1
- export { Embed } from './components/Embed';
1
+ export { PlayerEmbed } from './components/PlayerEmbed';
2
+ export { DialogEmbed } from './components/DialogEmbed';