@applicaster/zapp-react-native-utils 12.0.0-alpha.7257632022 → 12.0.0-alpha.9004455836
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.
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { appStore } from "@applicaster/zapp-react-native-redux/AppStore";
|
|
2
2
|
import { findPluginByIdentifier } from "@applicaster/zapp-react-native-utils/pluginUtils";
|
|
3
3
|
import { Player } from "./player";
|
|
4
|
+
import { PlayerRole } from "./conts";
|
|
4
5
|
|
|
5
6
|
type PlayerFactoryItem = {
|
|
6
7
|
Component: any;
|
|
7
8
|
controller: Player;
|
|
8
9
|
};
|
|
9
10
|
|
|
11
|
+
type PlayerFactoryProps = {
|
|
12
|
+
player: any,
|
|
13
|
+
playerId: string,
|
|
14
|
+
autoplay: boolean,
|
|
15
|
+
entry: ZappEntry,
|
|
16
|
+
muted: boolean,
|
|
17
|
+
playerPluginId: string,
|
|
18
|
+
screenConfig: Record<string, any>,
|
|
19
|
+
playerRole: PlayerRole,
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
interface PlayerConstructor {
|
|
11
23
|
new (params: any): Player;
|
|
12
24
|
}
|
|
13
25
|
|
|
14
|
-
export const playerFactory = (config:
|
|
26
|
+
export const playerFactory = (config: PlayerFactoryProps): PlayerFactoryItem | null => {
|
|
15
27
|
const IDENTIFIER = config?.playerPluginId;
|
|
16
28
|
|
|
17
29
|
if (!IDENTIFIER) {
|
package/cellUtils/index.ts
CHANGED
|
@@ -343,6 +343,19 @@ export const ifElseFocused = R.curry(
|
|
|
343
343
|
state === "focused" ? focusedValue : defaultValue
|
|
344
344
|
);
|
|
345
345
|
|
|
346
|
+
export const ifElseSelected = R.curry(
|
|
347
|
+
(state: string, selectedValue, defaultValue) => {
|
|
348
|
+
switch (state) {
|
|
349
|
+
case "selected":
|
|
350
|
+
return selectedValue;
|
|
351
|
+
case "focused_selected":
|
|
352
|
+
return selectedValue;
|
|
353
|
+
default:
|
|
354
|
+
return defaultValue;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
);
|
|
358
|
+
|
|
346
359
|
/**
|
|
347
360
|
* Map textAlign values to their corresponding alignSelf values
|
|
348
361
|
* This is so that we could use the same field for both properties
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-utils",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.9004455836",
|
|
4
4
|
"description": "Applicaster Zapp React Native utilities package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "12.0.0-alpha.
|
|
31
|
+
"@applicaster/applicaster-types": "12.0.0-alpha.9004455836",
|
|
32
32
|
"buffer": "^5.2.1",
|
|
33
33
|
"camelize": "^1.0.0",
|
|
34
34
|
"create-react-context": "^0.2.3",
|
package/pluginUtils/index.ts
CHANGED
|
@@ -68,11 +68,13 @@ export function findComponentByType({
|
|
|
68
68
|
* Returns the plugin for a given identifier, if found
|
|
69
69
|
* @param identifier of the plugin to look for
|
|
70
70
|
* @param plugins map of the available plugins
|
|
71
|
+
* @param doNotWarn if set to true, will not log a warning if plugin is not found
|
|
71
72
|
* @return whole plugin if found, undefined otherwise
|
|
72
73
|
*/
|
|
73
74
|
export function findPluginByIdentifier(
|
|
74
75
|
identifier: string,
|
|
75
|
-
plugins: (QuickBrickPlugin | ZappPlugin | Plugin)[]
|
|
76
|
+
plugins: (QuickBrickPlugin | ZappPlugin | Plugin)[],
|
|
77
|
+
doNotWarn: boolean = false
|
|
76
78
|
): (QuickBrickPlugin | ZappPlugin | Plugin) | undefined {
|
|
77
79
|
if (!identifier) {
|
|
78
80
|
return undefined;
|
|
@@ -84,10 +86,12 @@ export function findPluginByIdentifier(
|
|
|
84
86
|
)(plugins);
|
|
85
87
|
|
|
86
88
|
if (!plugin && identifier !== "river" && identifier !== "hooks") {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
if (!doNotWarn) {
|
|
90
|
+
pluginUtilsLogger.warning({
|
|
91
|
+
message: `Could not find plugin for identifier ${identifier}`,
|
|
92
|
+
data: { identifier },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
return plugin;
|
|
@@ -2,9 +2,6 @@ import * as R from "ramda";
|
|
|
2
2
|
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
3
3
|
import { useMemoizedIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks/device";
|
|
4
4
|
|
|
5
|
-
import { LogBox } from "react-native";
|
|
6
|
-
LogBox.ignoreAllLogs();
|
|
7
|
-
|
|
8
5
|
import { useMobileOrientationEffect } from "./useMobileOrientationEffect";
|
|
9
6
|
import { noop } from "./utils";
|
|
10
7
|
|