@vouchfor/embeds 0.0.0-experiment.acfa1ff → 0.0.0-experiment.ae8c0d8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/embeds.js +1036 -612
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/{components → src/components}/Embed/controllers/fetcher.d.ts +6 -0
- package/dist/es/{components → src/components}/Embed/controllers/tracking.d.ts +7 -2
- package/dist/es/{components → src/components}/Embed/index.d.ts +21 -16
- package/dist/es/src/utils/env.d.ts +12 -0
- package/dist/iife/embeds.iife.js +420 -341
- package/dist/iife/embeds.iife.js.map +1 -1
- package/package.json +6 -6
- package/src/components/Embed/Embed.stories.ts +15 -18
- package/src/components/Embed/controllers/fetcher.ts +124 -15
- package/src/components/Embed/controllers/tracking.ts +117 -93
- package/src/components/Embed/index.ts +40 -27
- package/src/utils/env.ts +18 -32
- package/dist/es/components/Embed/controllers/event-forwarder.d.ts +0 -14
- package/dist/es/utils/env.d.ts +0 -18
- /package/dist/es/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/es/{utils → src/utils}/events.d.ts +0 -0
@@ -1,33 +1,37 @@
|
|
1
1
|
import { LitElement } from 'lit';
|
2
|
-
import type { Scene } from '@vouchfor/canvas-video';
|
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' | '
|
5
|
+
type EmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'> & {
|
6
6
|
env: Environment;
|
7
7
|
apiKey: string;
|
8
|
-
|
9
|
-
enableTracking?: boolean;
|
8
|
+
disableTracking?: boolean;
|
10
9
|
trackingSource?: string;
|
10
|
+
vouchId?: string;
|
11
|
+
templateId?: string;
|
12
|
+
questions?: number[];
|
11
13
|
};
|
12
14
|
declare class Embed extends LitElement {
|
15
|
+
static styles: import("lit").CSSResult[];
|
13
16
|
private _mediaPlayerRef;
|
14
|
-
|
15
|
-
|
17
|
+
data: EmbedProps['data'];
|
18
|
+
vouchId: EmbedProps['vouchId'];
|
19
|
+
templateId: EmbedProps['templateId'];
|
20
|
+
questions: EmbedProps['questions'];
|
16
21
|
env: EmbedProps['env'];
|
17
22
|
apiKey: EmbedProps['apiKey'];
|
23
|
+
disableTracking: EmbedProps['disableTracking'];
|
24
|
+
trackingSource: EmbedProps['trackingSource'];
|
25
|
+
controls: EmbedProps['controls'];
|
18
26
|
preload: EmbedProps['preload'];
|
19
27
|
autoplay: EmbedProps['autoplay'];
|
20
|
-
enableTracking: EmbedProps['enableTracking'];
|
21
|
-
trackingSource: EmbedProps['trackingSource'];
|
22
|
-
resolution: EmbedProps['resolution'];
|
23
28
|
aspectRatio: EmbedProps['aspectRatio'];
|
24
|
-
controls: EmbedProps['controls'];
|
25
|
-
data: MediaPlayerProps['data'];
|
26
|
-
instance: MediaPlayerProps['instance'];
|
27
|
-
fetching: boolean;
|
28
29
|
private eventController;
|
29
|
-
private
|
30
|
-
private
|
30
|
+
private _fetcherController;
|
31
|
+
private _trackingController;
|
32
|
+
vouch: EmbedProps['data'];
|
33
|
+
template: TemplateInstance | undefined;
|
34
|
+
get fetching(): boolean;
|
31
35
|
get waiting(): boolean | undefined;
|
32
36
|
get seeking(): boolean | undefined;
|
33
37
|
get paused(): boolean | undefined;
|
@@ -44,12 +48,13 @@ declare class Embed extends LitElement {
|
|
44
48
|
get muted(): boolean;
|
45
49
|
get scene(): Scene | null;
|
46
50
|
get scenes(): Scene[];
|
51
|
+
get sceneConfig(): Scenes | null;
|
47
52
|
get videoState(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/controllers/scenes").VideoStateMap | undefined;
|
48
53
|
get mediaPlayer(): MediaPlayer | undefined;
|
49
54
|
play(): void;
|
50
55
|
pause(): void;
|
51
56
|
setScene(index: number): void;
|
52
|
-
render(): import("lit
|
57
|
+
render(): import("lit").TemplateResult<1>;
|
53
58
|
}
|
54
59
|
declare global {
|
55
60
|
interface HTMLElementTagNameMap {
|
@@ -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 };
|