@tivio/sdk-react 2.4.2-beta2 → 2.4.3-alpha2
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/components/ContextProvider.d.ts +6 -1
- package/dist/components/context/index.d.ts +0 -3
- package/dist/components/hooks/useOrganizationSubscriptions.d.ts +1 -2
- package/dist/components/hooks/useUser.d.ts +1 -2
- package/dist/index.js +13004 -1
- package/dist/types/bundle.types.d.ts +59 -2
- package/doc/changelog.md +0 -0
- package/package.json +5 -6
- package/dist/components/context/OrganizationSubscriptionsContext.d.ts +0 -9
- package/dist/components/context/PurchasesWithVideosContext.d.ts +0 -9
- package/dist/components/context/UserContext.d.ts +0 -9
@@ -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,14 +216,62 @@ 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;
|
217
274
|
settings: Settings;
|
218
275
|
state: 'loading' | 'error' | 'ready';
|
219
276
|
} & Nullable<TivioBundle>;
|
220
|
-
export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, Events, PubSub, };
|
277
|
+
export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, TivioInternalHooks, TivioInternalProviders, Events, PubSub, };
|
package/doc/changelog.md
ADDED
File without changes
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tivio/sdk-react",
|
3
|
-
"version": "2.4.
|
3
|
+
"version": "2.4.3-alpha2",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"typings": "dist/index.d.ts",
|
6
6
|
"source": "src/index.ts",
|
@@ -14,10 +14,9 @@
|
|
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
|
-
"check:cycles": "npx madge --circular src/**/*"
|
19
|
+
"check:cycles ": "npx madge --circular src/**/*"
|
21
20
|
},
|
22
21
|
"peerDependencies": {
|
23
22
|
"react": "^17.0.0",
|
@@ -33,10 +32,12 @@
|
|
33
32
|
"i18next": "^19.8.4",
|
34
33
|
"mobx-react": "^7.1.0",
|
35
34
|
"mobx": "^6.0.4",
|
35
|
+
"react-dom": "^17.0.2",
|
36
36
|
"react-i18next": "^9.0.10",
|
37
37
|
"react-router-dom": "^5.2.0",
|
38
38
|
"react-spring": "^9.2.4",
|
39
39
|
"react-virtualized": "^9.22.3",
|
40
|
+
"react": "^17.0.2",
|
40
41
|
"styled-components": "^5.2.1",
|
41
42
|
"yup": "^0.32.9"
|
42
43
|
},
|
@@ -70,8 +71,6 @@
|
|
70
71
|
"webpack": "^5.15.0",
|
71
72
|
"webpack-cli": "^4.4.0",
|
72
73
|
"webpack-merge": "^5.7.3",
|
73
|
-
"yargs": "17"
|
74
|
-
"react-dom": "^17.0.2",
|
75
|
-
"react": "^17.0.2"
|
74
|
+
"yargs": "17"
|
76
75
|
}
|
77
76
|
}
|
@@ -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, };
|