@tivio/sdk-react 2.1.4 → 2.2.1

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.
Files changed (45) hide show
  1. package/README.md +8 -0
  2. package/coverage/clover.xml +356 -95
  3. package/coverage/lcov-report/index.html +55 -25
  4. package/coverage/lcov-report/src/components/ContextProvider.tsx.html +194 -0
  5. package/coverage/lcov-report/src/components/TivioProvider.tsx.html +109 -37
  6. package/coverage/lcov-report/src/components/TivioWidgetError.tsx.html +3 -3
  7. package/coverage/lcov-report/src/components/TivioWidgetLoader.tsx.html +3 -3
  8. package/coverage/lcov-report/src/components/context/ChannelsContext.tsx.html +197 -0
  9. package/coverage/lcov-report/src/components/context/OrganizationSubscriptionsContext.tsx.html +179 -0
  10. package/coverage/lcov-report/src/components/context/PurchasesWithVideosContext.tsx.html +179 -0
  11. package/coverage/lcov-report/src/components/context/RowItemsContext.tsx.html +191 -0
  12. package/coverage/lcov-report/src/components/context/ScreensContext.tsx.html +185 -0
  13. package/coverage/lcov-report/src/components/context/SectionsContext.tsx.html +200 -0
  14. package/coverage/lcov-report/src/components/context/UserContext.tsx.html +176 -0
  15. package/coverage/lcov-report/src/components/context/VideosContext.tsx.html +200 -0
  16. package/coverage/lcov-report/src/components/context/index.html +231 -0
  17. package/coverage/lcov-report/src/components/context/index.ts.html +104 -0
  18. package/coverage/lcov-report/src/components/index.html +32 -32
  19. package/coverage/lcov-report/src/conf.ts.html +27 -21
  20. package/coverage/lcov-report/src/index.html +21 -6
  21. package/coverage/lcov-report/src/services/bundleLoader.ts.html +127 -157
  22. package/coverage/lcov-report/src/services/dependencyResolver.ts.html +36 -30
  23. package/coverage/lcov-report/src/services/index.html +102 -42
  24. package/coverage/lcov-report/src/services/logger.ts.html +53 -98
  25. package/coverage/lcov-report/src/services/packageLoader.ts.html +31 -31
  26. package/coverage/lcov-report/src/services/pubSub.ts.html +9 -9
  27. package/coverage/lcov-report/src/services/sentry.ts.html +170 -0
  28. package/coverage/lcov-report/src/services/settings.ts.html +34 -34
  29. package/coverage/lcov-report/src/setupTests.ts.html +9 -9
  30. package/coverage/lcov.info +641 -141
  31. package/dist/components/TivioProvider.d.ts +3 -0
  32. package/dist/components/hooks/usePurchaseSubscription.d.ts +2 -7
  33. package/dist/components/hooks/useTransactionPayment.d.ts +2 -7
  34. package/dist/conf.d.ts +1 -0
  35. package/dist/index.js +1 -2
  36. package/dist/services/dependencyResolver.d.ts +2 -1
  37. package/dist/services/sentry.d.ts +2 -5
  38. package/dist/types.d.ts +5 -13
  39. package/env +0 -0
  40. package/package.json +12 -12
  41. package/scripts/build_dev.sh +3 -0
  42. package/scripts/build_prod.sh +3 -0
  43. package/scripts/postpublish.ts +10 -0
  44. package/scripts/start.sh +3 -0
  45. package/dist/index.js.LICENSE.txt +0 -114
@@ -6,8 +6,9 @@ import firebase from 'firebase/app';
6
6
  import 'firebase/auth';
7
7
  import 'firebase/firestore';
8
8
  import * as mobx from 'mobx';
9
+ import * as mobxReact from 'mobx-react';
9
10
  import * as react from 'react';
10
11
  import * as reactDom from 'react-dom';
11
12
  import * as styledComponents from 'styled-components';
12
- export declare type SharedDependency = typeof react | typeof reactDom | typeof mobx | typeof styledComponents | typeof firebase;
13
+ export declare type SharedDependency = typeof react | typeof reactDom | typeof mobx | typeof styledComponents | typeof firebase | typeof mobxReact | null;
13
14
  export declare const resolveShared: (name: string) => SharedDependency;
@@ -1,7 +1,4 @@
1
1
  import * as _Sentry from '@sentry/browser';
2
- export declare const Sentry: typeof _Sentry;
2
+ export declare let Sentry: null | typeof _Sentry;
3
+ export declare const disableSentry: () => void;
3
4
  export declare const initSentry: () => void;
4
- /**
5
- * Inject Sentry to window in order to use it inside core-js, core-react, etc.
6
- */
7
- export declare const injectSentryToWindow: () => void;
package/dist/types.d.ts CHANGED
@@ -5,11 +5,11 @@
5
5
  /**
6
6
  * Export public client side API
7
7
  */
8
- import type { Monetization, Screen, SubscribeToItemsInRow, SubscribeToRowsInScreen, SubscribeToScreen, Video } from '@tivio/common';
9
8
  import { USER_TYPE } from '@tivio/common';
