@player-ui/beacon-plugin-react 0.12.0-next.7 → 0.12.0-next.8
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.legacy-esm.js +37 -0
- package/package.json +4 -4
package/dist/index.legacy-esm.js
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/beacon/react/src/index.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BeaconPlugin as BeaconCorePlugin } from "@player-ui/beacon-plugin";
|
|
4
|
+
export * from "@player-ui/beacon-plugin";
|
|
5
|
+
var BeaconContext = React.createContext({
|
|
6
|
+
handler: () => void 0
|
|
7
|
+
});
|
|
8
|
+
function useBeacon(initialArgs) {
|
|
9
|
+
const { handler } = React.useContext(BeaconContext);
|
|
10
|
+
return (options) => {
|
|
11
|
+
handler({
|
|
12
|
+
...initialArgs,
|
|
13
|
+
...options ?? {}
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
var BeaconPlugin = class extends BeaconCorePlugin {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.name = "beacon-web-plugin";
|
|
21
|
+
}
|
|
22
|
+
applyReact(reactPlayer) {
|
|
23
|
+
const handler = this.beacon.bind(this);
|
|
24
|
+
reactPlayer.hooks.webComponent.tap(this.name, (Comp) => {
|
|
25
|
+
function BeaconContextComponent() {
|
|
26
|
+
return /* @__PURE__ */ React.createElement(BeaconContext.Provider, { value: { handler } }, /* @__PURE__ */ React.createElement(Comp, null));
|
|
27
|
+
}
|
|
28
|
+
return BeaconContextComponent;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
BeaconContext,
|
|
34
|
+
BeaconPlugin,
|
|
35
|
+
useBeacon
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
"types"
|
|
7
7
|
],
|
|
8
8
|
"name": "@player-ui/beacon-plugin-react",
|
|
9
|
-
"version": "0.12.0-next.
|
|
9
|
+
"version": "0.12.0-next.8",
|
|
10
10
|
"main": "dist/cjs/index.cjs",
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@player-ui/player": "0.12.0-next.
|
|
13
|
-
"@player-ui/react": "0.12.0-next.
|
|
12
|
+
"@player-ui/player": "0.12.0-next.8",
|
|
13
|
+
"@player-ui/react": "0.12.0-next.8",
|
|
14
14
|
"react": "^18.2.0",
|
|
15
15
|
"@types/react": "^18.2.39"
|
|
16
16
|
},
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@player-ui/make-flow": "workspace:*"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@player-ui/beacon-plugin": "0.12.0-next.
|
|
21
|
+
"@player-ui/beacon-plugin": "0.12.0-next.8",
|
|
22
22
|
"tslib": "^2.6.2"
|
|
23
23
|
},
|
|
24
24
|
"module": "dist/index.legacy-esm.js",
|