@applicaster/zapp-react-native-ui-components 13.0.0-alpha.3003916059 → 13.0.0-alpha.3013095924

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.
@@ -32,7 +32,7 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
32
32
 
33
33
  const { isRTL, backgroundColor, backgroundImage } = config;
34
34
 
35
- const backgroundImageSource = { uri: backgroundImage };
35
+ const backgroundImg = { uri: backgroundImage };
36
36
 
37
37
  const backgroundColorStyle = backgroundImage
38
38
  ? "transparent"
@@ -103,8 +103,9 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
103
103
  justifyContent: "center",
104
104
  },
105
105
  android_tv: {
106
- width: "100%",
107
- height: "100%",
106
+ position: "absolute",
107
+ width: 1920,
108
+ height: 1080,
108
109
  alignItems: "center",
109
110
  justifyContent: "center",
110
111
  },
@@ -145,9 +146,9 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
145
146
  },
146
147
  });
147
148
 
148
- const audioPlayerLayoutTV = backgroundImageSource?.uri ? (
149
+ const audioPlayerLayoutTV = backgroundImg?.uri ? (
149
150
  <ImageBackground
150
- source={backgroundImageSource}
151
+ source={backgroundImg}
151
152
  style={backgroundImgStyles}
152
153
  resizeMode="cover"
153
154
  >
@@ -177,7 +178,7 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
177
178
  ]}
178
179
  >
179
180
  <ImageBackground
180
- source={backgroundImageSource}
181
+ source={backgroundImg}
181
182
  style={backgroundImgStyles}
182
183
  resizeMode="cover"
183
184
  >
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef } from "react";
2
- import { View, ScrollView } from "react-native";
2
+ import { View, ScrollView, Platform } from "react-native";
3
3
  import { Button } from "./Button";
4
4
  import { ItemIconProps } from "./Button/ItemIcon";
5
5
  import { ItemProps } from "./Button/Item";
@@ -9,7 +9,7 @@ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
9
9
 
10
10
  import type { PluginConfiguration } from "./";
11
11
 
12
- import { ModalHeader as DefaultModalHeader } from "./Header";
12
+ import { ModalHeader } from "./Header";
13
13
  import { useSafeAreaInsets } from "react-native-safe-area-context";
14
14
 
15
15
  type ModalComponentProps = {
@@ -22,7 +22,6 @@ type ModalComponentProps = {
22
22
  title?: string;
23
23
  maxHeight?: number;
24
24
  dismiss: () => void;
25
- headerComponent?: React.ComponentType;
26
25
  buttonComponent?: React.ComponentType;
27
26
  iconProps?: ItemIconProps | ((theme: PluginConfiguration) => ItemIconProps);
28
27
  itemProps?:
@@ -49,11 +48,9 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
49
48
  dismiss,
50
49
  summary,
51
50
  title,
52
- headerComponent: ModalHeader = DefaultModalHeader,
53
51
  buttonComponent: ButtonComponent = Button,
54
- getSelectedItemIcon = ({
55
- modal_bottom_sheet_item_selected_icon,
56
- }: BaseThemePropertiesMobile) => modal_bottom_sheet_item_selected_icon,
52
+ getSelectedItemIcon = (theme) =>
53
+ theme.modal_bottom_sheet_item_selected_icon,
57
54
  getDefaultItemIcon = () => null,
58
55
  iconPlacement,
59
56
  } = props;
@@ -106,27 +103,26 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
106
103
  />
107
104
  <ScrollView
108
105
  contentContainerStyle={{
109
- paddingBottom: paddingBottom + bottomInset,
106
+ paddingBottom:
107
+ paddingBottom + (Platform.OS === "ios" ? bottomInset : 0),
110
108
  }}
111
109
  >
112
- {items.map((item, index) =>
113
- item ? (
114
- <ButtonComponent
115
- key={index}
116
- configuration={theme}
117
- selectedItem={current_selection}
118
- item={item}
119
- onPress={handlePress}
120
- label={theme[item?.label] ?? item?.label}
121
- iconBaseProps={iconBaseProps}
122
- itemBaseProps={itemBaseProps}
123
- labelBaseProps={labelBaseProps}
124
- selectedItemIcon={getSelectedItemIcon(theme)}
125
- defaultItemIcon={getDefaultItemIcon(theme)}
126
- iconPlacement={iconPlacement}
127
- />
128
- ) : null
129
- )}
110
+ {items.map((item, index) => (
111
+ <ButtonComponent
112
+ key={index}
113
+ configuration={theme}
114
+ selectedItem={current_selection}
115
+ item={item}
116
+ onPress={handlePress}
117
+ label={theme[item?.label] ?? item?.label}
118
+ iconBaseProps={iconBaseProps}
119
+ itemBaseProps={itemBaseProps}
120
+ labelBaseProps={labelBaseProps}
121
+ selectedItemIcon={getSelectedItemIcon(theme)}
122
+ defaultItemIcon={getDefaultItemIcon(theme)}
123
+ iconPlacement={iconPlacement}
124
+ />
125
+ ))}
130
126
  </ScrollView>
131
127
  </View>
132
128
  );
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import * as R from "ramda";
3
- import { View, StyleSheet, FlatList } from "react-native";
3
+ import { View, StyleSheet, Platform, FlatList } from "react-native";
4
4
  import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
