@applicaster/zapp-react-native-utils 13.0.0-rc.93 → 13.0.0-rc.95
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/appUtils/playerManager/usePlayerTitleSummaryOverlay.tsx +7 -1
- package/manifestUtils/defaultManifestConfigurations/player.js +6 -0
- package/navigationUtils/__tests__/__snapshots__/navigationUtils.test.js.snap +1 -0
- package/navigationUtils/index.ts +3 -1
- package/package.json +2 -2
- package/playerUtils/configurationGenerator.ts +6 -0
- package/reactHooks/feed/useFeedLoader.tsx +13 -6
|
@@ -3,12 +3,18 @@ import { OverlaysObserver } from "./OverlayObserver/OverlaysObserver";
|
|
|
3
3
|
import { useFeedLoader } from "../../reactHooks";
|
|
4
4
|
import { usePlayer } from "./usePlayer";
|
|
5
5
|
|
|
6
|
+
const getLiveUrl = (url: string) => {
|
|
7
|
+
// Use the replace method with a regular expression to replace all instances of subClass with livePage
|
|
8
|
+
return url.replace(new RegExp("subClass", "g"), "livePage");
|
|
9
|
+
};
|
|
10
|
+
|
|
6
11
|
export const useTitleSummaryOverlay = (
|
|
7
|
-
feedUrl,
|
|
8
12
|
entry,
|
|
9
13
|
isLive = false,
|
|
10
14
|
interval: number
|
|
11
15
|
) => {
|
|
16
|
+
// TODO: Have generic place for live url from configuration. Currently its hardcoded for client.
|
|
17
|
+
const feedUrl = getLiveUrl(entry?.extensions?.live?.channel_src ?? "");
|
|
12
18
|
const player = usePlayer();
|
|
13
19
|
const [title, setTitle] = useState<string | number>(entry?.title || "");
|
|
14
20
|
const [summary, setSummary] = useState<string | number>(entry?.summary || "");
|
|
@@ -2555,6 +2555,12 @@ function getPlayerConfiguration({ platform }) {
|
|
|
2555
2555
|
multiple: false,
|
|
2556
2556
|
label_tooltip: "Choose the default aspect ratio for the artwork",
|
|
2557
2557
|
},
|
|
2558
|
+
{
|
|
2559
|
+
key: "audio_player_artwork_border_radius",
|
|
2560
|
+
label: "Audio Player Artwork Corner Radius",
|
|
2561
|
+
type: "number_input",
|
|
2562
|
+
initial_value: 16,
|
|
2563
|
+
},
|
|
2558
2564
|
]
|
|
2559
2565
|
)
|
|
2560
2566
|
);
|
package/navigationUtils/index.ts
CHANGED
|
@@ -111,6 +111,7 @@ export function getNavigationProps({
|
|
|
111
111
|
assets: ZappNavBarAssets;
|
|
112
112
|
rules: ZappNavBarRules;
|
|
113
113
|
nav_items: NavBarItem[];
|
|
114
|
+
data: MenuItemDataProperties;
|
|
114
115
|
} | null {
|
|
115
116
|
const { activeRiver } = navigator;
|
|
116
117
|
const { navigations, id: selected, home } = activeRiver; // use useRiver hook instead
|
|
@@ -124,7 +125,7 @@ export function getNavigationProps({
|
|
|
124
125
|
return null;
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
const { styles, assets, nav_items, rules } = navigation;
|
|
128
|
+
const { styles, assets, nav_items, rules, data } = navigation;
|
|
128
129
|
|
|
129
130
|
return {
|
|
130
131
|
selected,
|
|
@@ -134,6 +135,7 @@ export function getNavigationProps({
|
|
|
134
135
|
assets: assets as ZappNavBarAssets,
|
|
135
136
|
nav_items: nav_items as any as NavBarItem[],
|
|
136
137
|
rules: rules as any as ZappNavBarRules,
|
|
138
|
+
data: data as MenuItemDataProperties,
|
|
137
139
|
};
|
|
138
140
|
}
|
|
139
141
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-utils",
|
|
3
|
-
"version": "13.0.0-rc.
|
|
3
|
+
"version": "13.0.0-rc.95",
|
|
4
4
|
"description": "Applicaster Zapp React Native utilities package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@applicaster/applicaster-types": "13.0.0-rc.
|
|
30
|
+
"@applicaster/applicaster-types": "13.0.0-rc.95",
|
|
31
31
|
"buffer": "^5.2.1",
|
|
32
32
|
"camelize": "^1.0.0",
|
|
33
33
|
"dayjs": "^1.11.10",
|
|
@@ -2557,6 +2557,12 @@ function getPlayerConfiguration({ platform }) {
|
|
|
2557
2557
|
multiple: false,
|
|
2558
2558
|
label_tooltip: "Choose the default aspect ratio for the artwork",
|
|
2559
2559
|
},
|
|
2560
|
+
{
|
|
2561
|
+
key: "audio_player_artwork_border_radius",
|
|
2562
|
+
label: "Audio Player Artwork Corner Radius",
|
|
2563
|
+
type: "number_input",
|
|
2564
|
+
initial_value: 16,
|
|
2565
|
+
},
|
|
2560
2566
|
]
|
|
2561
2567
|
)
|
|
2562
2568
|
);
|
|
@@ -20,6 +20,7 @@ type Props = {
|
|
|
20
20
|
silentRefresh?: boolean;
|
|
21
21
|
method?: "get" | "post";
|
|
22
22
|
bodyParams?: Record<string, unknown>;
|
|
23
|
+
skipLoading?: boolean;
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
|
|
@@ -95,7 +96,7 @@ export const useFeedLoader = ({
|
|
|
95
96
|
if (
|
|
96
97
|
shouldDispatchData(callableFeedUrl, currentFeed, pipesOptions.clearCache)
|
|
97
98
|
) {
|
|
98
|
-
if (callableFeedUrl) {
|
|
99
|
+
if (callableFeedUrl && !pipesOptions.skipLoading) {
|
|
99
100
|
dispatch(
|
|
100
101
|
loadPipesData(callableFeedUrl, {
|
|
101
102
|
...pipesOptions,
|
|
@@ -103,26 +104,33 @@ export const useFeedLoader = ({
|
|
|
103
104
|
riverId,
|
|
104
105
|
})
|
|
105
106
|
);
|
|
106
|
-
} else {
|
|
107
|
+
} else if (!callableFeedUrl) {
|
|
107
108
|
logger.info({
|
|
108
109
|
message:
|
|
109
110
|
"Feed is not defined or not inflated, skipping loading. \nMake sure you have correct feedUrl and mapping.",
|
|
110
111
|
jsOnly: true,
|
|
111
112
|
});
|
|
113
|
+
} else {
|
|
114
|
+
logger.info({
|
|
115
|
+
message:
|
|
116
|
+
"Loading skipped as per pipesOptions.skipLoading configuration.",
|
|
117
|
+
data: { url: callableFeedUrl },
|
|
118
|
+
jsOnly: true,
|
|
119
|
+
});
|
|
112
120
|
}
|
|
113
121
|
} else {
|
|
114
122
|
logger.info({
|
|
115
123
|
message:
|
|
116
|
-
"Feed already
|
|
124
|
+
"Feed already exists, skipping loading. \nCall reloadData() if you want to refresh data.",
|
|
117
125
|
data: { url: callableFeedUrl },
|
|
118
126
|
jsOnly: true,
|
|
119
127
|
});
|
|
120
128
|
}
|
|
121
129
|
}, []);
|
|
122
130
|
|
|
123
|
-
// Reload feed when feedUrl changes
|
|
131
|
+
// Reload feed when feedUrl changes, unless skipLoading is true
|
|
124
132
|
useEffect(() => {
|
|
125
|
-
if (!isInitialRender && callableFeedUrl) {
|
|
133
|
+
if (!isInitialRender && callableFeedUrl && !pipesOptions.skipLoading) {
|
|
126
134
|
dispatch(loadPipesData(callableFeedUrl, { ...pipesOptions, riverId }));
|
|
127
135
|
}
|
|
128
136
|
}, [callableFeedUrl]);
|
|
@@ -158,7 +166,6 @@ export const useFeedLoader = ({
|
|
|
158
166
|
currentFeed?.data,
|
|
159
167
|
currentFeed?.error,
|
|
160
168
|
currentFeed?.loading,
|
|
161
|
-
|
|
162
169
|
reloadData,
|
|
163
170
|
loadNext,
|
|
164
171
|
]);
|