@applicaster/zapp-react-native-ui-components 13.0.0-rc.92 → 13.0.0-rc.93

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.
@@ -23,6 +23,8 @@ type Props = {
23
23
  focused?: boolean;
24
24
  };
25
25
 
26
+ const addPrefix = (id: string) => `focusable-cell-wrapper-${id}`;
27
+
26
28
  export function CellWithFocusable(props: Props) {
27
29
  const {
28
30
  index,
@@ -81,7 +83,7 @@ export function CellWithFocusable(props: Props) {
81
83
 
82
84
  return (
83
85
  <FocusableGroup
84
- id={`focusable-cell-wrapper-${id}`}
86
+ id={addPrefix(id)}
85
87
  testID={"cell-with-focusable-cell-renderer-focusable-group"}
86
88
  groupId={groupId}
87
89
  preferredFocus={preferredFocus}
@@ -94,7 +96,7 @@ export function CellWithFocusable(props: Props) {
94
96
  <CellRenderer
95
97
  testID={"cell-with-focusable-cell-renderer"}
96
98
  item={item}
97
- groupId={`focusable-cell-wrapper-${id}`}
99
+ groupId={addPrefix(id)}
98
100
  onToggleFocus={handleToggleFocus}
99
101
  state={state}
100
102
  prefixId={id}
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { View, ViewStyle } from "react-native";
3
+ import { isTvOSPlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
4
+
5
+ const isTvOS = isTvOSPlatform();
6
+
7
+ type Props = {
8
+ style: ViewStyle;
9
+ children: React.ReactNode;
10
+ };
11
+
12
+ export const CellWrapper = ({ style, children }: Props) => {
13
+ if (isTvOS) {
14
+ return <View style={style}>{children}</View>;
15
+ }
16
+
17
+ return <>{children}</>;
18
+ };
@@ -0,0 +1,3 @@
1
+ export const PREFIX = "tv_buttons";
2
+
3
+ export const BUTTON_PREFIX = `${PREFIX}_button`;
@@ -1,4 +1,4 @@
1
- import * as R from "ramda";
1
+ import { times } from "@applicaster/zapp-react-native-utils/utils";
2
2
  import { toNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
3
3
 
4
4
  import { Button } from "./Button";
@@ -9,13 +9,14 @@ import {
9
9
  } from "./utils";
10
10
 
11
11
  import { compact } from "@applicaster/zapp-react-native-utils/cellUtils";
12
+ import { PREFIX, BUTTON_PREFIX } from "./const";
12
13
 
13
14
  export {
14
15
  insertButtonsBetweenLabels,
15
16
  insertButtonsBetweenLabelContainers,
16
17
  } from "./utils";
17
18
 
18
- const PREFIX = "tv_buttons";
19
+ const buttonId = (index: number) => `${BUTTON_PREFIX}_${index}`;
19
20
 
20
21
  type Props = {
21
22
  value: Function;
@@ -42,7 +43,6 @@ export const TvActionButtons = ({
42
43
  return null;
43
44
  }
44
45
 
45
- const prefix1Button = `${PREFIX}_button_1`;
46
46
  const independentStyles = value(`${PREFIX}_container_independent_styles`);
47
47
 
48
48
  return {
@@ -73,11 +73,11 @@ export const TvActionButtons = ({
73
73
  buttonsCount,
74
74
  },
75
75
  elements: compact(
76
- R.times((index) => {
77
- const prefixSpecificButton = `${PREFIX}_button_${index + 1}`;
76
+ times((index) => {
77
+ const prefixSpecificButton = buttonId(index + 1);
78
78
 
79
79
  return Button({
80
- prefix: independentStyles ? prefixSpecificButton : prefix1Button,
80
+ prefix: independentStyles ? prefixSpecificButton : buttonId(1),
81
81
  value,
82
82
  platformValue,
83
83
  pluginIdentifier: getPluginIdentifier(configuration, PREFIX, index),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "13.0.0-rc.92",
3
+ "version": "13.0.0-rc.93",
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-rc.92",
35
- "@applicaster/zapp-react-native-bridge": "13.0.0-rc.92",
36
- "@applicaster/zapp-react-native-redux": "13.0.0-rc.92",
37
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.92",
34
+ "@applicaster/applicaster-types": "13.0.0-rc.93",
35
+ "@applicaster/zapp-react-native-bridge": "13.0.0-rc.93",
36
+ "@applicaster/zapp-react-native-redux": "13.0.0-rc.93",
37
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.93",
38
38
  "promise": "^8.3.0",
39
39
  "react-router-native": "^5.1.2",
40
40
  "url": "^0.11.0",
@@ -1,5 +0,0 @@
1
- import { isTvOSPlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
2
- import React from "react";
3
- import { View } from "react-native";
4
-
5
- export const CellWrapper = isTvOSPlatform() ? View : React.Fragment;