9
+ import type { InternalConf } from './conf';
10
+ import type { AdSource, PlayerWrapper } from './customPlayer.types';
11
+ import type { Monetization, QerkoPaymentInfo, Screen, SubscribeToItemsInRow, SubscribeToRowsInScreen, SubscribeToScreen, Video } from '@tivio/common';
10
12
  import type React from 'react';
11
- import { InternalConf } from './conf';
12
- import { AdSource, PlayerWrapper } from './customPlayer.types';
13
13
  declare type RemoteProviderProps = {
14
14
  disableUnmounting?: boolean;
15
15
  language?: string;
@@ -23,7 +23,7 @@ export interface ExportedConfig {
23
23
  showMarkers: boolean;
24
24
  }
25
25
  declare type Language = 'cs' | 'en' | 'sk' | 'de' | 'pl';
26
- declare type Conf = Pick<InternalConf, 'enable' | 'secret' | 'verbose' | 'logger' | 'disableUnmounting' | 'bundleUrlOverride' | 'LoaderComponent' | 'ErrorComponent' | 'language'>;
26
+ declare type Conf = Pick<InternalConf, 'enable' | 'secret' | 'verbose' | 'logger' | 'disableUnmounting' | 'bundleUrlOverride' | 'LoaderComponent' | 'ErrorComponent' | 'language' | 'enableSentry'>;
27
27
  declare type User = {
28
28
  purchases: Purchase[];
29
29
  purchasedVods: Purchase[];
@@ -117,14 +117,6 @@ export interface TivioWidgetRef {
117
117
  x: number;
118
118
  });
119
119
  }
