@player-ui/beacon-plugin-react 0.3.0-next.3 → 0.3.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +2 -2
- package/package.json +4 -5
- package/src/index.tsx +7 -4
package/dist/index.cjs.js
CHANGED
|
@@ -39,9 +39,9 @@ class BeaconPlugin extends beaconPlugin.BeaconPlugin {
|
|
|
39
39
|
super(...arguments);
|
|
40
40
|
this.name = "beacon-web-plugin";
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
applyReact(reactPlayer) {
|
|
43
43
|
const handler = this.beacon.bind(this);
|
|
44
|
-
|
|
44
|
+
reactPlayer.hooks.webComponent.tap(this.name, (Comp) => () => /* @__PURE__ */ React__default["default"].createElement(BeaconContext.Provider, {
|
|
45
45
|
value: { handler }
|
|
46
46
|
}, /* @__PURE__ */ React__default["default"].createElement(Comp, null)));
|
|
47
47
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactPlayerPlugin, ReactPlayer } from '@player-ui/react';
|
|
3
3
|
import { BeaconArgs, BeaconPlugin as BeaconPlugin$1 } from '@player-ui/beacon-plugin';
|
|
4
4
|
export * from '@player-ui/beacon-plugin';
|
|
5
5
|
|
|
@@ -16,9 +16,9 @@ declare function useBeacon<T extends Partial<BeaconCallbackArgs>>(initialArgs: T
|
|
|
16
16
|
/**
|
|
17
17
|
* A plugin for adding beacon support to a web-player
|
|
18
18
|
*/
|
|
19
|
-
declare class BeaconPlugin extends BeaconPlugin$1 implements
|
|
19
|
+
declare class BeaconPlugin extends BeaconPlugin$1 implements ReactPlayerPlugin {
|
|
20
20
|
name: string;
|
|
21
|
-
|
|
21
|
+
applyReact(reactPlayer: ReactPlayer): void;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export { BeaconCallbackArgs, BeaconCallbackFn, BeaconContext, BeaconContextType, BeaconHandler, BeaconPlugin, useBeacon };
|
package/dist/index.esm.js
CHANGED
|
@@ -32,9 +32,9 @@ class BeaconPlugin extends BeaconPlugin$1 {
|
|
|
32
32
|
super(...arguments);
|
|
33
33
|
this.name = "beacon-web-plugin";
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
applyReact(reactPlayer) {
|
|
36
36
|
const handler = this.beacon.bind(this);
|
|
37
|
-
|
|
37
|
+
reactPlayer.hooks.webComponent.tap(this.name, (Comp) => () => /* @__PURE__ */ React.createElement(BeaconContext.Provider, {
|
|
38
38
|
value: { handler }
|
|
39
39
|
}, /* @__PURE__ */ React.createElement(Comp, null)));
|
|
40
40
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@player-ui/beacon-plugin-react",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@player-ui/player": "0.3.0-next.
|
|
10
|
-
"@player-ui/react": "0.3.0-next.
|
|
9
|
+
"@player-ui/player": "0.3.0-next.4",
|
|
10
|
+
"@player-ui/react": "0.3.0-next.4"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@player-ui/beacon-plugin": "0.3.0-next.
|
|
14
|
-
"@player-ui/react-utils": "0.3.0-next.3",
|
|
13
|
+
"@player-ui/beacon-plugin": "0.3.0-next.4",
|
|
15
14
|
"@babel/runtime": "7.15.4"
|
|
16
15
|
},
|
|
17
16
|
"main": "dist/index.cjs.js",
|
package/src/index.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ReactPlayer, ReactPlayerPlugin } from '@player-ui/react';
|
|
3
3
|
import type { BeaconArgs } from '@player-ui/beacon-plugin';
|
|
4
4
|
import { BeaconPlugin as BeaconCorePlugin } from '@player-ui/beacon-plugin';
|
|
5
5
|
|
|
@@ -39,13 +39,16 @@ export function useBeacon<T extends Partial<BeaconCallbackArgs>>(
|
|
|
39
39
|
/**
|
|
40
40
|
* A plugin for adding beacon support to a web-player
|
|
41
41
|
*/
|
|
42
|
-
export class BeaconPlugin
|
|
42
|
+
export class BeaconPlugin
|
|
43
|
+
extends BeaconCorePlugin
|
|
44
|
+
implements ReactPlayerPlugin
|
|
45
|
+
{
|
|
43
46
|
name = 'beacon-web-plugin';
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
applyReact(reactPlayer: ReactPlayer) {
|
|
46
49
|
const handler = this.beacon.bind(this);
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
reactPlayer.hooks.webComponent.tap(this.name, (Comp) => () => (
|
|
49
52
|
<BeaconContext.Provider value={{ handler }}>
|
|
50
53
|
<Comp />
|
|
51
54
|
</BeaconContext.Provider>
|