5
5
  import { RiverItem } from "../RiverItem";
6
6
  import { RiverFooter } from "../RiverFooter";
@@ -24,10 +24,6 @@ import { withComponentsMapProvider } from "@applicaster/zapp-react-native-ui-com
24
24
  import { useScreenContextV2 } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
25
25
  import { useShallow } from "zustand/react/shallow";
26
26
 
27
- import { isAndroidPlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
28
-
29
- const isAndroid = isAndroidPlatform();
30
-
31
27
  type Props = {
32
28
  feed: ZappFeed;
33
29
  groupId?: string;
@@ -277,12 +273,12 @@ function ComponentsMapComponent(props: Props) {
277
273
  }}
278
274
  // Fix for WebView rerender crashes on Android API 28+
279
275
  // https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-964035468
280
- overScrollMode={isAndroid ? "never" : "auto"}
276
+ overScrollMode={Platform.OS === "android" ? "never" : "auto"}
281
277
  scrollIndicatorInsets={scrollIndicatorInsets}
282
278
  extraData={feed}
283
279
  stickyHeaderIndices={stickyHeaderIndices}
284
280
  onLayout={handleOnLayout}
285
- removeClippedSubviews={isAndroid}
281
+ removeClippedSubviews
286
282
  initialNumToRender={3}
287
283
  maxToRenderPerBatch={10}
288
284
  windowSize={12}
@@ -303,10 +299,6 @@ function ComponentsMapComponent(props: Props) {
303
299
  onMomentumScrollEnd={_onMomentumScrollEnd}
304
300
  onScrollEndDrag={_onScrollEndDrag}
305
301
  scrollEventThrottle={16}
306
- maintainVisibleContentPosition={{
307
- minIndexForVisible: 0,
308
- autoscrollToTopThreshold: 10,
309
- }}
310
302
  {...scrollViewExtraProps}
311
303
  />
312
304
  </ViewportTracker>
@@ -48,20 +48,16 @@ const useLoadingState = (
48
48
  loadingState: RiverItemType["loadingState"]
49
49
  ) => {
50
50
  const [readyToBeDisplayed, setReadyToBeDisplayed] = React.useState(
51
- loadingState.getValue().index + 1 >= currentIndex
51
+ loadingState.getValue().index + 1 === currentIndex
52
52
  );
53
53
 
54
54
  useEffect(() => {
55
55
  const subscription = loadingState.subscribe(({ index }) => {
56
- if (index + 1 >= currentIndex) {
56
+ if (index + 1 === currentIndex) {
57
57
  setReadyToBeDisplayed(true);
58
58
  }
59
59
  });
60
60
 
61
- if (loadingState.getValue().index + 1 >= currentIndex) {
62
- setReadyToBeDisplayed(true);
63
- }
64
-
65
61
  return () => {
66
62
  subscription.unsubscribe();
67
63
  };
@@ -135,12 +135,6 @@ exports[`componentsMap renders renders components map correctly 1`] = `
135
135
  getItemCount={[Function]}
136
136
  initialNumToRender={3}
137
137
  keyExtractor={[Function]}
138
- maintainVisibleContentPosition={
139
- {
140
- "autoscrollToTopThreshold": 10,
141
- "minIndexForVisible": 0,
142
- }
143
- }
144
138
  maxToRenderPerBatch={10}
145
139
  onContentSizeChange={[Function]}
146
140
  onLayout={[Function]}
@@ -151,7 +145,7 @@ exports[`componentsMap renders renders components map correctly 1`] = `
151
145
  onScrollEndDrag={[Function]}
152
146
  overScrollMode="auto"
153
147
  refreshControl={null}
154
- removeClippedSubviews={false}
148
+ removeClippedSubviews={true}
155
149
  renderItem={[Function]}
156
150
  scrollEventThrottle={16}
157
151
  scrollIndicatorInsets={
@@ -17,7 +17,6 @@ export enum PlayerAnimationStateEnum {
17
17
  maximize = "maximize",
18
18
  drag_player = "drag_player",
19
19
  drag_scroll = "drag_scroll",
20
- appear_as_docked = "appear_as_docked",
21
20
  }
22
21
 
23
22
  export type PlayerAnimationStateT = number | PlayerAnimationStateEnum | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "13.0.0-alpha.3003916059",
3
+ "version": "13.0.0-alpha.3013095924",
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",
@@ -31,10 +31,10 @@
31
31
  "redux-mock-store": "^1.5.3"
32
32
  },
33
33
  "dependencies": {
34
- "@applicaster/applicaster-types": "13.0.0-alpha.3003916059",
35
- "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.3003916059",
36
- "@applicaster/zapp-react-native-redux": "13.0.0-alpha.3003916059",
37
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.3003916059",
34
+ "@applicaster/applicaster-types": "13.0.0-alpha.3013095924",
35
+ "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.3013095924",
36
+ "@applicaster/zapp-react-native-redux": "13.0.0-alpha.3013095924",
37
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.3013095924",
38
38
  "promise": "^8.3.0",
39
39
  "react-router-native": "^5.1.2",
40
40
  "url": "^0.11.0",