120
- declare type QerkoPaymentInfo = {
121
- webPaymentGatewayLink: string;
122
- gatewayUri: string;
123
- paymentQRCodeUri: string;
124
- purchaseId: string;
125
- currency: string;
126
- amount: number;
127
- };
128
120
  declare type TivioSubscriptions = {
129
121
  subscribeToUser: (cb: (error: string | null, user: User | null) => void) => void;
130
122
  /**
@@ -372,4 +364,4 @@ declare type TivioBundle = {
372
364
  sources: TivioSources;
373
365
  subscriptions: TivioSubscriptions;
374
366
  };
375
- export type { RemoteProviderProps, WebPlayerProps, Conf, Nullable, Empty, Disposer, Marker, BetOffer, QerkoPaymentInfo, Purchase, Chapter, Language, Widget, Channel, Section, Video, TivioAuth, TivioSubscriptions, TivioGetters, TivioBundle, TivioHooks, TivioComponents, TivioSources, UserData, User, Monetization, VodTivioSource, };
367
+ export type { RemoteProviderProps, WebPlayerProps, Conf, Nullable, Empty, Disposer, Marker, BetOffer, Purchase, Chapter, Language, Widget, Channel, Section, Video, TivioAuth, TivioSubscriptions, TivioGetters, TivioBundle, TivioHooks, TivioComponents, TivioSources, UserData, User, Monetization, VodTivioSource, };
package/env ADDED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "2.1.4",
3
+ "version": "2.2.1",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -9,25 +9,26 @@
9
9
  "access": "public"
10
10
  },
11
11
  "scripts": {
12
- "build": "echo 'TODO We need a build script dev vs. prod 🔥' && yarn run clean && webpack --config=webpack.config.prod.js",
13
- "dev": "yarn run clean && webpack --config=webpack.config.dev.js",
14
- "start": "yarn run clean && webpack -w --config=webpack.config.dev.js",
12
+ "build": "bash ./scripts/build_prod.sh",
13
+ "build:dev": "bash ./scripts/build_dev.sh",
14
+ "start": "bash ./scripts/start.sh",
15
15
  "test": "jest --config=./jest.config.js --coverage",
16
16
  "clean": "rm -rf dist",
17
- "prepublishOnly": "yarn ts-node ./scripts/prepublish.ts && yarn clean && yarn run build",
17
+ "prepublishOnly": "yarn && yarn ts-node ./scripts/prepublish.ts && yarn run build",
18
+ "postpublish": "yarn ts-node ./scripts/postpublish.ts",
18
19
  "publish:alpha": "npm publish --tag alpha"
19
20
  },
20
21
  "peerDependencies": {
21
- "firebase": "^8.2.3",
22
- "mobx": "^6.0.4",
23
22
  "react": "^17.0.2",
24
- "react-dom": "^17.0.2",
25
- "styled-components": "^5.2.1"
23
+ "react-dom": "^17.0.2"
26
24
  },
27
25
  "dependencies": {
28
- "@tivio/common": "1.1.21",
29
26
  "@sentry/browser": "^6.1.0",
30
- "mobx-react": "^7.1.0"
27
+ "@tivio/common": "1.1.26",
28
+ "firebase": "^8.2.3",
29
+ "mobx": "^6.0.4",
30
+ "mobx-react": "^7.1.0",
31
+ "styled-components": "^5.2.1"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@testing-library/jest-dom": "^5.11.9",
@@ -53,7 +54,6 @@
53
54
  "styled-components": "^5.2.1",
54
55
  "timers-browserify": "^2.0.12",
55
56
  "ts-jest": "^26.4.4",
56
- "ts-loader": "^8.0.14",
57
57
  "typescript": "^4.1.3",
58
58
  "webpack": "^5.15.0",
59
59
  "webpack-cli": "^4.4.0",
@@ -0,0 +1,3 @@
1
+ cat ./.env.dev > ./.env;
2
+ yarn run clean;
3
+ yarn webpack --config=webpack.config.dev.js;
@@ -0,0 +1,3 @@
1
+ cat ./.env.prod > ./.env;
2
+ yarn run clean;
3
+ yarn webpack --config=webpack.config.prod.js;
@@ -0,0 +1,10 @@
1
+ import {
2
+ execCommand,
3
+ } from '@tivio/build-utils'
4
+
5
+ console.info('Reverting version of @tivio/common dependency in package.json to *...')
6
+
7
+ // Using sed instead of fs.write because it does not change the order
8
+ // of the other line
9
+ // eslint-disable-next-line no-useless-escape
10
+ execCommand('sed -i \'s#"@tivio/common":.*#"@tivio/common": "*",#g\' package.json')
@@ -0,0 +1,3 @@
1
+ cat ./.env.dev > ./.env;
2
+ yarn run clean;
3
+ yarn webpack -w --config=webpack.config.dev.js;
@@ -1,114 +0,0 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
-
16
- /*! *****************************************************************************
17
- Copyright (c) Microsoft Corporation. All rights reserved.
18
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
19
- this file except in compliance with the License. You may obtain a copy of the
20
- License at http://www.apache.org/licenses/LICENSE-2.0
21
-
22
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
24
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
25
- MERCHANTABLITY OR NON-INFRINGEMENT.
26
-
27
- See the Apache Version 2.0 License for specific language governing permissions
28
- and limitations under the License.
29
- ***************************************************************************** */
30
-
31
- /**
32
- * @license
33
- * Copyright 2017 Google LLC
34
- *
35
- * Licensed under the Apache License, Version 2.0 (the "License");
36
- * you may not use this file except in compliance with the License.
37
- * You may obtain a copy of the License at
38
- *
39
- * http://www.apache.org/licenses/LICENSE-2.0
40
- *
41
- * Unless required by applicable law or agreed to in writing, software
42
- * distributed under the License is distributed on an "AS IS" BASIS,
43
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
- * See the License for the specific language governing permissions and
45
- * limitations under the License.
46
- */
47
-
48
- /**
49
- * @license
50
- * Copyright 2018 Google LLC
51
- *
52
- * Licensed under the Apache License, Version 2.0 (the "License");
53
- * you may not use this file except in compliance with the License.
54
- * You may obtain a copy of the License at
55
- *
56
- * http://www.apache.org/licenses/LICENSE-2.0
57
- *
58
- * Unless required by applicable law or agreed to in writing, software
59
- * distributed under the License is distributed on an "AS IS" BASIS,
60
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
61
- * See the License for the specific language governing permissions and
62
- * limitations under the License.
63
- */
64
-
65
- /**
66
- * @license
67
- * Copyright 2019 Google LLC
68
- *
69
- * Licensed under the Apache License, Version 2.0 (the "License");
70
- * you may not use this file except in compliance with the License.
71
- * You may obtain a copy of the License at
72
- *
73
- * http://www.apache.org/licenses/LICENSE-2.0
74
- *
75
- * Unless required by applicable law or agreed to in writing, software
76
- * distributed under the License is distributed on an "AS IS" BASIS,
77
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
78
- * See the License for the specific language governing permissions and
79
- * limitations under the License.
80
- */
81
-
82
- /**
83
- * @license
84
- * Copyright 2020 Google LLC
85
- *
86
- * Licensed under the Apache License, Version 2.0 (the "License");
87
- * you may not use this file except in compliance with the License.
88
- * You may obtain a copy of the License at
89
- *
90
- * http://www.apache.org/licenses/LICENSE-2.0
91
- *
92
- * Unless required by applicable law or agreed to in writing, software
93
- * distributed under the License is distributed on an "AS IS" BASIS,
94
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
95
- * See the License for the specific language governing permissions and
96
- * limitations under the License.
97
- */
98
-
99
- /**
100
- * @license
101
- * Copyright 2021 Google LLC
102
- *
103
- * Licensed under the Apache License, Version 2.0 (the "License");
104
- * you may not use this file except in compliance with the License.
105
- * You may obtain a copy of the License at
106
- *
107
- * http://www.apache.org/licenses/LICENSE-2.0
108
- *
109
- * Unless required by applicable law or agreed to in writing, software
110
- * distributed under the License is distributed on an "AS IS" BASIS,
111
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112
- * See the License for the specific language governing permissions and
113
- * limitations under the License.
114
- */