@applicaster/zapp-react-native-ui-components 14.0.0-rc.9 → 15.0.0-rc.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.
- package/Components/AnimatedInOut/index.tsx +5 -3
- package/Components/AudioPlayer/index.tsx +15 -0
- package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
- package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -2
- package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/mobile/index.tsx +18 -0
- package/Components/AudioPlayer/{Artwork.tsx → tv/Artwork.tsx} +3 -2
- package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +7 -7
- package/Components/AudioPlayer/tv/Layout.tsx +168 -0
- package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +7 -1
- package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +6 -2
- package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +6 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +2 -2
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +164 -0
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +19 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
- package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +11 -5
- package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +17 -58
- package/Components/AudioPlayer/types.ts +40 -0
- package/Components/BaseFocusable/index.tsx +23 -12
- package/Components/Cell/Cell.tsx +91 -64
- package/Components/Cell/CellWithFocusable.tsx +3 -0
- package/Components/Cell/__tests__/CellWIthFocusable.test.js +3 -2
- package/Components/Cell/index.js +7 -3
- package/Components/ComponentResolver/index.ts +1 -1
- package/Components/FeedLoader/FeedLoader.tsx +7 -16
- package/Components/FeedLoader/FeedLoaderHOC.tsx +21 -0
- package/Components/FeedLoader/index.js +2 -8
- package/Components/Focusable/Focusable.tsx +12 -3
- package/Components/Focusable/FocusableTvOS.tsx +5 -5
- package/Components/Focusable/FocusableiOS.tsx +2 -2
- package/Components/Focusable/Touchable.tsx +5 -3
- package/Components/Focusable/__tests__/index.android.test.tsx +3 -0
- package/Components/Focusable/index.android.tsx +19 -11
- package/Components/Focusable/index.tsx +1 -1
- package/Components/FocusableGroup/FocusableTvOS.tsx +1 -1
- package/Components/FocusableList/FocusableItem.tsx +4 -3
- package/Components/FocusableList/FocusableListItemWrapper.tsx +2 -1
- package/Components/FocusableList/hooks/useCellState.android.ts +13 -3
- package/Components/FocusableList/index.tsx +20 -9
- package/Components/FreezeWithCallback/__tests__/index.test.tsx +67 -43
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +42 -59
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +13 -10
- package/Components/HandlePlayable/HandlePlayable.tsx +25 -9
- package/Components/HookRenderer/HookRenderer.tsx +5 -1
- package/Components/Layout/TV/LayoutBackground.tsx +1 -1
- package/Components/Layout/TV/__tests__/index.test.tsx +0 -1
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +6 -2
- package/Components/MasterCell/DefaultComponents/Button.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -39
- package/Components/MasterCell/DefaultComponents/Image/hoc/withDimensions.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/SecondaryImage/Image.tsx +65 -17
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/Image.test.tsx +21 -3
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +6 -3
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +26 -6
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +10 -10
- package/Components/MasterCell/DefaultComponents/__tests__/text.test.tsx +18 -18
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/index.test.tsx +10 -10
- package/Components/MasterCell/elementMapper.tsx +1 -2
- package/Components/MasterCell/index.tsx +1 -1
- package/Components/MasterCell/utils/behaviorProvider.ts +82 -14
- package/Components/MasterCell/utils/index.ts +11 -5
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +13 -18
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +9 -0
- package/Components/OfflineHandler/__tests__/index.test.tsx +26 -35
- package/Components/PlayerContainer/ErrorDisplay/index.ts +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +46 -33
- package/Components/PlayerContainer/ProgramInfo/index.tsx +1 -1
- package/Components/PlayerContainer/index.ts +1 -1
- package/Components/PlayerImageBackground/index.tsx +1 -1
- package/Components/River/ComponentsMap/ComponentsMap.tsx +0 -1
- package/Components/River/ComponentsMap/hooks/__tests__/useLoadingState.test.ts +378 -0
- package/Components/River/ComponentsMap/hooks/useLoadingState.ts +2 -2
- package/Components/River/RefreshControl.tsx +11 -17
- package/Components/River/RiverItem.tsx +3 -0
- package/Components/River/TV/River.tsx +2 -17
- package/Components/River/TV/index.tsx +3 -1
- package/Components/River/TV/withPipesV1DataLoader.tsx +43 -0
- package/Components/River/TV/withRiverDataLoader.tsx +17 -0
- package/Components/River/TV/withTVEventHandler.tsx +1 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +2 -0
- package/Components/River/__tests__/river.test.js +12 -26
- package/Components/River/index.tsx +1 -1
- package/Components/Screen/__tests__/Screen.test.tsx +28 -29
- package/Components/Screen/__tests__/navigationHandler.test.ts +133 -22
- package/Components/Screen/navigationHandler.ts +20 -2
- package/Components/ScreenResolver/index.tsx +15 -0
- package/Components/ScreenRevealManager/ScreenRevealManager.ts +76 -0
- package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +107 -0
- package/Components/ScreenRevealManager/__tests__/withScreenRevealManager.test.tsx +96 -0
- package/Components/ScreenRevealManager/index.ts +1 -0
- package/Components/ScreenRevealManager/withScreenRevealManager.tsx +79 -0
- package/Components/Tabs/TV/Tabs.android.tsx +1 -3
- package/Components/Tabs/Tabs.tsx +2 -3
- package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +13 -0
- package/Components/TextInputTv/index.tsx +11 -0
- package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +34 -0
- package/Components/Touchable/__tests__/touchable.test.tsx +12 -17
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +15 -9
- package/Components/VideoLive/animationUtils.ts +3 -3
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +3 -9
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.web.tsx +294 -0
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.web.tsx +93 -0
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +73 -29
- package/Components/VideoModal/PlayerDetails.tsx +24 -2
- package/Components/VideoModal/PlayerWrapper.tsx +26 -142
- package/Components/VideoModal/VideoModal.tsx +3 -17
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -5
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +1 -7
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +44 -240
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +9 -1
- package/Components/VideoModal/hooks/index.ts +0 -2
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +40 -15
- package/Components/VideoModal/hooks/useModalSize.ts +18 -2
- package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +2 -2
- package/Components/VideoModal/hooks/utils/index.ts +4 -0
- package/Components/VideoModal/utils.ts +6 -0
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -16
- package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +84 -24
- package/Components/Viewport/VisibilitySensor/VisibilitySensor.tsx +3 -3
- package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/index.ts +3 -3
- package/Contexts/CellFocusedStateContext/index.tsx +27 -0
- package/Contexts/ConfigutaionContext/__tests__/ConfigurationProvider.test.tsx +3 -3
- package/Contexts/ScreenContext/index.tsx +46 -6
- package/Decorators/ConfigurationWrapper/__tests__/withConfigurationProvider.test.tsx +3 -3
- package/Decorators/ConfigurationWrapper/withConfigurationProvider.tsx +2 -2
- package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +221 -209
- package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +14 -16
- package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -20
- package/Decorators/RiverFeedLoader/index.tsx +22 -4
- package/Decorators/RiverFeedLoader/utils/index.ts +0 -18
- package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +3 -6
- package/Decorators/ZappPipesDataConnector/ResolverSelector.tsx +25 -0
- package/Decorators/ZappPipesDataConnector/__tests__/NullFeedResolver.test.tsx +78 -0
- package/Decorators/ZappPipesDataConnector/__tests__/ResolverSelector.test.tsx +205 -0
- package/Decorators/ZappPipesDataConnector/__tests__/StaticFeedResolver.test.tsx +251 -0
- package/Decorators/ZappPipesDataConnector/__tests__/UrlFeedResolver.test.tsx +368 -0
- package/Decorators/ZappPipesDataConnector/__tests__/utils.test.ts +39 -0
- package/Decorators/ZappPipesDataConnector/index.tsx +26 -293
- package/Decorators/ZappPipesDataConnector/resolvers/NullFeedResolver.tsx +25 -0
- package/Decorators/ZappPipesDataConnector/resolvers/StaticFeedResolver.tsx +87 -0
- package/Decorators/ZappPipesDataConnector/resolvers/UrlFeedResolver.tsx +266 -0
- package/Decorators/ZappPipesDataConnector/types.ts +29 -0
- package/Decorators/ZappPipesDataConnector/utils/mongoFilter.ts +738 -0
- package/Decorators/ZappPipesDataConnector/utils/useFilter.tsx +157 -0
- package/events/index.ts +3 -0
- package/package.json +5 -10
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +0 -202
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -66
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +0 -28
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
- package/Components/AudioPlayer/index.ts +0 -1
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +0 -27
- package/Components/VideoModal/hooks/useBackgroundColor.ts +0 -10
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import React, { useCallback, useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
import { filterObjects } from "./mongoFilter";
|
|
4
|
+
import { getNamespaceAndKey } from "@applicaster/zapp-react-native-utils/appUtils/contextKeysManager/utils";
|
|
5
|
+
import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
|
|
6
|
+
import { sessionStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/SessionStorage";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
extractAtValues,
|
|
10
|
+
resolveObjectValues,
|
|
11
|
+
} from "@applicaster/zapp-react-native-utils/appUtils/contextKeysManager/contextResolver";
|
|
12
|
+
import { createLogger } from "@applicaster/zapp-react-native-utils/logger";
|
|
13
|
+
import { ScreenSingleValueProvider } from "@applicaster/zapp-react-native-utils/storage/ScreenSingleValueProvider";
|
|
14
|
+
import { useScreenStateStore } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useScreenStateStore";
|
|
15
|
+
import { useRoute } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
16
|
+
import { useScreenResolvers } from "@applicaster/zapp-react-native-utils/actionsExecutor/screenResolver";
|
|
17
|
+
|
|
18
|
+
const { log_debug, log_error } = createLogger({
|
|
19
|
+
subsystem: "General",
|
|
20
|
+
category: "UseFilter",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const useFilter: (
|
|
24
|
+
zappPipesData: ZappPipesData,
|
|
25
|
+
_component // In future filter will come from the component
|
|
26
|
+
) => (zappPipesData: ZappPipesData) => ZappPipesData = (
|
|
27
|
+
zappPipesData: ZappPipesData,
|
|
28
|
+
_component
|
|
29
|
+
) => {
|
|
30
|
+
const { pathname } = useRoute();
|
|
31
|
+
const screenStateStore = useScreenStateStore();
|
|
32
|
+
const [filter, setFilter] = React.useState(null);
|
|
33
|
+
const [inflatedFilter, setInflatedFilter] = React.useState(null);
|
|
34
|
+
const screenResolvers = useScreenResolvers();
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!filter) {
|
|
38
|
+
setInflatedFilter(null);
|
|
39
|
+
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const atValues = extractAtValues(filter);
|
|
44
|
+
|
|
45
|
+
log_debug("Extracted @ values from filter", { atValues });
|
|
46
|
+
|
|
47
|
+
if (!atValues.length) {
|
|
48
|
+
// no dynamic values - can apply right now
|
|
49
|
+
setInflatedFilter(filter);
|
|
50
|
+
} else {
|
|
51
|
+
const rebuildFilter = () =>
|
|
52
|
+
resolveObjectValues(filter, screenResolvers)
|
|
53
|
+
.then((resolvedFilter) => {
|
|
54
|
+
log_debug("Resolved filter values", { resolvedFilter });
|
|
55
|
+
setInflatedFilter(resolvedFilter);
|
|
56
|
+
})
|
|
57
|
+
.catch((error) => {
|
|
58
|
+
log_error(`Error resolving filter values: ${error.message}`);
|
|
59
|
+
setInflatedFilter(null);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
rebuildFilter(); // have dynamic values - need to resolve before applying
|
|
63
|
+
|
|
64
|
+
// subscribe for future changes of dynamic values
|
|
65
|
+
const screenSubscriptions: (() => void)[] = atValues
|
|
66
|
+
.filter((data) => data.startsWith("screen/"))
|
|
67
|
+
.map((data: string) => {
|
|
68
|
+
const keyName = data.replace("screen/", "");
|
|
69
|
+
|
|
70
|
+
const provider = ScreenSingleValueProvider.getProvider(
|
|
71
|
+
keyName,
|
|
72
|
+
pathname,
|
|
73
|
+
screenStateStore
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const subscription = provider.getObservable().subscribe((value) => {
|
|
77
|
+
if (value !== undefined) {
|
|
78
|
+
rebuildFilter();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return () => subscription.unsubscribe();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const storageSubscriptions: (() => void)[] = atValues
|
|
86
|
+
.filter((data) => !data.startsWith("screen/"))
|
|
87
|
+
.flatMap((data: string) => {
|
|
88
|
+
const keyName = data.replace("ctx/", "");
|
|
89
|
+
const { namespace, key } = getNamespaceAndKey(keyName);
|
|
90
|
+
|
|
91
|
+
return [
|
|
92
|
+
localStorage.addListener({ key, namespace }, rebuildFilter),
|
|
93
|
+
sessionStorage.addListener({ key, namespace }, rebuildFilter),
|
|
94
|
+
];
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const subscriptions = [...screenSubscriptions, ...storageSubscriptions];
|
|
98
|
+
|
|
99
|
+
return () => subscriptions.forEach((listener) => listener());
|
|
100
|
+
}
|
|
101
|
+
}, [filter]);
|
|
102
|
+
|
|
103
|
+
const filterFunc = useCallback(
|
|
104
|
+
(zappPipesData: ZappPipesData) => {
|
|
105
|
+
const { data } = zappPipesData;
|
|
106
|
+
|
|
107
|
+
if (!data || !data.entry) {
|
|
108
|
+
return zappPipesData;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const noResultBehavior =
|
|
112
|
+
data?.extensions?.filter?.no_result_behavior || "show_nothing";
|
|
113
|
+
|
|
114
|
+
const filterExpression = data?.extensions?.filter?.expression;
|
|
115
|
+
|
|
116
|
+
if (filterExpression) {
|
|
117
|
+
setFilter(filterExpression);
|
|
118
|
+
|
|
119
|
+
// if there is a filter, but it is not inflated yet,
|
|
120
|
+
// and the behavior is "show_nothing" - return no results
|
|
121
|
+
if (noResultBehavior === "show_nothing" && !inflatedFilter) {
|
|
122
|
+
return {
|
|
123
|
+
...zappPipesData,
|
|
124
|
+
data: { ...data, entry: [] },
|
|
125
|
+
} as ZappPipesData;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (!inflatedFilter) {
|
|
130
|
+
return zappPipesData;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
log_debug("Applying filter to data", { filter, inflatedFilter });
|
|
134
|
+
|
|
135
|
+
const filteredEntries = filterObjects(data.entry, inflatedFilter);
|
|
136
|
+
|
|
137
|
+
if (!filteredEntries.length && noResultBehavior === "show_all") {
|
|
138
|
+
return zappPipesData;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return {
|
|
142
|
+
...zappPipesData,
|
|
143
|
+
data: {
|
|
144
|
+
...data,
|
|
145
|
+
entry: filteredEntries,
|
|
146
|
+
},
|
|
147
|
+
} as ZappPipesData;
|
|
148
|
+
},
|
|
149
|
+
[inflatedFilter, setFilter]
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
if (!zappPipesData || !zappPipesData.data) {
|
|
153
|
+
return (zappPipesData) => zappPipesData;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return filterFunc;
|
|
157
|
+
};
|
package/events/index.ts
CHANGED
|
@@ -2,4 +2,7 @@ export enum QBUIComponentEvents {
|
|
|
2
2
|
toggleGradient = "toggleGradient",
|
|
3
3
|
topMenuBarTV_onFocus = "topMenuBarTV_onFocus",
|
|
4
4
|
navigatorReplaceItem = "navigatorReplaceItem",
|
|
5
|
+
scrollVerticallyToInitialOffset = "scrollVerticallyToInitialOffset",
|
|
6
|
+
focusOnSelectedTab = "focusOnSelectedTab",
|
|
7
|
+
focusOnSelectedTopMenuItem = "focusOnSelectedTopMenuItem",
|
|
5
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0-rc.1",
|
|
4
4
|
"description": "Applicaster Zapp React Native ui components for the Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -27,14 +27,11 @@
|
|
|
27
27
|
"url": "https://github.com/applicaster/quickbrick/issues"
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"redux-mock-store": "^1.5.3"
|
|
32
|
-
},
|
|
33
30
|
"dependencies": {
|
|
34
|
-
"@applicaster/applicaster-types": "
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "
|
|
31
|
+
"@applicaster/applicaster-types": "15.0.0-rc.1",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.1",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "15.0.0-rc.1",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "15.0.0-rc.1",
|
|
38
35
|
"promise": "^8.3.0",
|
|
39
36
|
"url": "^0.11.0",
|
|
40
37
|
"uuid": "^3.3.2"
|
|
@@ -42,10 +39,8 @@
|
|
|
42
39
|
"peerDependencies": {
|
|
43
40
|
"@applicaster/zapp-pipes-v2-client": "*",
|
|
44
41
|
"@react-native-community/netinfo": "*",
|
|
45
|
-
"immer": "*",
|
|
46
42
|
"react": "*",
|
|
47
43
|
"react-native": "*",
|
|
48
|
-
"react-native-safe-area-context": "*",
|
|
49
44
|
"react-native-svg": "*",
|
|
50
45
|
"uglify-js": "*",
|
|
51
46
|
"validate-color": "*",
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from "react";
|
|
2
|
-
import { View, ImageBackground, Animated, ViewStyle } from "react-native";
|
|
3
|
-
|
|
4
|
-
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
5
|
-
|
|
6
|
-
import { Artwork } from "./Artwork";
|
|
7
|
-
import { directionStyles } from "./helpers";
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
artwork?: string;
|
|
11
|
-
config: {
|
|
12
|
-
titleColor: string;
|
|
13
|
-
summaryColor: string;
|
|
14
|
-
backgroundColor: string;
|
|
15
|
-
backgroundImage: string;
|
|
16
|
-
isRTL: boolean;
|
|
17
|
-
artworkBorderRadius: Option<number>;
|
|
18
|
-
};
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
style: ViewStyle;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
|
|
24
|
-
const fadeAnimation = useRef(new Animated.Value(0)).current;
|
|
25
|
-
|
|
26
|
-
const fadeAudioPlayerIn = () => {
|
|
27
|
-
Animated.timing(fadeAnimation, {
|
|
28
|
-
toValue: 1,
|
|
29
|
-
duration: 3000,
|
|
30
|
-
useNativeDriver: true,
|
|
31
|
-
}).start();
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const { isRTL, backgroundColor, backgroundImage } = config;
|
|
35
|
-
|
|
36
|
-
const backgroundImageSource = { uri: backgroundImage };
|
|
37
|
-
|
|
38
|
-
const backgroundColorStyle = backgroundImage
|
|
39
|
-
? "transparent"
|
|
40
|
-
: backgroundColor;
|
|
41
|
-
|
|
42
|
-
const mainContainerStyles = platformSelect({
|
|
43
|
-
tvos: {
|
|
44
|
-
width: "100%",
|
|
45
|
-
height: "100%",
|
|
46
|
-
alignItems: "center",
|
|
47
|
-
justifyContent: "center",
|
|
48
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
49
|
-
backgroundColor: backgroundColorStyle,
|
|
50
|
-
},
|
|
51
|
-
android_tv: {
|
|
52
|
-
width: "100%",
|
|
53
|
-
height: "100%",
|
|
54
|
-
alignItems: "center",
|
|
55
|
-
justifyContent: "center",
|
|
56
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
57
|
-
backgroundColor: backgroundColorStyle,
|
|
58
|
-
},
|
|
59
|
-
web: {
|
|
60
|
-
width: 1920,
|
|
61
|
-
height: 1080,
|
|
62
|
-
alignItems: "center",
|
|
63
|
-
justifyContent: "center",
|
|
64
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
65
|
-
backgroundColor: backgroundColorStyle,
|
|
66
|
-
},
|
|
67
|
-
native: {
|
|
68
|
-
backgroundColor: backgroundColorStyle,
|
|
69
|
-
overflow: "hidden",
|
|
70
|
-
...style,
|
|
71
|
-
},
|
|
72
|
-
samsung_tv: {
|
|
73
|
-
position: "absolute",
|
|
74
|
-
margin: "auto",
|
|
75
|
-
display: "flex",
|
|
76
|
-
flexWrap: "wrap",
|
|
77
|
-
width: "100vw",
|
|
78
|
-
flex: 1,
|
|
79
|
-
alignItems: "center",
|
|
80
|
-
justifyContent: "center",
|
|
81
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
82
|
-
backgroundColor: backgroundColorStyle,
|
|
83
|
-
},
|
|
84
|
-
lg_tv: {
|
|
85
|
-
position: "absolute",
|
|
86
|
-
margin: "auto",
|
|
87
|
-
display: "flex",
|
|
88
|
-
flexWrap: "wrap",
|
|
89
|
-
width: "100vw",
|
|
90
|
-
flex: 1,
|
|
91
|
-
alignItems: "center",
|
|
92
|
-
justifyContent: "center",
|
|
93
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
94
|
-
backgroundColor: backgroundColorStyle,
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const backgroundImgStyles = platformSelect({
|
|
99
|
-
tvos: {
|
|
100
|
-
width: "100%",
|
|
101
|
-
height: "100%",
|
|
102
|
-
alignItems: "center",
|
|
103
|
-
justifyContent: "center",
|
|
104
|
-
},
|
|
105
|
-
android_tv: {
|
|
106
|
-
width: "100%",
|
|
107
|
-
height: "100%",
|
|
108
|
-
alignItems: "center",
|
|
109
|
-
justifyContent: "center",
|
|
110
|
-
},
|
|
111
|
-
web: {
|
|
112
|
-
position: "absolute",
|
|
113
|
-
margin: "auto",
|
|
114
|
-
display: "flex",
|
|
115
|
-
flexWrap: "wrap",
|
|
116
|
-
width: "100%",
|
|
117
|
-
height: "100%",
|
|
118
|
-
flex: 1,
|
|
119
|
-
alignItems: "center",
|
|
120
|
-
justifyContent: "center",
|
|
121
|
-
},
|
|
122
|
-
native: {
|
|
123
|
-
flex: 1,
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const textContainerStyles = platformSelect({
|
|
128
|
-
tvos: {
|
|
129
|
-
width: 600,
|
|
130
|
-
height: 362,
|
|
131
|
-
marginHorizontal: 24,
|
|
132
|
-
alignItems: directionStyles(isRTL).justifyContent,
|
|
133
|
-
},
|
|
134
|
-
android_tv: {
|
|
135
|
-
width: 600,
|
|
136
|
-
height: 362,
|
|
137
|
-
marginHorizontal: 24,
|
|
138
|
-
alignItems: directionStyles(isRTL).justifyContent,
|
|
139
|
-
},
|
|
140
|
-
web: {
|
|
141
|
-
margin: 10,
|
|
142
|
-
height: "100vh",
|
|
143
|
-
alignItems: directionStyles(isRTL).justifyContent,
|
|
144
|
-
justifyContent: "center",
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
const audioPlayerLayoutTV = backgroundImageSource?.uri ? (
|
|
149
|
-
<ImageBackground
|
|
150
|
-
source={backgroundImageSource}
|
|
151
|
-
style={backgroundImgStyles}
|
|
152
|
-
resizeMode="cover"
|
|
153
|
-
>
|
|
154
|
-
<View style={mainContainerStyles}>
|
|
155
|
-
{!!artwork && <Artwork srcImage={artwork} config={config} />}
|
|
156
|
-
<View style={textContainerStyles}>{children}</View>
|
|
157
|
-
</View>
|
|
158
|
-
</ImageBackground>
|
|
159
|
-
) : (
|
|
160
|
-
<View style={mainContainerStyles}>
|
|
161
|
-
{!!artwork && <Artwork srcImage={artwork} config={config} />}
|
|
162
|
-
<View style={textContainerStyles}>{children}</View>
|
|
163
|
-
</View>
|
|
164
|
-
);
|
|
165
|
-
|
|
166
|
-
const audioPlayerLayoutMobile = () => {
|
|
167
|
-
fadeAudioPlayerIn();
|
|
168
|
-
|
|
169
|
-
return (
|
|
170
|
-
<View style={mainContainerStyles} pointerEvents="none">
|
|
171
|
-
<Animated.View
|
|
172
|
-
style={[
|
|
173
|
-
mainContainerStyles,
|
|
174
|
-
{
|
|
175
|
-
opacity: fadeAnimation,
|
|
176
|
-
},
|
|
177
|
-
]}
|
|
178
|
-
>
|
|
179
|
-
<ImageBackground
|
|
180
|
-
source={backgroundImageSource}
|
|
181
|
-
style={backgroundImgStyles}
|
|
182
|
-
resizeMode="cover"
|
|
183
|
-
>
|
|
184
|
-
<View style={mainContainerStyles} />
|
|
185
|
-
</ImageBackground>
|
|
186
|
-
</Animated.View>
|
|
187
|
-
</View>
|
|
188
|
-
);
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const audioPlayerLayout = platformSelect({
|
|
192
|
-
tvos: audioPlayerLayoutTV,
|
|
193
|
-
android_tv: audioPlayerLayoutTV,
|
|
194
|
-
web: audioPlayerLayoutTV,
|
|
195
|
-
samsung_tv: audioPlayerLayoutTV,
|
|
196
|
-
lg_tv: audioPlayerLayoutTV,
|
|
197
|
-
ios: audioPlayerLayoutMobile(),
|
|
198
|
-
android: audioPlayerLayoutMobile(),
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
return audioPlayerLayout;
|
|
202
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<AudioPlayerLayout /> renders correctly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
pointerEvents="none"
|
|
6
|
-
style={
|
|
7
|
-
{
|
|
8
|
-
"backgroundColor": "transparent",
|
|
9
|
-
"overflow": "hidden",
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
>
|
|
13
|
-
<View
|
|
14
|
-
collapsable={false}
|
|
15
|
-
style={
|
|
16
|
-
{
|
|
17
|
-
"backgroundColor": "transparent",
|
|
18
|
-
"opacity": 0,
|
|
19
|
-
"overflow": "hidden",
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
>
|
|
23
|
-
<View
|
|
24
|
-
accessibilityIgnoresInvertColors={true}
|
|
25
|
-
style={
|
|
26
|
-
{
|
|
27
|
-
"flex": 1,
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
>
|
|
31
|
-
<Image
|
|
32
|
-
resizeMode="cover"
|
|
33
|
-
source={
|
|
34
|
-
{
|
|
35
|
-
"uri": "https://example.com",
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
style={
|
|
39
|
-
[
|
|
40
|
-
{
|
|
41
|
-
"bottom": 0,
|
|
42
|
-
"left": 0,
|
|
43
|
-
"position": "absolute",
|
|
44
|
-
"right": 0,
|
|
45
|
-
"top": 0,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"height": undefined,
|
|
49
|
-
"width": undefined,
|
|
50
|
-
},
|
|
51
|
-
undefined,
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
/>
|
|
55
|
-
<View
|
|
56
|
-
style={
|
|
57
|
-
{
|
|
58
|
-
"backgroundColor": "transparent",
|
|
59
|
-
"overflow": "hidden",
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/>
|
|
63
|
-
</View>
|
|
64
|
-
</View>
|
|
65
|
-
</View>
|
|
66
|
-
`;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<Channel /> renders correctly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
style={
|
|
6
|
-
{
|
|
7
|
-
"height": 72,
|
|
8
|
-
"marginBottom": 30,
|
|
9
|
-
"width": 128,
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
>
|
|
13
|
-
<Image
|
|
14
|
-
fadeDuration={0}
|
|
15
|
-
source={
|
|
16
|
-
{
|
|
17
|
-
"uri": "https://example.com",
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
style={
|
|
21
|
-
{
|
|
22
|
-
"height": 72,
|
|
23
|
-
"width": 128,
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/>
|
|
27
|
-
</View>
|
|
28
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@testing-library/react-native";
|
|
3
|
-
|
|
4
|
-
import { AudioPlayerLayout } from "../AudioPlayerLayout";
|
|
5
|
-
|
|
6
|
-
const audioPlayerLayoutProps = {
|
|
7
|
-
artwork: "string",
|
|
8
|
-
config: {
|
|
9
|
-
titleColor: "white",
|
|
10
|
-
summaryColor: "white",
|
|
11
|
-
backgroundColor: "black",
|
|
12
|
-
backgroundImage: "https://example.com",
|
|
13
|
-
isRTL: true,
|
|
14
|
-
},
|
|
15
|
-
children: [],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
describe("<AudioPlayerLayout />", () => {
|
|
19
|
-
it("renders correctly", () => {
|
|
20
|
-
const { toJSON } = render(
|
|
21
|
-
<AudioPlayerLayout {...audioPlayerLayoutProps} />
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
expect(toJSON()).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AudioPlayer } from "./AudioPlayer";
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`When River has a general_content type renders River component correctly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
onLayout={[Function]}
|
|
6
|
-
style={
|
|
7
|
-
{
|
|
8
|
-
"flex": 1,
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
testID="on-layout-view"
|
|
12
|
-
>
|
|
13
|
-
<View
|
|
14
|
-
style={
|
|
15
|
-
{
|
|
16
|
-
"display": "none",
|
|
17
|
-
"flex": 1,
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
>
|
|
21
|
-
<View
|
|
22
|
-
screenId="A1234"
|
|
23
|
-
testID="general-content-screen"
|
|
24
|
-
/>
|
|
25
|
-
</View>
|
|
26
|
-
</View>
|
|
27
|
-
`;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
2
|
-
import { useConfiguration } from "../utils";
|
|
3
|
-
|
|
4
|
-
export const useBackgroundColor = (): string => {
|
|
5
|
-
const { modal_background_color: modalBackgroundColor } = useConfiguration();
|
|
6
|
-
|
|
7
|
-
const theme = useTheme<BaseThemePropertiesMobile>();
|
|
8
|
-
|
|
9
|
-
return modalBackgroundColor || theme?.status_background_color;
|
|
10
|
-
};
|
|
File without changes
|
/package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|