@vouchfor/embeds 0.0.0-experiment.f112aaa → 0.0.0-experiment.f6e3687
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/{browser-f5bec026.js → browser-0cb0f446.js} +2 -2
- package/dist/es/{browser-f5bec026.js.map → browser-0cb0f446.js.map} +1 -1
- package/dist/es/embeds.js +7 -2
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/index-326f29ee.js +9536 -0
- package/dist/es/index-326f29ee.js.map +1 -0
- package/dist/es/src/components/DialogEmbed/DialogOverlay.d.ts +19 -0
- package/dist/es/src/components/DialogEmbed/DialogPortal.d.ts +35 -0
- package/dist/es/src/components/DialogEmbed/index.d.ts +36 -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 +4 -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 +23 -20
- 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/browser-fcb64823.js +433 -0
- package/dist/iife/dialog-embed/browser-fcb64823.js.map +1 -0
- package/dist/iife/dialog-embed/embed.iife.js +1723 -0
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -0
- package/dist/iife/dialog-embed/embed.js +5 -0
- package/dist/iife/dialog-embed/embed.js.map +1 -0
- package/dist/iife/dialog-embed/index-804846ae.js +33256 -0
- package/dist/iife/dialog-embed/index-804846ae.js.map +1 -0
- package/dist/iife/dialog-embed/src/components/DialogEmbed/DialogOverlay.d.ts +19 -0
- package/dist/iife/dialog-embed/src/components/DialogEmbed/DialogPortal.d.ts +35 -0
- package/dist/iife/dialog-embed/src/components/DialogEmbed/index.d.ts +36 -0
- package/dist/iife/dialog-embed/src/components/PlayerEmbed/controllers/event-forwarder.d.ts +15 -0
- package/dist/iife/dialog-embed/src/components/PlayerEmbed/controllers/fetcher.d.ts +14 -0
- package/dist/iife/dialog-embed/src/components/PlayerEmbed/controllers/tracking/index.d.ts +36 -0
- package/dist/iife/dialog-embed/src/components/PlayerEmbed/controllers/tracking/utils.d.ts +17 -0
- package/dist/iife/dialog-embed/src/components/PlayerEmbed/index.d.ts +73 -0
- package/dist/iife/dialog-embed/src/components/PlayerEmbed/tests/data.d.ts +3 -0
- package/dist/iife/dialog-embed/src/index.d.ts +2 -0
- package/dist/iife/dialog-embed/src/utils/env.d.ts +12 -0
- package/dist/iife/dialog-embed/src/utils/events.d.ts +2 -0
- package/dist/iife/embeds.iife.js +437 -272
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/browser-910b9dcb.js +433 -0
- package/dist/iife/player-embed/browser-910b9dcb.js.map +1 -0
- package/dist/iife/player-embed/embed.iife.js +1585 -0
- package/dist/iife/player-embed/embed.iife.js.map +1 -0
- package/dist/iife/player-embed/embed.js +5 -0
- package/dist/iife/player-embed/embed.js.map +1 -0
- package/dist/iife/player-embed/index-154c6a23.js +32811 -0
- package/dist/iife/player-embed/index-154c6a23.js.map +1 -0
- package/dist/iife/player-embed/src/components/DialogEmbed/DialogOverlay.d.ts +19 -0
- package/dist/iife/player-embed/src/components/DialogEmbed/DialogPortal.d.ts +35 -0
- package/dist/iife/player-embed/src/components/DialogEmbed/index.d.ts +36 -0
- package/dist/iife/player-embed/src/components/PlayerEmbed/controllers/event-forwarder.d.ts +15 -0
- package/dist/iife/player-embed/src/components/PlayerEmbed/controllers/fetcher.d.ts +14 -0
- package/dist/iife/player-embed/src/components/PlayerEmbed/controllers/tracking/index.d.ts +36 -0
- package/dist/iife/player-embed/src/components/PlayerEmbed/controllers/tracking/utils.d.ts +17 -0
- package/dist/iife/player-embed/src/components/PlayerEmbed/index.d.ts +73 -0
- package/dist/iife/player-embed/src/components/PlayerEmbed/tests/data.d.ts +3 -0
- package/dist/iife/player-embed/src/index.d.ts +2 -0
- package/dist/iife/player-embed/src/utils/env.d.ts +12 -0
- package/dist/iife/player-embed/src/utils/events.d.ts +2 -0
- package/package.json +13 -5
- 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/{Embed/Embed.stories.ts → PlayerEmbed/PlayerEmbed.stories.ts} +15 -15
- package/src/components/{Embed → PlayerEmbed}/controllers/event-forwarder.ts +6 -5
- package/src/components/{Embed → PlayerEmbed}/controllers/fetcher.ts +11 -11
- package/src/components/{Embed/controllers/tracking.ts → PlayerEmbed/controllers/tracking/index.ts} +47 -117
- package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
- package/src/components/{Embed → PlayerEmbed}/index.ts +56 -23
- 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
- package/dist/es/index-6ce8276f.js +0 -9947
- package/dist/es/index-6ce8276f.js.map +0 -1
@@ -0,0 +1,19 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import type { DialogEmbedProps } from '.';
|
3
|
+
declare class DialogOverlay extends LitElement {
|
4
|
+
static styles: import("lit").CSSResult[];
|
5
|
+
open: boolean;
|
6
|
+
aspectRatio: DialogEmbedProps['aspectRatio'];
|
7
|
+
render(): import("lit").TemplateResult<1>;
|
8
|
+
}
|
9
|
+
declare global {
|
10
|
+
interface HTMLElementTagNameMap {
|
11
|
+
'vouch-embed-dialog-overlay': DialogOverlay;
|
12
|
+
}
|
13
|
+
namespace JSX {
|
14
|
+
interface IntrinsicElements {
|
15
|
+
'vouch-embed-dialog-overlay': DialogOverlay;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
export { DialogOverlay };
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import type { DialogEmbedProps } from '.';
|
3
|
+
declare class DialogPortal extends LitElement {
|
4
|
+
vouchId: DialogEmbedProps['vouchId'];
|
5
|
+
templateId: DialogEmbedProps['templateId'];
|
6
|
+
questions: DialogEmbedProps['questions'];
|
7
|
+
env: DialogEmbedProps['env'];
|
8
|
+
apiKey: DialogEmbedProps['apiKey'];
|
9
|
+
disableTracking: DialogEmbedProps['disableTracking'];
|
10
|
+
trackingSource: DialogEmbedProps['trackingSource'];
|
11
|
+
controls: DialogEmbedProps['controls'];
|
12
|
+
preload: DialogEmbedProps['preload'];
|
13
|
+
disableAutoplay: DialogEmbedProps['disableAutoplay'];
|
14
|
+
aspectRatio: DialogEmbedProps['aspectRatio'];
|
15
|
+
private _mediaPlayerRef;
|
16
|
+
open: boolean;
|
17
|
+
private _handleToggle;
|
18
|
+
private _handleClose;
|
19
|
+
private _handleDocumentKeyUp;
|
20
|
+
connectedCallback(): void;
|
21
|
+
disconnectedCallback(): void;
|
22
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
23
|
+
render(): import("lit").TemplateResult<1>;
|
24
|
+
}
|
25
|
+
declare global {
|
26
|
+
interface HTMLElementTagNameMap {
|
27
|
+
'vouch-embed-dialog-portal': DialogPortal;
|
28
|
+
}
|
29
|
+
namespace JSX {
|
30
|
+
interface IntrinsicElements {
|
31
|
+
'vouch-embed-dialog-portal': DialogPortal;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
export { DialogPortal };
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import type { PlayerEmbedProps } from '../PlayerEmbed';
|
3
|
+
type DialogEmbedProps = Omit<PlayerEmbedProps, 'data'> & {
|
4
|
+
disableAutoplay?: boolean;
|
5
|
+
};
|
6
|
+
declare class DialogEmbed extends LitElement {
|
7
|
+
static styles: import("lit").CSSResult[];
|
8
|
+
vouchId: DialogEmbedProps['vouchId'];
|
9
|
+
templateId: DialogEmbedProps['templateId'];
|
10
|
+
questions: DialogEmbedProps['questions'];
|
11
|
+
env: DialogEmbedProps['env'];
|
12
|
+
apiKey: DialogEmbedProps['apiKey'];
|
13
|
+
disableTracking: DialogEmbedProps['disableTracking'];
|
14
|
+
trackingSource: DialogEmbedProps['trackingSource'];
|
15
|
+
controls: DialogEmbedProps['controls'];
|
16
|
+
preload: DialogEmbedProps['preload'];
|
17
|
+
disableAutoplay: DialogEmbedProps['disableAutoplay'];
|
18
|
+
aspectRatio: DialogEmbedProps['aspectRatio'];
|
19
|
+
private _id;
|
20
|
+
private _handleRootClick;
|
21
|
+
connectedCallback(): void;
|
22
|
+
disconnectedCallback(): void;
|
23
|
+
render(): import("lit").TemplateResult<1>;
|
24
|
+
}
|
25
|
+
declare global {
|
26
|
+
interface HTMLElementTagNameMap {
|
27
|
+
'vouch-embed-dialog': DialogEmbed;
|
28
|
+
}
|
29
|
+
namespace JSX {
|
30
|
+
interface IntrinsicElements {
|
31
|
+
'vouch-embed-dialog': DialogEmbed;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
export { DialogEmbed };
|
36
|
+
export type { DialogEmbedProps };
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { PlayerEmbed } from '..';
|
2
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
|
+
import type { DirectiveResult } from 'lit/directive.js';
|
4
|
+
type PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;
|
5
|
+
declare class EventForwardController implements ReactiveController {
|
6
|
+
host: PlayerEmbedHost;
|
7
|
+
private _events;
|
8
|
+
private _cleanup;
|
9
|
+
private _forwardElementRef;
|
10
|
+
constructor(host: PlayerEmbedHost, events: string[]);
|
11
|
+
register(): DirectiveResult;
|
12
|
+
hostConnected(): void;
|
13
|
+
hostDisconnected(): void;
|
14
|
+
}
|
15
|
+
export { EventForwardController };
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import type {
|
1
|
+
import type { PlayerEmbed } from '..';
|
2
2
|
import type { ReactiveControllerHost } from 'lit';
|
3
|
-
type
|
3
|
+
type PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;
|
4
4
|
declare class FetcherController {
|
5
|
-
host:
|
5
|
+
host: PlayerEmbedHost;
|
6
6
|
private _fetching;
|
7
7
|
private _vouch;
|
8
8
|
set fetching(value: boolean);
|
9
9
|
get fetching(): boolean;
|
10
10
|
private getVouch;
|
11
11
|
private getTemplate;
|
12
|
-
constructor(host:
|
12
|
+
constructor(host: PlayerEmbedHost);
|
13
13
|
}
|
14
14
|
export { FetcherController };
|
@@ -1,22 +1,24 @@
|
|
1
|
-
import type {
|
1
|
+
import type { PlayerEmbed } from '../..';
|
2
2
|
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
|
-
type
|
3
|
+
type PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;
|
4
|
+
type TrackingEvent = 'VOUCH_LOADED' | 'VOUCH_RESPONSE_VIEWED' | 'VIDEO_PLAYED' | 'VIDEO_STREAMED';
|
5
|
+
type TrackingPayload = {
|
6
|
+
vouchId?: string;
|
7
|
+
answerId?: string;
|
8
|
+
streamStart?: number;
|
9
|
+
streamEnd?: number;
|
10
|
+
};
|
4
11
|
declare class TrackingController implements ReactiveController {
|
5
|
-
host:
|
6
|
-
private
|
7
|
-
private _clientId;
|
8
|
-
private _visitorId;
|
12
|
+
host: PlayerEmbedHost;
|
13
|
+
private _batchedEvents;
|
9
14
|
private _hasPlayed;
|
10
15
|
private _hasLoaded;
|
11
16
|
private _answersViewed;
|
12
17
|
private _streamStartTime;
|
13
18
|
private _streamLatestTime;
|
14
19
|
private _currentlyPlayingVideo;
|
15
|
-
constructor(host:
|
16
|
-
private
|
17
|
-
private _createVisitor;
|
18
|
-
private _getUids;
|
19
|
-
private _getReportingMetadata;
|
20
|
+
constructor(host: PlayerEmbedHost);
|
21
|
+
private _createTrackingEvent;
|
20
22
|
private _sendTrackingEvent;
|
21
23
|
private _streamEnded;
|
22
24
|
private _handleVouchLoaded;
|
@@ -31,3 +33,4 @@ declare class TrackingController implements ReactiveController {
|
|
31
33
|
hostDisconnected(): void;
|
32
34
|
}
|
33
35
|
export { TrackingController };
|
36
|
+
export type { TrackingEvent, TrackingPayload };
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { TrackingPayload } from '.';
|
2
|
+
import type { Vouch } from '@vouchfor/media-player';
|
3
|
+
import type { Environment } from '../../../../utils/env';
|
4
|
+
declare function getUids(env: Environment): {
|
5
|
+
client: null;
|
6
|
+
tab: null;
|
7
|
+
request: string;
|
8
|
+
visitor?: undefined;
|
9
|
+
} | {
|
10
|
+
client: string;
|
11
|
+
tab: string;
|
12
|
+
request: string;
|
13
|
+
visitor: string;
|
14
|
+
};
|
15
|
+
declare function findVouchId(payload?: TrackingPayload, vouch?: Vouch): string | null | undefined;
|
16
|
+
declare function getReportingMetadata(source?: string): any;
|
17
|
+
export { getUids, findVouchId, getReportingMetadata };
|
@@ -2,7 +2,7 @@ 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
|
-
type
|
5
|
+
type PlayerEmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'> & {
|
6
6
|
env: Environment;
|
7
7
|
apiKey: string;
|
8
8
|
disableTracking?: boolean;
|
@@ -11,28 +11,29 @@ type EmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'preload' | 'a
|
|
11
11
|
templateId?: string;
|
12
12
|
questions?: number[];
|
13
13
|
};
|
14
|
-
declare class
|
14
|
+
declare class PlayerEmbed extends LitElement {
|
15
15
|
static styles: import("lit").CSSResult[];
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
aspectRatio: EmbedProps['aspectRatio'];
|
16
|
+
data: PlayerEmbedProps['data'];
|
17
|
+
vouchId: PlayerEmbedProps['vouchId'];
|
18
|
+
templateId: PlayerEmbedProps['templateId'];
|
19
|
+
questions: PlayerEmbedProps['questions'];
|
20
|
+
env: PlayerEmbedProps['env'];
|
21
|
+
apiKey: PlayerEmbedProps['apiKey'];
|
22
|
+
disableTracking: PlayerEmbedProps['disableTracking'];
|
23
|
+
trackingSource: PlayerEmbedProps['trackingSource'];
|
24
|
+
controls: PlayerEmbedProps['controls'];
|
25
|
+
preload: PlayerEmbedProps['preload'];
|
26
|
+
autoplay: PlayerEmbedProps['autoplay'];
|
27
|
+
aspectRatio: PlayerEmbedProps['aspectRatio'];
|
29
28
|
private eventController;
|
30
29
|
private _fetcherController;
|
31
30
|
private _trackingController;
|
32
|
-
vouch:
|
31
|
+
vouch: PlayerEmbedProps['data'];
|
33
32
|
template: TemplateInstance | undefined;
|
34
33
|
get fetching(): boolean;
|
34
|
+
private _mediaPlayerRef;
|
35
35
|
get waiting(): boolean | undefined;
|
36
|
+
get initialised(): Promise<boolean> | undefined;
|
36
37
|
get seeking(): boolean | undefined;
|
37
38
|
get paused(): boolean | undefined;
|
38
39
|
get captions(): boolean | undefined;
|
@@ -53,18 +54,20 @@ declare class Embed extends LitElement {
|
|
53
54
|
get mediaPlayer(): MediaPlayer | undefined;
|
54
55
|
play(): void;
|
55
56
|
pause(): void;
|
57
|
+
reset(time?: number, play?: boolean): void;
|
56
58
|
setScene(index: number): void;
|
59
|
+
private _renderStyles;
|
57
60
|
render(): import("lit").TemplateResult<1>;
|
58
61
|
}
|
59
62
|
declare global {
|
60
63
|
interface HTMLElementTagNameMap {
|
61
|
-
'vouch-embed':
|
64
|
+
'vouch-embed-player': PlayerEmbed;
|
62
65
|
}
|
63
66
|
namespace JSX {
|
64
67
|
interface IntrinsicElements {
|
65
|
-
'vouch-embed':
|
68
|
+
'vouch-embed-player': PlayerEmbed;
|
66
69
|
}
|
67
70
|
}
|
68
71
|
}
|
69
|
-
export {
|
70
|
-
export type {
|
72
|
+
export { PlayerEmbed };
|
73
|
+
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';
|