@tivio/sdk-react 2.1.4 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +8 -0
- package/coverage/clover.xml +356 -95
- package/coverage/lcov-report/index.html +55 -25
- package/coverage/lcov-report/src/components/ContextProvider.tsx.html +194 -0
- package/coverage/lcov-report/src/components/TivioProvider.tsx.html +109 -37
- package/coverage/lcov-report/src/components/TivioWidgetError.tsx.html +3 -3
- package/coverage/lcov-report/src/components/TivioWidgetLoader.tsx.html +3 -3
- package/coverage/lcov-report/src/components/context/ChannelsContext.tsx.html +197 -0
- package/coverage/lcov-report/src/components/context/OrganizationSubscriptionsContext.tsx.html +179 -0
- package/coverage/lcov-report/src/components/context/PurchasesWithVideosContext.tsx.html +179 -0
- package/coverage/lcov-report/src/components/context/RowItemsContext.tsx.html +191 -0
- package/coverage/lcov-report/src/components/context/ScreensContext.tsx.html +185 -0
- package/coverage/lcov-report/src/components/context/SectionsContext.tsx.html +200 -0
- package/coverage/lcov-report/src/components/context/UserContext.tsx.html +176 -0
- package/coverage/lcov-report/src/components/context/VideosContext.tsx.html +200 -0
- package/coverage/lcov-report/src/components/context/index.html +231 -0
- package/coverage/lcov-report/src/components/context/index.ts.html +104 -0
- package/coverage/lcov-report/src/components/index.html +32 -32
- package/coverage/lcov-report/src/conf.ts.html +27 -21
- package/coverage/lcov-report/src/index.html +21 -6
- package/coverage/lcov-report/src/services/bundleLoader.ts.html +127 -157
- package/coverage/lcov-report/src/services/dependencyResolver.ts.html +36 -30
- package/coverage/lcov-report/src/services/index.html +102 -42
- package/coverage/lcov-report/src/services/logger.ts.html +53 -98
- package/coverage/lcov-report/src/services/packageLoader.ts.html +31 -31
- package/coverage/lcov-report/src/services/pubSub.ts.html +9 -9
- package/coverage/lcov-report/src/services/sentry.ts.html +170 -0
- package/coverage/lcov-report/src/services/settings.ts.html +34 -34
- package/coverage/lcov-report/src/setupTests.ts.html +9 -9
- package/coverage/lcov.info +641 -141
- package/dist/components/TivioProvider.d.ts +3 -0
- package/dist/components/hooks/usePurchaseSubscription.d.ts +2 -7
- package/dist/components/hooks/useTransactionPayment.d.ts +2 -7
- package/dist/conf.d.ts +1 -0
- package/dist/index.js +1 -2
- package/dist/services/dependencyResolver.d.ts +2 -1
- package/dist/services/sentry.d.ts +2 -5
- package/dist/types.d.ts +5 -13
- package/env +0 -0
- package/package.json +12 -12
- package/scripts/build_dev.sh +3 -0
- package/scripts/build_prod.sh +3 -0
- package/scripts/postpublish.ts +10 -0
- package/scripts/start.sh +3 -0
- package/dist/index.js.LICENSE.txt +0 -114
@@ -23,30 +23,30 @@
|
|
23
23
|
<div class='clearfix'>
|
24
24
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
26
|
-
<span class="strong">
|
26
|
+
<span class="strong">82.03% </span>
|
27
27
|
<span class="quiet">Statements</span>
|
28
|
-
<span class='fraction'>
|
28
|
+
<span class='fraction'>251/306</span>
|
29
29
|
</div>
|
30
30
|
|
31
31
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
33
|
-
<span class="strong">
|
33
|
+
<span class="strong">65.08% </span>
|
34
34
|
<span class="quiet">Branches</span>
|
35
|
-
<span class='fraction'>
|
35
|
+
<span class='fraction'>41/63</span>
|
36
36
|
</div>
|
37
37
|
|
38
38
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
40
|
-
<span class="strong">
|
40
|
+
<span class="strong">64.52% </span>
|
41
41
|
<span class="quiet">Functions</span>
|
42
|
-
<span class='fraction'>
|
42
|
+
<span class='fraction'>40/62</span>
|
43
43
|
</div>
|
44
44
|
|
45
45
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
47
|
-
<span class="strong">
|
47
|
+
<span class="strong">81.38% </span>
|
48
48
|
<span class="quiet">Lines</span>
|
49
|
-
<span class='fraction'>
|
49
|
+
<span class='fraction'>236/290</span>
|
50
50
|
</div>
|
51
51
|
|
52
52
|
|
@@ -55,7 +55,7 @@
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
56
56
|
</p>
|
57
57
|
</div>
|
58
|
-
<div class='status-line
|
58
|
+
<div class='status-line high'></div>
|
59
59
|
<div class="pad1">
|
60
60
|
<table class="coverage-summary">
|
61
61
|
<thead>
|
@@ -78,28 +78,58 @@
|
|
78
78
|
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
79
79
|
</td>
|
80
80
|
<td data-value="100" class="pct high">100%</td>
|
81
|
-
<td data-value="
|
81
|
+
<td data-value="18" class="abs high">18/18</td>
|
82
|
+
<td data-value="75" class="pct medium">75%</td>
|
83
|
+
<td data-value="4" class="abs medium">3/4</td>
|
82
84
|
<td data-value="100" class="pct high">100%</td>
|
83
|
-
<td data-value="
|
84
|
-
<td data-value="100" class="pct high">100%</td>
|
85
|
-
<td data-value="0" class="abs high">0/0</td>
|
85
|
+
<td data-value="1" class="abs high">1/1</td>
|
86
86
|
<td data-value="100" class="pct high">100%</td>
|
87
|
-
<td data-value="
|
87
|
+
<td data-value="17" class="abs high">17/17</td>
|
88
88
|
</tr>
|
89
89
|
|
90
90
|
<tr>
|
91
|
-
<td class="file
|
92
|
-
<td data-value="
|
93
|
-
<div class="chart"><div class="cover-fill" style="width:
|
91
|
+
<td class="file high" data-value="src/components"><a href="src/components/index.html">src/components</a></td>
|
92
|
+
<td data-value="85" class="pic high">
|
93
|
+
<div class="chart"><div class="cover-fill" style="width: 85%"></div><div class="cover-empty" style="width: 15%"></div></div>
|
94
94
|
</td>
|
95
|
-
<td data-value="
|
96
|
-
<td data-value="
|
97
|
-
<td data-value="
|
98
|
-
<td data-value="
|
95
|
+
<td data-value="85" class="pct high">85%</td>
|
96
|
+
<td data-value="40" class="abs high">34/40</td>
|
97
|
+
<td data-value="50" class="pct medium">50%</td>
|
98
|
+
<td data-value="10" class="abs medium">5/10</td>
|
99
99
|
<td data-value="57.14" class="pct medium">57.14%</td>
|
100
|
-
<td data-value="
|
101
|
-
<td data-value="
|
102
|
-
<td data-value="
|
100
|
+
<td data-value="7" class="abs medium">4/7</td>
|
101
|
+
<td data-value="82.86" class="pct high">82.86%</td>
|
102
|
+
<td data-value="35" class="abs high">29/35</td>
|
103
|
+
</tr>
|
104
|
+
|
105
|
+
<tr>
|
106
|
+
<td class="file medium" data-value="src/components/context"><a href="src/components/context/index.html">src/components/context</a></td>
|
107
|
+
<td data-value="79.12" class="pic medium">
|
108
|
+
<div class="chart"><div class="cover-fill" style="width: 79%"></div><div class="cover-empty" style="width: 21%"></div></div>
|
109
|
+
</td>
|
110
|
+
<td data-value="79.12" class="pct medium">79.12%</td>
|
111
|
+
<td data-value="91" class="abs medium">72/91</td>
|
112
|
+
<td data-value="100" class="pct high">100%</td>
|
113
|
+
<td data-value="0" class="abs high">0/0</td>
|
114
|
+
<td data-value="40" class="pct low">40%</td>
|
115
|
+
<td data-value="20" class="abs low">8/20</td>
|
116
|
+
<td data-value="79.12" class="pct medium">79.12%</td>
|
117
|
+
<td data-value="91" class="abs medium">72/91</td>
|
118
|
+
</tr>
|
119
|
+
|
120
|
+
<tr>
|
121
|
+
<td class="file high" data-value="src/services"><a href="src/services/index.html">src/services</a></td>
|
122
|
+
<td data-value="80.89" class="pic high">
|
123
|
+
<div class="chart"><div class="cover-fill" style="width: 80%"></div><div class="cover-empty" style="width: 20%"></div></div>
|
124
|
+
</td>
|
125
|
+
<td data-value="80.89" class="pct high">80.89%</td>
|
126
|
+
<td data-value="157" class="abs high">127/157</td>
|
127
|
+
<td data-value="67.35" class="pct medium">67.35%</td>
|
128
|
+
<td data-value="49" class="abs medium">33/49</td>
|
129
|
+
<td data-value="79.41" class="pct medium">79.41%</td>
|
130
|
+
<td data-value="34" class="abs medium">27/34</td>
|
131
|
+
<td data-value="80.27" class="pct high">80.27%</td>
|
132
|
+
<td data-value="147" class="abs high">118/147</td>
|
103
133
|
</tr>
|
104
134
|
|
105
135
|
</tbody>
|
@@ -110,7 +140,7 @@
|
|
110
140
|
<div class='footer quiet pad2 space-top1 center small'>
|
111
141
|
Code coverage generated by
|
112
142
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
113
|
-
at
|
143
|
+
at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
|
114
144
|
</div>
|
115
145
|
</div>
|
116
146
|
<script src="prettify.js"></script>
|
@@ -0,0 +1,194 @@
|
|
1
|
+
|
2
|
+
<!doctype html>
|
3
|
+
<html lang="en">
|
4
|
+
|
5
|
+
<head>
|
6
|
+
<title>Code coverage report for src/components/ContextProvider.tsx</title>
|
7
|
+
<meta charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
9
|
+
<link rel="stylesheet" href="../../base.css" />
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
12
|
+
<style type='text/css'>
|
13
|
+
.coverage-summary .sorter {
|
14
|
+
background-image: url(../../sort-arrow-sprite.png);
|
15
|
+
}
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<div class='wrapper'>
|
21
|
+
<div class='pad1'>
|
22
|
+
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/components</a> ContextProvider.tsx</h1>
|
23
|
+
<div class='clearfix'>
|
24
|
+
|
25
|
+
<div class='fl pad1y space-right2'>
|
26
|
+
<span class="strong">100% </span>
|
27
|
+
<span class="quiet">Statements</span>
|
28
|
+
<span class='fraction'>5/5</span>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
|
32
|
+
<div class='fl pad1y space-right2'>
|
33
|
+
<span class="strong">100% </span>
|
34
|
+
<span class="quiet">Branches</span>
|
35
|
+
<span class='fraction'>0/0</span>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
|
39
|
+
<div class='fl pad1y space-right2'>
|
40
|
+
<span class="strong">100% </span>
|
41
|
+
<span class="quiet">Functions</span>
|
42
|
+
<span class='fraction'>1/1</span>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
|
46
|
+
<div class='fl pad1y space-right2'>
|
47
|
+
<span class="strong">100% </span>
|
48
|
+
<span class="quiet">Lines</span>
|
49
|
+
<span class='fraction'>5/5</span>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<p class="quiet">
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
56
|
+
</p>
|
57
|
+
</div>
|
58
|
+
<div class='status-line high'></div>
|
59
|
+
<pre><table class="coverage">
|
60
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
61
|
+
<a name='L2'></a><a href='#L2'>2</a>
|
62
|
+
<a name='L3'></a><a href='#L3'>3</a>
|
63
|
+
<a name='L4'></a><a href='#L4'>4</a>
|
64
|
+
<a name='L5'></a><a href='#L5'>5</a>
|
65
|
+
<a name='L6'></a><a href='#L6'>6</a>
|
66
|
+
<a name='L7'></a><a href='#L7'>7</a>
|
67
|
+
<a name='L8'></a><a href='#L8'>8</a>
|
68
|
+
<a name='L9'></a><a href='#L9'>9</a>
|
69
|
+
<a name='L10'></a><a href='#L10'>10</a>
|
70
|
+
<a name='L11'></a><a href='#L11'>11</a>
|
71
|
+
<a name='L12'></a><a href='#L12'>12</a>
|
72
|
+
<a name='L13'></a><a href='#L13'>13</a>
|
73
|
+
<a name='L14'></a><a href='#L14'>14</a>
|
74
|
+
<a name='L15'></a><a href='#L15'>15</a>
|
75
|
+
<a name='L16'></a><a href='#L16'>16</a>
|
76
|
+
<a name='L17'></a><a href='#L17'>17</a>
|
77
|
+
<a name='L18'></a><a href='#L18'>18</a>
|
78
|
+
<a name='L19'></a><a href='#L19'>19</a>
|
79
|
+
<a name='L20'></a><a href='#L20'>20</a>
|
80
|
+
<a name='L21'></a><a href='#L21'>21</a>
|
81
|
+
<a name='L22'></a><a href='#L22'>22</a>
|
82
|
+
<a name='L23'></a><a href='#L23'>23</a>
|
83
|
+
<a name='L24'></a><a href='#L24'>24</a>
|
84
|
+
<a name='L25'></a><a href='#L25'>25</a>
|
85
|
+
<a name='L26'></a><a href='#L26'>26</a>
|
86
|
+
<a name='L27'></a><a href='#L27'>27</a>
|
87
|
+
<a name='L28'></a><a href='#L28'>28</a>
|
88
|
+
<a name='L29'></a><a href='#L29'>29</a>
|
89
|
+
<a name='L30'></a><a href='#L30'>30</a>
|
90
|
+
<a name='L31'></a><a href='#L31'>31</a>
|
91
|
+
<a name='L32'></a><a href='#L32'>32</a>
|
92
|
+
<a name='L33'></a><a href='#L33'>33</a>
|
93
|
+
<a name='L34'></a><a href='#L34'>34</a>
|
94
|
+
<a name='L35'></a><a href='#L35'>35</a>
|
95
|
+
<a name='L36'></a><a href='#L36'>36</a>
|
96
|
+
<a name='L37'></a><a href='#L37'>37</a>
|
97
|
+
<a name='L38'></a><a href='#L38'>38</a>
|
98
|
+
<a name='L39'></a><a href='#L39'>39</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">3x</span>
|
99
|
+
<span class="cline-any cline-yes">3x</span>
|
100
|
+
<span class="cline-any cline-neutral"> </span>
|
101
|
+
<span class="cline-any cline-neutral"> </span>
|
102
|
+
<span class="cline-any cline-neutral"> </span>
|
103
|
+
<span class="cline-any cline-neutral"> </span>
|
104
|
+
<span class="cline-any cline-neutral"> </span>
|
105
|
+
<span class="cline-any cline-neutral"> </span>
|
106
|
+
<span class="cline-any cline-neutral"> </span>
|
107
|
+
<span class="cline-any cline-neutral"> </span>
|
108
|
+
<span class="cline-any cline-neutral"> </span>
|
109
|
+
<span class="cline-any cline-neutral"> </span>
|
110
|
+
<span class="cline-any cline-yes">3x</span>
|
111
|
+
<span class="cline-any cline-neutral"> </span>
|
112
|
+
<span class="cline-any cline-yes">2x</span>
|
113
|
+
<span class="cline-any cline-neutral"> </span>
|
114
|
+
<span class="cline-any cline-neutral"> </span>
|
115
|
+
<span class="cline-any cline-neutral"> </span>
|
116
|
+
<span class="cline-any cline-neutral"> </span>
|
117
|
+
<span class="cline-any cline-neutral"> </span>
|
118
|
+
<span class="cline-any cline-neutral"> </span>
|
119
|
+
<span class="cline-any cline-neutral"> </span>
|
120
|
+
<span class="cline-any cline-neutral"> </span>
|
121
|
+
<span class="cline-any cline-neutral"> </span>
|
122
|
+
<span class="cline-any cline-neutral"> </span>
|
123
|
+
<span class="cline-any cline-neutral"> </span>
|
124
|
+
<span class="cline-any cline-neutral"> </span>
|
125
|
+
<span class="cline-any cline-neutral"> </span>
|
126
|
+
<span class="cline-any cline-neutral"> </span>
|
127
|
+
<span class="cline-any cline-neutral"> </span>
|
128
|
+
<span class="cline-any cline-neutral"> </span>
|
129
|
+
<span class="cline-any cline-neutral"> </span>
|
130
|
+
<span class="cline-any cline-neutral"> </span>
|
131
|
+
<span class="cline-any cline-neutral"> </span>
|
132
|
+
<span class="cline-any cline-neutral"> </span>
|
133
|
+
<span class="cline-any cline-neutral"> </span>
|
134
|
+
<span class="cline-any cline-yes">3x</span>
|
135
|
+
<span class="cline-any cline-neutral"> </span>
|
136
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React from 'react'
|
137
|
+
import {
|
138
|
+
ChannelsContextProvider,
|
139
|
+
OrganizationSubscriptionsContextProvider,
|
140
|
+
PurchasesWithVideosContextProvider,
|
141
|
+
SectionsContextProvider,
|
142
|
+
UserContextProvider,
|
143
|
+
VideosContextProvider,
|
144
|
+
ScreensContextProvider,
|
145
|
+
RowItemsContextProvider,
|
146
|
+
} from './context'
|
147
|
+
|
148
|
+
const ContextProvider: React.FC = (props) => {
|
149
|
+
|
150
|
+
return (
|
151
|
+
<ChannelsContextProvider>
|
152
|
+
<SectionsContextProvider>
|
153
|
+
<VideosContextProvider>
|
154
|
+
<UserContextProvider>
|
155
|
+
<OrganizationSubscriptionsContextProvider>
|
156
|
+
<PurchasesWithVideosContextProvider>
|
157
|
+
<ScreensContextProvider>
|
158
|
+
<RowItemsContextProvider>
|
159
|
+
{props.children}
|
160
|
+
</RowItemsContextProvider>
|
161
|
+
</ScreensContextProvider>
|
162
|
+
</PurchasesWithVideosContextProvider>
|
163
|
+
</OrganizationSubscriptionsContextProvider>
|
164
|
+
</UserContextProvider>
|
165
|
+
</VideosContextProvider>
|
166
|
+
</SectionsContextProvider>
|
167
|
+
</ChannelsContextProvider>
|
168
|
+
)
|
169
|
+
}
|
170
|
+
|
171
|
+
export {
|
172
|
+
ContextProvider,
|
173
|
+
}
|
174
|
+
</pre></td></tr></table></pre>
|
175
|
+
|
176
|
+
<div class='push'></div><!-- for sticky footer -->
|
177
|
+
</div><!-- /wrapper -->
|
178
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
179
|
+
Code coverage generated by
|
180
|
+
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
181
|
+
at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
<script src="../../prettify.js"></script>
|
185
|
+
<script>
|
186
|
+
window.onload = function () {
|
187
|
+
prettyPrint();
|
188
|
+
};
|
189
|
+
</script>
|
190
|
+
<script src="../../sorter.js"></script>
|
191
|
+
<script src="../../block-navigation.js"></script>
|
192
|
+
</body>
|
193
|
+
</html>
|
194
|
+
|
@@ -23,30 +23,30 @@
|
|
23
23
|
<div class='clearfix'>
|
24
24
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
26
|
-
<span class="strong">
|
26
|
+
<span class="strong">85.19% </span>
|
27
27
|
<span class="quiet">Statements</span>
|
28
|
-
<span class='fraction'>
|
28
|
+
<span class='fraction'>23/27</span>
|
29
29
|
</div>
|
30
30
|
|
31
31
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
33
|
-
<span class="strong">
|
33
|
+
<span class="strong">50% </span>
|
34
34
|
<span class="quiet">Branches</span>
|
35
|
-
<span class='fraction'>
|
35
|
+
<span class='fraction'>5/10</span>
|
36
36
|
</div>
|
37
37
|
|
38
38
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
40
|
-
<span class="strong">
|
40
|
+
<span class="strong">75% </span>
|
41
41
|
<span class="quiet">Functions</span>
|
42
|
-
<span class='fraction'>
|
42
|
+
<span class='fraction'>3/4</span>
|
43
43
|
</div>
|
44
44
|
|
45
45
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
47
|
-
<span class="strong">
|
47
|
+
<span class="strong">83.33% </span>
|
48
48
|
<span class="quiet">Lines</span>
|
49
|
-
<span class='fraction'>
|
49
|
+
<span class='fraction'>20/24</span>
|
50
50
|
</div>
|
51
51
|
|
52
52
|
|
@@ -55,7 +55,7 @@
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
56
56
|
</p>
|
57
57
|
</div>
|
58
|
-
<div class='status-line
|
58
|
+
<div class='status-line high'></div>
|
59
59
|
<pre><table class="coverage">
|
60
60
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
61
61
|
<a name='L2'></a><a href='#L2'>2</a>
|
@@ -106,15 +106,41 @@
|
|
106
106
|
<a name='L47'></a><a href='#L47'>47</a>
|
107
107
|
<a name='L48'></a><a href='#L48'>48</a>
|
108
108
|
<a name='L49'></a><a href='#L49'>49</a>
|
109
|
-
<a name='L50'></a><a href='#L50'>50</a
|
109
|
+
<a name='L50'></a><a href='#L50'>50</a>
|
110
|
+
<a name='L51'></a><a href='#L51'>51</a>
|
111
|
+
<a name='L52'></a><a href='#L52'>52</a>
|
112
|
+
<a name='L53'></a><a href='#L53'>53</a>
|
113
|
+
<a name='L54'></a><a href='#L54'>54</a>
|
114
|
+
<a name='L55'></a><a href='#L55'>55</a>
|
115
|
+
<a name='L56'></a><a href='#L56'>56</a>
|
116
|
+
<a name='L57'></a><a href='#L57'>57</a>
|
117
|
+
<a name='L58'></a><a href='#L58'>58</a>
|
118
|
+
<a name='L59'></a><a href='#L59'>59</a>
|
119
|
+
<a name='L60'></a><a href='#L60'>60</a>
|
120
|
+
<a name='L61'></a><a href='#L61'>61</a>
|
121
|
+
<a name='L62'></a><a href='#L62'>62</a>
|
122
|
+
<a name='L63'></a><a href='#L63'>63</a>
|
123
|
+
<a name='L64'></a><a href='#L64'>64</a>
|
124
|
+
<a name='L65'></a><a href='#L65'>65</a>
|
125
|
+
<a name='L66'></a><a href='#L66'>66</a>
|
126
|
+
<a name='L67'></a><a href='#L67'>67</a>
|
127
|
+
<a name='L68'></a><a href='#L68'>68</a>
|
128
|
+
<a name='L69'></a><a href='#L69'>69</a>
|
129
|
+
<a name='L70'></a><a href='#L70'>70</a>
|
130
|
+
<a name='L71'></a><a href='#L71'>71</a>
|
131
|
+
<a name='L72'></a><a href='#L72'>72</a>
|
132
|
+
<a name='L73'></a><a href='#L73'>73</a>
|
133
|
+
<a name='L74'></a><a href='#L74'>74</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
110
134
|
<span class="cline-any cline-neutral"> </span>
|
111
135
|
<span class="cline-any cline-neutral"> </span>
|
112
136
|
<span class="cline-any cline-neutral"> </span>
|
113
137
|
<span class="cline-any cline-neutral"> </span>
|
114
|
-
<span class="cline-any cline-yes">
|
138
|
+
<span class="cline-any cline-yes">3x</span>
|
115
139
|
<span class="cline-any cline-neutral"> </span>
|
116
|
-
<span class="cline-any cline-yes">
|
117
|
-
<span class="cline-any cline-yes">
|
140
|
+
<span class="cline-any cline-yes">3x</span>
|
141
|
+
<span class="cline-any cline-yes">3x</span>
|
142
|
+
<span class="cline-any cline-yes">3x</span>
|
143
|
+
<span class="cline-any cline-yes">3x</span>
|
118
144
|
<span class="cline-any cline-neutral"> </span>
|
119
145
|
<span class="cline-any cline-neutral"> </span>
|
120
146
|
<span class="cline-any cline-neutral"> </span>
|
@@ -122,31 +148,53 @@
|
|
122
148
|
<span class="cline-any cline-neutral"> </span>
|
123
149
|
<span class="cline-any cline-neutral"> </span>
|
124
150
|
<span class="cline-any cline-neutral"> </span>
|
125
|
-
<span class="cline-any cline-yes">1x</span>
|
126
|
-
<span class="cline-any cline-yes">1x</span>
|
127
151
|
<span class="cline-any cline-neutral"> </span>
|
128
|
-
<span class="cline-any cline-yes">
|
152
|
+
<span class="cline-any cline-yes">3x</span>
|
153
|
+
<span class="cline-any cline-yes">3x</span>
|
129
154
|
<span class="cline-any cline-neutral"> </span>
|
155
|
+
<span class="cline-any cline-yes">3x</span>
|
130
156
|
<span class="cline-any cline-neutral"> </span>
|
131
157
|
<span class="cline-any cline-neutral"> </span>
|
132
|
-
<span class="cline-any cline-no"> </span>
|
133
|
-
<span class="cline-any cline-no"> </span>
|
134
158
|
<span class="cline-any cline-neutral"> </span>
|
135
|
-
<span class="cline-any cline-
|
159
|
+
<span class="cline-any cline-yes">6x</span>
|
160
|
+
<span class="cline-any cline-yes">6x</span>
|
161
|
+
<span class="cline-any cline-neutral"> </span>
|
162
|
+
<span class="cline-any cline-yes">6x</span>
|
163
|
+
<span class="cline-any cline-neutral"> </span>
|
164
|
+
<span class="cline-any cline-neutral"> </span>
|
165
|
+
<span class="cline-any cline-yes">2x</span>
|
166
|
+
<span class="cline-any cline-neutral"> </span>
|
167
|
+
<span class="cline-any cline-neutral"> </span>
|
168
|
+
<span class="cline-any cline-yes">2x</span>
|
169
|
+
<span class="cline-any cline-neutral"> </span>
|
136
170
|
<span class="cline-any cline-neutral"> </span>
|
137
171
|
<span class="cline-any cline-neutral"> </span>
|
138
172
|
<span class="cline-any cline-neutral"> </span>
|
139
173
|
<span class="cline-any cline-neutral"> </span>
|
140
174
|
<span class="cline-any cline-neutral"> </span>
|
141
175
|
<span class="cline-any cline-neutral"> </span>
|
142
|
-
<span class="cline-any cline-no"> </span>
|
143
176
|
<span class="cline-any cline-neutral"> </span>
|
144
177
|
<span class="cline-any cline-neutral"> </span>
|
178
|
+
<span class="cline-any cline-yes">2x</span>
|
145
179
|
<span class="cline-any cline-neutral"> </span>
|
146
180
|
<span class="cline-any cline-neutral"> </span>
|
147
181
|
<span class="cline-any cline-neutral"> </span>
|
148
182
|
<span class="cline-any cline-neutral"> </span>
|
183
|
+
<span class="cline-any cline-neutral"> </span>
|
184
|
+
<span class="cline-any cline-neutral"> </span>
|
185
|
+
<span class="cline-any cline-neutral"> </span>
|
186
|
+
<span class="cline-any cline-neutral"> </span>
|
187
|
+
<span class="cline-any cline-yes">3x</span>
|
188
|
+
<span class="cline-any cline-yes">4x</span>
|
189
|
+
<span class="cline-any cline-neutral"> </span>
|
190
|
+
<span class="cline-any cline-yes">3x</span>
|
191
|
+
<span class="cline-any cline-yes">2x</span>
|
192
|
+
<span class="cline-any cline-neutral"> </span>
|
193
|
+
<span class="cline-any cline-neutral"> </span>
|
149
194
|
<span class="cline-any cline-yes">1x</span>
|
195
|
+
<span class="cline-any cline-neutral"> </span>
|
196
|
+
<span class="cline-any cline-neutral"> </span>
|
197
|
+
<span class="cline-any cline-yes">3x</span>
|
150
198
|
<span class="cline-any cline-no"> </span>
|
151
199
|
<span class="cline-any cline-neutral"> </span>
|
152
200
|
<span class="cline-any cline-no"> </span>
|
@@ -160,49 +208,73 @@
|
|
160
208
|
* nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
161
209
|
*/
|
162
210
|
|
163
|
-
import React, { FunctionComponentElement, useContext } from 'react'
|
211
|
+
import React, { FunctionComponentElement, useContext, useEffect } from 'react'
|
164
212
|
|
165
213
|
import { createInternalConf } from '../conf'
|
166
214
|
import { createUseRemoteBundle, RemoteBundleState } from '../services/bundleLoader'
|
215
|
+
import { ContextProvider } from './ContextProvider'
|
216
|
+
import { injectSentryToWindow } from '../services/sentry'
|
217
|
+
|
167
218
|
import type { Conf } from '../types'
|
168
219
|
|
169
220
|
export type TivioProviderProps = {
|
170
221
|
children: React.ReactNode
|
171
|
-
conf
|
222
|
+
conf?: Conf
|
172
223
|
}
|
173
224
|
|
174
225
|
const useRemoteBundle = createUseRemoteBundle()
|
175
226
|
const TivioContext = React.createContext<RemoteBundleState | null>(null)
|
176
227
|
|
177
|
-
export const TivioProvider =
|
228
|
+
export const TivioProvider = ({
|
178
229
|
children,
|
179
230
|
conf,
|
180
231
|
}: TivioProviderProps): FunctionComponentElement<TivioProviderProps> => {
|
181
|
-
const _conf = <span class="
|
182
|
-
const bundleState =
|
232
|
+
const _conf = createInternalConf(conf ?? <span class="branch-1 cbranch-no" title="branch not covered" >null)</span>
|
233
|
+
const bundleState = useRemoteBundle(_conf)
|
183
234
|
|
184
|
-
|
235
|
+
useEffect(() => {
|
236
|
+
// Has to be called here on mount, because if it is used in Next.js
|
237
|
+
// window is not available during SSR phase
|
238
|
+
injectSentryToWindow()
|
239
|
+
}, [])
|
240
|
+
|
241
|
+
const content = bundleState?.state === 'ready' && <span class="branch-1 cbranch-no" title="branch not covered" >bundleState.components </span>?
|
185
242
|
(
|
186
|
-
<bundleState.components.Provider
|
243
|
+
<span class="branch-0 cbranch-no" title="branch not covered" > <bundleState.components.Provider</span>
|
244
|
+
language={_conf.language}
|
245
|
+
disableUnmounting={_conf.disableUnmounting}
|
246
|
+
>
|
187
247
|
{children}
|
188
248
|
</bundleState.components.Provider>
|
189
249
|
) : children
|
190
250
|
|
191
|
-
|
192
|
-
<
|
193
|
-
{
|
194
|
-
|
251
|
+
return (
|
252
|
+
<ContextProvider>
|
253
|
+
<TivioContext.Provider value={bundleState}>
|
254
|
+
{content}
|
255
|
+
</TivioContext.Provider>
|
256
|
+
</ContextProvider>
|
195
257
|
)
|
196
258
|
}
|
197
259
|
|
198
|
-
export const useTivioData =
|
199
|
-
const context =
|
260
|
+
export const useTivioData = () => {
|
261
|
+
const context = useContext(TivioContext)
|
262
|
+
|
263
|
+
if (context === null) {
|
264
|
+
throw new Error('Make sure to wrap your app in <TivioProvider conf={...}><App/></TivioProvider>')
|
265
|
+
}
|
266
|
+
|
267
|
+
return context
|
268
|
+
}
|
269
|
+
|
270
|
+
export const useTivioReadyData = <span class="fstat-no" title="function not covered" >() =</span>> {
|
271
|
+
const bundle = <span class="cstat-no" title="statement not covered" >useTivioData()</span>
|
200
272
|
|
201
|
-
<span class="cstat-no" title="statement not covered" > if (
|
202
|
-
<span class="cstat-no" title="statement not covered" >
|
273
|
+
<span class="cstat-no" title="statement not covered" > if (bundle.state === 'ready') {</span>
|
274
|
+
<span class="cstat-no" title="statement not covered" > return bundle</span>
|
203
275
|
}
|
204
276
|
|
205
|
-
<span class="cstat-no" title="statement not covered" > return
|
277
|
+
<span class="cstat-no" title="statement not covered" > return null</span>
|
206
278
|
}
|
207
279
|
</pre></td></tr></table></pre>
|
208
280
|
|
@@ -211,7 +283,7 @@ export const useTivioData = <span class="fstat-no" title="function not covered"
|
|
211
283
|
<div class='footer quiet pad2 space-top1 center small'>
|
212
284
|
Code coverage generated by
|
213
285
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
214
|
-
at
|
286
|
+
at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
|
215
287
|
</div>
|
216
288
|
</div>
|
217
289
|
<script src="../../prettify.js"></script>
|
@@ -76,11 +76,11 @@
|
|
76
76
|
<span class="cline-any cline-neutral"> </span>
|
77
77
|
<span class="cline-any cline-neutral"> </span>
|
78
78
|
<span class="cline-any cline-neutral"> </span>
|
79
|
-
<span class="cline-any cline-yes">
|
79
|
+
<span class="cline-any cline-yes">4x</span>
|
80
80
|
<span class="cline-any cline-neutral"> </span>
|
81
81
|
<span class="cline-any cline-neutral"> </span>
|
82
82
|
<span class="cline-any cline-neutral"> </span>
|
83
|
-
<span class="cline-any cline-yes">
|
83
|
+
<span class="cline-any cline-yes">4x</span>
|
84
84
|
<span class="cline-any cline-no"> </span>
|
85
85
|
<span class="cline-any cline-neutral"> </span>
|
86
86
|
<span class="cline-any cline-neutral"> </span>
|
@@ -106,7 +106,7 @@ export const TivioWidgetError: React.FC<TivioWidgetErrorProps> = <span cla
|
|
106
106
|
<div class='footer quiet pad2 space-top1 center small'>
|
107
107
|
Code coverage generated by
|
108
108
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
109
|
-
at
|
109
|
+
at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
|
110
110
|
</div>
|
111
111
|
</div>
|
112
112
|
<script src="../../prettify.js"></script>
|
@@ -74,9 +74,9 @@
|
|
74
74
|
<span class="cline-any cline-neutral"> </span>
|
75
75
|
<span class="cline-any cline-neutral"> </span>
|
76
76
|
<span class="cline-any cline-neutral"> </span>
|
77
|
-
<span class="cline-any cline-yes">
|
77
|
+
<span class="cline-any cline-yes">4x</span>
|
78
78
|
<span class="cline-any cline-neutral"> </span>
|
79
|
-
<span class="cline-any cline-yes">
|
79
|
+
<span class="cline-any cline-yes">4x</span>
|
80
80
|
<span class="cline-any cline-no"> </span>
|
81
81
|
<span class="cline-any cline-neutral"> </span>
|
82
82
|
<span class="cline-any cline-neutral"> </span>
|
@@ -100,7 +100,7 @@ export const TivioWidgetLoader: React.FC = <span class="fstat-no" title="functio
|
|
100
100
|
<div class='footer quiet pad2 space-top1 center small'>
|
101
101
|
Code coverage generated by
|
102
102
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
103
|
-
at
|
103
|
+
at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
|
104
104
|
</div>
|
105
105
|
</div>
|
106
106
|
<script src="../../prettify.js"></script>
|