@vouchfor/embeds 0.0.0-experiment.039a74b → 0.0.0-experiment.254513d
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/components/Embed/controllers/event-forwarder.d.ts +14 -0
- package/dist/es/components/Embed/controllers/fetcher.d.ts +20 -0
- package/dist/es/components/Embed/controllers/tracking.d.ts +28 -0
- package/dist/es/components/Embed/index.d.ts +62 -0
- package/dist/es/embeds.js +1230 -13
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/utils/env.d.ts +18 -0
- package/dist/es/utils/events.d.ts +2 -0
- package/dist/iife/embeds.iife.js +332 -196
- package/dist/iife/embeds.iife.js.map +1 -1
- package/package.json +6 -5
- package/src/components/Embed/Embed.stories.ts +66 -0
- package/src/components/Embed/controllers/event-forwarder.ts +47 -0
- package/src/components/Embed/controllers/fetcher.ts +115 -0
- package/src/components/Embed/controllers/tracking.ts +261 -0
- package/src/components/Embed/index.ts +202 -0
- package/src/index.ts +1 -1
- package/src/utils/env.ts +78 -0
- package/src/utils/events.ts +13 -0
- package/dist/es/components/InlineEmbed.d.ts +0 -17
- package/dist/es/components/index.d.ts +0 -2
- package/src/components/InlineEmbed.stories.ts +0 -119
- package/src/components/InlineEmbed.ts +0 -24
- package/src/components/index.ts +0 -2
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { Embed } from '..';
|
2
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
|
+
type EmbedHost = ReactiveControllerHost & Embed;
|
4
|
+
declare class EventForwardController implements ReactiveController {
|
5
|
+
host: EmbedHost;
|
6
|
+
private _events;
|
7
|
+
private _cleanup;
|
8
|
+
private _forwardElementRef;
|
9
|
+
constructor(host: EmbedHost, events: string[]);
|
10
|
+
register(): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/ref.js").RefDirective>;
|
11
|
+
hostConnected(): void;
|
12
|
+
hostDisconnected(): void;
|
13
|
+
}
|
14
|
+
export { EventForwardController };
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import type { Embed } from '..';
|
2
|
+
import type { TemplateInstance } from '@vouchfor/canvas-video';
|
3
|
+
import type { ReactiveControllerHost } from 'lit';
|
4
|
+
type EmbedHost = ReactiveControllerHost & Embed;
|
5
|
+
declare class FetcherController {
|
6
|
+
host: EmbedHost;
|
7
|
+
private _fetching;
|
8
|
+
private _vouch?;
|
9
|
+
private _template?;
|
10
|
+
set fetching(value: boolean);
|
11
|
+
get fetching(): boolean;
|
12
|
+
set vouch(value: import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch | undefined);
|
13
|
+
get vouch(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch | undefined;
|
14
|
+
set template(value: TemplateInstance | undefined);
|
15
|
+
get template(): TemplateInstance | undefined;
|
16
|
+
private getVouch;
|
17
|
+
private getTemplate;
|
18
|
+
constructor(host: EmbedHost);
|
19
|
+
}
|
20
|
+
export { FetcherController };
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type { Embed } from '..';
|
2
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
|
+
type EmbedHost = ReactiveControllerHost & Embed;
|
4
|
+
declare class TrackingController implements ReactiveController {
|
5
|
+
host: EmbedHost;
|
6
|
+
private _tabId;
|
7
|
+
private _clientId;
|
8
|
+
private _visitorId;
|
9
|
+
private _hasPlayed;
|
10
|
+
private _hasLoaded;
|
11
|
+
private _answersViewed;
|
12
|
+
private _streamedTime;
|
13
|
+
private _streamedPrevTimestamp;
|
14
|
+
constructor(host: EmbedHost);
|
15
|
+
private _findVouchId;
|
16
|
+
private _createVisitor;
|
17
|
+
private _getUids;
|
18
|
+
private _getReportingMetadata;
|
19
|
+
private _sendTrackingEvent;
|
20
|
+
private _handleVouchLoaded;
|
21
|
+
private _handlePlay;
|
22
|
+
private _handleVideoPlay;
|
23
|
+
private _handleVideoTimeUpdate;
|
24
|
+
private _handleVideoPause;
|
25
|
+
hostConnected(): void;
|
26
|
+
hostDisconnected(): void;
|
27
|
+
}
|
28
|
+
export { TrackingController };
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import type { Scene, TemplateInstance } from '@vouchfor/canvas-video';
|
3
|
+
import type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';
|
4
|
+
import type { Environment } from '../../utils/env';
|
5
|
+
type EmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'> & {
|
6
|
+
env: Environment;
|
7
|
+
apiKey: string;
|
8
|
+
vouchId?: string;
|
9
|
+
templateId?: string;
|
10
|
+
};
|
11
|
+
declare class Embed extends LitElement {
|
12
|
+
private _mediaPlayerRef;
|
13
|
+
data: EmbedProps['data'];
|
14
|
+
vouchId: EmbedProps['vouchId'];
|
15
|
+
templateId: EmbedProps['templateId'];
|
16
|
+
env: EmbedProps['env'];
|
17
|
+
apiKey: EmbedProps['apiKey'];
|
18
|
+
controls: EmbedProps['controls'];
|
19
|
+
preload: EmbedProps['preload'];
|
20
|
+
autoplay: EmbedProps['autoplay'];
|
21
|
+
aspectRatio: EmbedProps['aspectRatio'];
|
22
|
+
private eventController;
|
23
|
+
private _fetcherController;
|
24
|
+
private _trackingController;
|
25
|
+
get vouch(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch | undefined;
|
26
|
+
get template(): TemplateInstance | undefined;
|
27
|
+
get fetching(): boolean;
|
28
|
+
get waiting(): boolean | undefined;
|
29
|
+
get seeking(): boolean | undefined;
|
30
|
+
get paused(): boolean | undefined;
|
31
|
+
get captions(): boolean | undefined;
|
32
|
+
get fullscreen(): boolean | undefined;
|
33
|
+
get duration(): number | undefined;
|
34
|
+
set currentTime(value: number);
|
35
|
+
get currentTime(): number;
|
36
|
+
set playbackRate(value: number);
|
37
|
+
get playbackRate(): number;
|
38
|
+
set volume(value: number);
|
39
|
+
get volume(): number;
|
40
|
+
set muted(value: boolean);
|
41
|
+
get muted(): boolean;
|
42
|
+
get scene(): Scene | null;
|
43
|
+
get scenes(): Scene[];
|
44
|
+
get videoState(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/controllers/scenes").VideoStateMap | undefined;
|
45
|
+
get mediaPlayer(): MediaPlayer | undefined;
|
46
|
+
play(): void;
|
47
|
+
pause(): void;
|
48
|
+
setScene(index: number): void;
|
49
|
+
render(): import("lit-html").TemplateResult<1>;
|
50
|
+
}
|
51
|
+
declare global {
|
52
|
+
interface HTMLElementTagNameMap {
|
53
|
+
'vouch-embed': Embed;
|
54
|
+
}
|
55
|
+
namespace JSX {
|
56
|
+
interface IntrinsicElements {
|
57
|
+
'vouch-embed': Embed;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
export { Embed };
|
62
|
+
export type { EmbedProps };
|