@tivio/sdk-react 2.4.2 → 2.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- import { SubscribeToTaggedVideos, UseCancelSubscription } from '@tivio/common';
1
+ import { SubscribeToTaggedVideos, TileProps, UseCancelSubscription } from '@tivio/common';
2
2
  import { ComponentType } from 'react';
3
3
  import { Logger } from '../services/logger';
4
4
  import { FetchPackage } from '../services/packageLoader';
@@ -167,6 +167,10 @@ interface TivioAuth {
167
167
  signOut: () => Promise<void>;
168
168
  createFreePurchase: (monetizationId: string) => Promise<void>;
169
169
  }
170
+ interface TileActionProps {
171
+ goToPlayer?: (videoId: string, rowId?: string) => void;
172
+ goToLoginScreen?: () => void;
173
+ }
170
174
  declare type TivioComponents = {
171
175
  AdIndicationButtonWeb: React.ReactNode;
172
176
  Markers: React.ReactNode;
@@ -189,6 +193,11 @@ declare type TivioComponents = {
189
193
  onEnded?: () => any;
190
194
  }>;
191
195
  TvApp: React.ComponentType<TvAppProps>;
196
+ CustomerScreen: React.ComponentType<{
197
+ screenId: string;
198
+ } & TileActionProps>;
199
+ Row: React.ReactNode;
200
+ AppTile: React.ComponentType<TileProps>;
192
201
  };
193
202
  declare type TivioHooks = {
194
203
  useAd: () => [(AdSource | null)];
@@ -207,10 +216,58 @@ declare type TivioBundle = {
207
216
  setUser: (userId: string, userPayload?: unknown) => void;
208
217
  sources: TivioSources;
209
218
  subscriptions: TivioSubscriptions;
219
+ internal: {
220
+ hooks: TivioInternalHooks;
221
+ providers: TivioInternalProviders;
222
+ };
223
+ };
224
+ declare type TivioInternalHooks = {
225
+ useSubscriptionsOverlay: () => SubscriptionOverlayState;
226
+ useQerkoOverlay: () => QerkoOverlayState;
227
+ usePurchasesWithVideos: () => {
228
+ purchases: Purchase[];
229
+ };
230
+ useOrganizationSubscriptions: () => {
231
+ subscriptions: Monetization[];
232
+ };
233
+ useUser: () => {
234
+ user: User | null;
235
+ error: string | null;
236
+ };
237
+ };
238
+ declare type TivioInternalProviders = {
239
+ AppThemeProvider: React.ComponentType;
240
+ CustomerProvider: React.ComponentType;
241
+ UserContextProvider: React.ComponentType;
242
+ SubscriptionOverlayContextProvider: React.ComponentType;
243
+ QerkoOverlayContextProvider: React.ComponentType;
244
+ PurchasesWithVideosContextProvider: React.ComponentType;
245
+ OrganizationSubscriptionsContextProvider: React.ComponentType;
210
246
  };
211
247
  declare type TivioBundleFile = {
212
248
  Tivio: TivioBundle;
213
249
  };
250
+ interface SubscriptionOverlayData {
251
+ subscriptions?: Monetization[];
252
+ onPurchase?: () => void;
253
+ onClose?: () => void;
254
+ }
255
+ declare type SubscriptionOverlayState = {
256
+ data: SubscriptionOverlayData | null;
257
+ closeSubscriptionOverlay: () => void;
258
+ openSubscriptionOverlay: (data: SubscriptionOverlayData) => void;
259
+ };
260
+ interface QerkoData {
261
+ monetization: Monetization;
262
+ video?: Video;
263
+ onPurchase?: () => void;
264
+ onClose?: () => void;
265
+ }
266
+ interface QerkoOverlayState {
267
+ data: QerkoData | null;
268
+ openQerkoOverlay: ((data: QerkoData) => void);
269
+ closeQerkoOverlay: () => void;
270
+ }
214
271
  declare type RemoteBundleState = {
215
272
  config: InternalConfig;
216
273
  error: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -14,7 +14,6 @@
14
14
  "start": "yarn ts-node ./scripts/start.ts",
15
15
  "test": "jest --config=./jest.config.js --coverage",
16
16
  "clean": "rm -rf dist",
17
- "prepublishOnly": "yarn && yarn ts-node ./scripts/prepublish.ts && yarn run build",
18
17
  "postpublish": "yarn ts-node ./scripts/postpublish.ts",
19
18
  "publish:alpha": "npm publish --tag alpha",
20
19
  "check:cycles ": "npx madge --circular src/**/*"
@@ -27,7 +26,7 @@
27
26
  "@material-ui/core": "^4.11.2",
28
27
  "@material-ui/icons": "^4.11.2",
29
28
  "@sentry/browser": "^6.1.0",
30
- "@tivio/common": "1.1.63",
29
+ "@tivio/common": "1.1.65",
31
30
  "firebase": "^8.2.3",
32
31
  "formik": "^2.2.7",
33
32
  "i18next": "^19.8.4",
@@ -1,9 +0,0 @@
1
- import { Monetization } from '@tivio/common';
2
- import React from 'react';
3
- interface OrganizationSubscriptionsContextState {
4
- subscriptions: Monetization[];
5
- setSubscriptions: (subscriptions: Monetization[]) => void;
6
- }
7
- declare const OrganizationSubscriptionsContext: React.Context<OrganizationSubscriptionsContextState>;
8
- declare const OrganizationSubscriptionsContextProvider: React.FC;
9
- export { OrganizationSubscriptionsContextProvider, OrganizationSubscriptionsContext, };
@@ -1,9 +0,0 @@
1
- import { Purchase } from '@tivio/common';
2
- import React from 'react';
3
- interface PurchasesWithVideosContextState {
4
- purchases: Purchase[];
5
- setPurchases: (purchases: Purchase[]) => void;
6
- }
7
- declare const PurchasesWithVideosContext: React.Context<PurchasesWithVideosContextState>;
8
- declare const PurchasesWithVideosContextProvider: React.FC;
9
- export { PurchasesWithVideosContext, PurchasesWithVideosContextProvider, };
@@ -1,9 +0,0 @@
1
- import { User } from '@tivio/common';
2
- import React from 'react';
3
- interface UserContextState {
4
- user: User | null;
5
- setUser: (user: User) => void;
6
- }
7
- declare const UserContext: React.Context<UserContextState>;
8
- declare const UserContextProvider: React.FC;
9
- export { UserContextProvider, UserContext, };