@tivio/sdk-react 2.0.1 → 2.1.1-alpha1

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -2,17 +2,33 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
- v2.0.0
6
- - major: video.channelId can now be `string | null` used to be `string`
7
- - minor: added data API and hooks for screens (screens, rows of screen and row items)
8
- - hooks: `useScreen()`, `useItemsInRow()`
9
- - api: `TivioBundle.subscriptions.subscribeToScreen`, `TivioBundle.subscriptions. subscribeToItemsInRow`
10
- v1.3.6
11
- - ?
12
- v1.3.5
13
- - minor: added WebPlayer props (canReplay, showMarkers, customShortcuts, enableKeyboardShortcuts, source.poster)
14
- v1.3.4
15
- - ...
5
+ * Unreleased
6
+ * v2.1.1
7
+ * patch: TivioWidget now correctly reports `false` via `onEnabled` callback when in invalid internal state
8
+ * v2.1.0
9
+ * patch: fix of useItemsInRow hook
10
+ * patch: fix of useScreen hook
11
+ * add: useRowsInScreen hook
12
+ * v2.0.3
13
+ * patch: fix of useItemsInRow hook
14
+ * v2.0.2
15
+ * patch: screen and row IDs fixed
16
+ * `TivioBundle.subscriptions.subscribeToItemsInRow` now accepts user-defined ID via studio.tiv.io
17
+ * `TivioBundle.subscriptions.subscribeToScreen` now accepts user-defined ID via studio.tiv.io
18
+ * `Screen` and `Row` types returned by `useScreen()` return their user-defined IDs (`.id`) correctly
19
+ * v2.0.1
20
+ * no changes
21
+ * v2.0.0
22
+ * major: video.channelId can now be `string | null` used to be `string`
23
+ * minor: added data API and hooks for screens (screens, rows of screen and row items)
24
+ * hooks: `useScreen()`, `useItemsInRow()`
25
+ * api: `TivioBundle.subscriptions.subscribeToScreen`, `TivioBundle.subscriptions.subscribeToItemsInRow`
26
+ * v1.3.6
27
+ * ?
28
+ * v1.3.5
29
+ * minor: added WebPlayer props (canReplay, showMarkers, customShortcuts, enableKeyboardShortcuts, source.poster)
30
+ * v1.3.4
31
+ * ...
16
32
 
17
33
  ## Installation
18
34
 
@@ -289,7 +305,7 @@ Gets array of Video or Tag objects for a specified row. It is possible to use
289
305
  ```ts
290
306
  /**
291
307
  * Hook to fetch row items for rows received from `useScreen()`
292
- * @param id - row ID
308
+ * @param id - row ID configured via studio.tiv.io
293
309
  * @param [limit] - row items count, defaults to 10
294
310
  */
295
311
  useItemsInRow: (id: string, limit?: number) => {
@@ -1,6 +1,6 @@
1
+ import type { Tag, Video } from '@tivio/common';
1
2
  import React from 'react';
2
3
  import type { DataState } from './types';
3
- import type { Tag, Video } from '@tivio/common';
4
4
  declare type Item = Video | Tag;
5
5
  declare const RowItemsContext: React.Context<DataState<Item> | null>;
6
6
  declare const RowItemsContextProvider: React.FC;
@@ -62,26 +62,7 @@ declare const useChannelsInWidget: (widgetId: string, limit?: number) => {
62
62
  data: import("../context/types").PaginationData<Channel> | null;
63
63
  isLoading: boolean;
64
64
  };
65
- /**
66
- * Use app screen
67
- * @param id - screen ID
68
- */
69
- declare const useScreen: (id: string) => {
70
- error: Error | null;
71
- data: import("@tivio/common/dist/types").Screen | null;
72
- isLoading: boolean;
73
- };
74
- /**
75
- * Use row items
76
- * @param id - row ID
77
- * @param [limit] - row items count, defaults to 10
78
- */
79
- declare const useItemsInRow: (id: string, limit?: number | undefined) => {
80
- error: Error | null;
81
- data: import("../context/types").PaginationData<Video | import("@tivio/common/dist/types").Tag> | null;
82
- isLoading: boolean;
83
- };
84
65
  declare const useIsLoaded: () => {
85
66
  isTivioLoaded: boolean;
86
67
  };
87
- export { useWidget, useChannel, useIsLoaded, useItemsInRow, useScreen, useSection, useVideo, useVideosInSection, useSectionsInChannel, useChannelsInWidget, VideosContext, SectionsContext, ChannelsContext, };
68
+ export { useWidget, useChannel, useIsLoaded, useSection, useVideo, useVideosInSection, useSectionsInChannel, useChannelsInWidget, VideosContext, SectionsContext, ChannelsContext, };
@@ -1,4 +1,7 @@
1
1
  export * from './useUser';
2
+ export * from './useScreens';
3
+ export * from './useScreen';
4
+ export * from './useItemsInRow';
2
5
  export * from './useTransactionPayment';
3
6
  export * from './usePurchaseSubscription';
4
7
  export * from './contentHooks';
@@ -6,3 +9,4 @@ export * from './playerHooks';
6
9
  export * from './useOrganizationSubscriptions';
7
10
  export * from './usePurchasesWithVideos';
8
11
  export * from './useFreePurchase';
12
+ export * from './useRowsInScreen';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Hook for displaying errors in UI components
3
+ */
4
+ declare const useError: () => {
5
+ error: Error | null;
6
+ raiseError: (error: Error) => void;
7
+ resetError: () => void;
8
+ };
9
+ export { useError, };
@@ -0,0 +1,11 @@
1
+ import { PaginationOptions, PaginationInterface, Video, Tag } from '@tivio/common';
2
+ /**
3
+ * Use row items
4
+ * @param rowId - row ID
5
+ * @param options - subscription options
6
+ */
7
+ declare const useItemsInRow: (rowId: string, options?: PaginationOptions) => {
8
+ pagination: PaginationInterface<Video | Tag> | null;
9
+ error: Error | null;
10
+ };
11
+ export { useItemsInRow, };
@@ -0,0 +1,6 @@
1
+ import { PaginationInterface, PaginationOptions, Row } from '@tivio/common';
2
+ declare const useRowsInScreen: (screenId: string, options?: PaginationOptions) => {
3
+ pagination: PaginationInterface<Row> | null;
4
+ error: Error | null;
5
+ };
6
+ export { useRowsInScreen, };
@@ -0,0 +1,12 @@
1
+ import { ScreenOptions } from '@tivio/common';
2
+ /**
3
+ * Use app screen
4
+ * @param screenId - screen ID
5
+ * @param options - subscribe to screen options
6
+ */
7
+ declare const useScreen: (screenId: string, options?: ScreenOptions | undefined) => {
8
+ error: Error | null;
9
+ data: import("@tivio/common").Screen | null;
10
+ isLoading: boolean;
11
+ };
12
+ export { useScreen, };
@@ -0,0 +1,5 @@
1
+ import { Screen } from '@tivio/common';
2
+ declare const useScreens: () => {
3
+ screens: Screen[];
4
+ };
5
+ export { useScreens, };