@vouchfor/embeds 0.0.0-experiment.e14607a → 0.0.0-experiment.e2a213c
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/embeds.js +975 -1427
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/src/components/DialogEmbed/DialogOverlay.d.ts +20 -0
- package/dist/es/src/components/DialogEmbed/DialogPortal.d.ts +36 -0
- package/dist/es/src/components/DialogEmbed/index.d.ts +38 -0
- package/dist/es/src/components/PlayerEmbed/controllers/event-forwarder.d.ts +15 -0
- package/dist/es/src/components/{Embed → PlayerEmbed}/controllers/fetcher.d.ts +5 -4
- package/dist/es/src/components/{Embed/controllers/tracking.d.ts → PlayerEmbed/controllers/tracking/index.d.ts} +14 -11
- package/dist/es/src/components/PlayerEmbed/controllers/tracking/utils.d.ts +17 -0
- package/dist/es/src/components/{Embed → PlayerEmbed}/index.d.ts +29 -21
- package/dist/es/src/components/PlayerEmbed/tests/data.d.ts +3 -0
- package/dist/es/src/index.d.ts +2 -1
- package/dist/iife/dialog-embed/embed.iife.js +1755 -0
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -0
- package/dist/iife/embeds.iife.js +726 -470
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.iife.js +1617 -0
- package/dist/iife/player-embed/embed.iife.js.map +1 -0
- package/package.json +44 -31
- package/src/components/DialogEmbed/Dialog.stories.ts +91 -0
- package/src/components/DialogEmbed/DialogOverlay.ts +131 -0
- package/src/components/DialogEmbed/DialogPortal.ts +126 -0
- package/src/components/DialogEmbed/index.ts +97 -0
- package/src/components/PlayerEmbed/MultiEmbed.stories.ts +135 -0
- package/src/components/{Embed/Embed.stories.ts → PlayerEmbed/PlayerEmbed.stories.ts} +42 -15
- package/src/components/{Embed → PlayerEmbed}/controllers/event-forwarder.ts +6 -5
- package/src/components/{Embed → PlayerEmbed}/controllers/fetcher.ts +33 -14
- package/src/components/{Embed/controllers/tracking.ts → PlayerEmbed/controllers/tracking/index.ts} +47 -115
- package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
- package/src/components/{Embed → PlayerEmbed}/index.ts +76 -27
- package/src/components/PlayerEmbed/tests/PlayerEmbed.spec.ts +80 -0
- package/src/components/PlayerEmbed/tests/data.ts +183 -0
- package/src/index.ts +2 -1
@@ -2,34 +2,40 @@ 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
|
-
|
5
|
+
import '@vouchfor/media-player';
|
6
|
+
type PlayerEmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'language' | '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
|
14
|
-
|
15
|
-
data:
|
16
|
-
vouchId:
|
17
|
-
templateId:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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'];
|
26
30
|
private eventController;
|
27
31
|
private _fetcherController;
|
28
32
|
private _trackingController;
|
29
|
-
vouch:
|
33
|
+
vouch: PlayerEmbedProps['data'];
|
30
34
|
template: TemplateInstance | undefined;
|
31
35
|
get fetching(): boolean;
|
36
|
+
private _mediaPlayerRef;
|
32
37
|
get waiting(): boolean | undefined;
|
38
|
+
get initialised(): Promise<boolean> | undefined;
|
33
39
|
get seeking(): boolean | undefined;
|
34
40
|
get paused(): boolean | undefined;
|
35
41
|
get captions(): boolean | undefined;
|
@@ -46,22 +52,24 @@ declare class Embed extends LitElement {
|
|
46
52
|
get scene(): Scene | null;
|
47
53
|
get scenes(): Scene[];
|
48
54
|
get sceneConfig(): Scenes | null;
|
49
|
-
get videoState(): import("@vouchfor/media-player
|
55
|
+
get videoState(): import("@vouchfor/media-player").VideoStateMap | undefined;
|
50
56
|
get mediaPlayer(): MediaPlayer | undefined;
|
51
57
|
play(): void;
|
52
58
|
pause(): void;
|
59
|
+
reset(time?: number, play?: boolean): void;
|
53
60
|
setScene(index: number): void;
|
54
|
-
|
61
|
+
private _renderStyles;
|
62
|
+
render(): import("lit-html").TemplateResult<1>;
|
55
63
|
}
|
56
64
|
declare global {
|
57
65
|
interface HTMLElementTagNameMap {
|
58
|
-
'vouch-embed':
|
66
|
+
'vouch-embed-player': PlayerEmbed;
|
59
67
|
}
|
60
68
|
namespace JSX {
|
61
69
|
interface IntrinsicElements {
|
62
|
-
'vouch-embed':
|
70
|
+
'vouch-embed-player': PlayerEmbed;
|
63
71
|
}
|
64
72
|
}
|
65
73
|
}
|
66
|
-
export {
|
67
|
-
export type {
|
74
|
+
export { PlayerEmbed };
|
75
|
+
export type { PlayerEmbedProps };
|
package/dist/es/src/index.d.ts
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
export {
|
1
|
+
export { PlayerEmbed } from './components/PlayerEmbed';
|
2
|
+
export { DialogEmbed } from './components/DialogEmbed';
|