@streamlayer/react 0.39.1 → 0.40.0

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/lib/es/index2.js CHANGED
@@ -1,25 +1,28 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { createContext as S, useMemo as d } from "react";
3
- import { useStreamLayerApp as G } from "./useStreamLayerApp.js";
4
- var O = /* @__PURE__ */ ((R) => (R[R.UNSET = 0] = "UNSET", R[R.CONNECTED = 1] = "CONNECTED", R[R.READY = 2] = "READY", R))(O || {});
5
- const D = S({
1
+ import { jsx as T } from "react/jsx-runtime";
2
+ import { createContext as G, useMemo as d, useEffect as O } from "react";
3
+ import { useStreamLayerApp as c } from "./useStreamLayerApp.js";
4
+ var f = /* @__PURE__ */ ((R) => (R[R.UNSET = 0] = "UNSET", R[R.CONNECTED = 1] = "CONNECTED", R[R.READY = 2] = "READY", R))(f || {});
5
+ const B = G({
6
6
  status: 0,
7
7
  sdk: null
8
- }), I = ({
8
+ }), P = ({
9
9
  sdkKey: R,
10
10
  plugins: E,
11
- children: e,
12
- production: _ = !0,
11
+ children: A,
12
+ production: n = !0,
13
13
  autoEnable: s = !0,
14
- onDeepLinkHandled: N
14
+ onDeepLinkHandled: _,
15
+ videoPlayerController: r
15
16
  }) => {
16
- const A = G(R, E, _, s), i = d(() => A ? (N && A.onDeepLinkHandled(N), {
17
- sdk: A,
17
+ const e = c(R, E, n, s), S = d(() => e ? (r && e.addVideoPlayerController(r), _ && e.addDeepLinkHandler(_), {
18
+ sdk: e,
18
19
  status: 2
19
20
  /* READY */
20
- }) : { status: 1, sdk: null }, [A]);
21
- return /* @__PURE__ */ a(D.Provider, { value: i, children: e });
22
- }, c = {
21
+ }) : { status: 1, sdk: null }, [e]);
22
+ return O(() => () => {
23
+ _ && (e == null || e.removeDeepLinkHandler(_)), r && (e == null || e.removeVideoPlayerController(r));
24
+ }, [e]), /* @__PURE__ */ T(B.Provider, { value: S, children: A });
25
+ }, D = {
23
26
  BG_TRANSPARENT: "rgba(0,0,0, .8)",
24
27
  BG_TRANSPARENT_VOTE_CONTAINER: "rgba(10, 14, 19, 0.8)",
25
28
  BG_TRANSPARENT_ITEM: "rgba(0, 0, 0, 0.7)",
@@ -48,7 +51,7 @@ const D = S({
48
51
  GREY_PRIMARY: "#909395",
49
52
  DIVIDER_COLOR_SECONDARY: "#53565a",
50
53
  GREEN_PRIMARY_BTN: "#009B77"
51
- }, B = {
54
+ }, Y = {
52
55
  PRIMARY_GREEN1: "#107D57",
53
56
  PRIMARY_GREEN2: "#006747",
54
57
  PRIMARY_GREEN3: "#1C4932",
@@ -70,65 +73,65 @@ const D = S({
70
73
  NEUTRALS_GRAY8: "#53565A",
71
74
  NEUTRALS_GRAY9: "#25282A",
72
75
  NEUTRALS_BLACK: "#000000"
73
- }, o = Object.assign({}, c, B), t = {
76
+ }, o = Object.assign({}, D, Y), t = {
74
77
  REGULAR: "'Benton Sans', BentonSans, Arial, Helvetica, sans-serif",
75
78
  SERIF: "'Tiempos', 'Tiempos Text', Times New Roman, serif",
76
79
  COLOR: "#fff",
77
80
  WEIGHT_DEFAULT: "500"
78
- }, r = {
81
+ }, N = {
79
82
  xs: 324,
80
83
  sm: 576,
81
84
  md: 768,
82
85
  lg: 992,
83
86
  xl: 1215,
84
87
  xxl: 1440
85
- }, Y = {
88
+ }, C = {
86
89
  landscape: "landscape",
87
90
  portrait: "portrait"
88
91
  }, l = Object.keys(o).reduce((R, E) => {
89
- const e = o[E];
92
+ const A = o[E];
90
93
  return `
91
94
  ${R}
92
- --color-${E.toLowerCase().replaceAll("_", "-")}: ${e};
95
+ --color-${E.toLowerCase().replaceAll("_", "-")}: ${A};
93
96
  `;
94
- }, ""), n = (R) => (E) => `
97
+ }, ""), a = (R) => (E) => `
95
98
  @media only screen and (${R}) {
96
99
  ${E}
97
100
  }
98
- `, C = (R, E) => (e) => `
101
+ `, p = (R, E) => (A) => `
99
102
  @media only screen and (${R}) and (${E}) {
100
- ${e}
103
+ ${A}
101
104
  }
102
- `, T = {
105
+ `, i = {
103
106
  up: (R) => {
104
- const E = r[R];
105
- return n(`min-width: ${E}px`);
107
+ const E = N[R];
108
+ return a(`min-width: ${E}px`);
106
109
  },
107
110
  down: (R) => {
108
- const E = r[R] - 1;
109
- return n(`max-width: ${E}px`);
111
+ const E = N[R] - 1;
112
+ return a(`max-width: ${E}px`);
110
113
  },
111
114
  intermediate: (R, E) => {
112
- const e = r[R] - 1, _ = r[E];
113
- return C(`max-width: ${e}px`, `min-width: ${_}px`);
115
+ const A = N[R] - 1, n = N[E];
116
+ return p(`max-width: ${A}px`, `min-width: ${n}px`);
114
117
  },
115
118
  orientation: (R) => {
116
- const E = Y[R];
117
- return n(`orientation: ${E}`);
119
+ const E = C[R];
120
+ return a(`orientation: ${E}`);
118
121
  }
119
122
  };
120
- `${l}${t.REGULAR}${t.REGULAR}${t.COLOR}${t.SERIF}${t.WEIGHT_DEFAULT}${T.down("xl")`
123
+ `${l}${t.REGULAR}${t.REGULAR}${t.COLOR}${t.SERIF}${t.WEIGHT_DEFAULT}${i.down("xl")`
121
124
  --header-offset: 56px;
122
- `}${T.intermediate("xl", "lg")`
125
+ `}${i.intermediate("xl", "lg")`
123
126
  --header-offset: 76px;
124
127
  `}`;
125
- const x = "StreamLayerCSSReset", f = "ttkj0ah", L = ({ children: R, style: E }) => /* @__PURE__ */ a("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ a("div", { className: f, style: E, children: R }) });
128
+ const U = "StreamLayerCSSReset", F = "ttkj0ah", u = ({ children: R, style: E }) => /* @__PURE__ */ T("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ T("div", { className: F, style: E, children: R }) });
126
129
  export {
127
130
  o as E,
128
- r as O,
129
- I as S,
130
- D as a,
131
- O as b,
132
- x as m,
133
- L as p
131
+ N as O,
132
+ P as S,
133
+ B as a,
134
+ f as b,
135
+ U as m,
136
+ u as p
134
137
  };