@applicaster/zapp-react-native-utils 13.0.0-rc.24 → 13.0.0-rc.26
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/HooksManager/Hook.ts +2 -2
- package/appUtils/HooksManager/types.ts +2 -2
- package/appUtils/contextKeysManager/contextResolver.ts +6 -2
- package/appUtils/focusManager/index.ts +0 -2
- package/appUtils/playerManager/player.ts +2 -2
- package/navigationUtils/index.ts +3 -3
- package/package.json +2 -2
- package/reactHooks/layout/useDimensions/helpers/__tests__/getInitialDimensions.test.js +1 -1
- package/reactHooks/usePluginConfiguration.ts +1 -1
- package/reactHooks/useSubscriberFor.ts +4 -3
- package/theme/index.ts +1 -1
- package/time/Timer.ts +4 -1
- package/zappFrameworkUtils/presentPluginOneTime.ts +2 -3
|
@@ -16,7 +16,7 @@ const BASE_HOOK_PROPERTIES = ["screen_id", "identifier", "weight"];
|
|
|
16
16
|
* @returns {number} index
|
|
17
17
|
*/
|
|
18
18
|
const hookState: (
|
|
19
|
-
arg0: typeof HOOKS_EVENTS[keyof typeof HOOKS_EVENTS]
|
|
19
|
+
arg0: (typeof HOOKS_EVENTS)[keyof typeof HOOKS_EVENTS]
|
|
20
20
|
) => number = R.indexOf(R.__, R.values(HOOKS_EVENTS));
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -62,7 +62,7 @@ export class Hook implements HookInterface {
|
|
|
62
62
|
* @param {Array<Any>} args variadic arguments to invoke the handler with
|
|
63
63
|
*/
|
|
64
64
|
setStateAndNotify(
|
|
65
|
-
event: typeof HOOKS_EVENTS[keyof typeof HOOKS_EVENTS],
|
|
65
|
+
event: (typeof HOOKS_EVENTS)[keyof typeof HOOKS_EVENTS],
|
|
66
66
|
...args
|
|
67
67
|
) {
|
|
68
68
|
this.state = hookState(event);
|
|
@@ -103,7 +103,7 @@ export interface Hook<T extends HookModule = HookModule> {
|
|
|
103
103
|
identifier: string;
|
|
104
104
|
configuration: T["configuration"];
|
|
105
105
|
setStateAndNotify(
|
|
106
|
-
event: typeof HOOKS_EVENTS[keyof typeof HOOKS_EVENTS],
|
|
106
|
+
event: (typeof HOOKS_EVENTS)[keyof typeof HOOKS_EVENTS],
|
|
107
107
|
opts: {
|
|
108
108
|
error?: typeof Error;
|
|
109
109
|
route?: string;
|
|
@@ -112,7 +112,7 @@ export interface Hook<T extends HookModule = HookModule> {
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
general?: {
|
|
115
|
-
transition_type: typeof HOOKS_EVENTS[keyof typeof HOOKS_EVENTS];
|
|
115
|
+
transition_type: (typeof HOOKS_EVENTS)[keyof typeof HOOKS_EVENTS];
|
|
116
116
|
allow_screen_plugin_presentation: boolean;
|
|
117
117
|
is_flow_blocker: boolean;
|
|
118
118
|
};
|
|
@@ -42,12 +42,16 @@ export const resolveObjectValues = async (
|
|
|
42
42
|
|
|
43
43
|
const resolvedEntries = await Promise.all(
|
|
44
44
|
entries.map(async ([key, value]) => {
|
|
45
|
-
const regex = /@{([^/]+)\/([^}]*)}/;
|
|
46
|
-
|
|
47
45
|
if (typeof value !== "string") {
|
|
48
46
|
return [key, value];
|
|
49
47
|
}
|
|
50
48
|
|
|
49
|
+
if (!value.startsWith("@")) {
|
|
50
|
+
return [key, value];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const regex = /@{([^/]+)\/([^}]*)}/;
|
|
54
|
+
|
|
51
55
|
const match = (value as string).match(regex);
|
|
52
56
|
|
|
53
57
|
if (match) {
|
|
@@ -154,8 +154,8 @@ export class Player {
|
|
|
154
154
|
this.isSeeking()
|
|
155
155
|
? this.playerState.seekPosition
|
|
156
156
|
: this.playerState.adState
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
? this.playerState.adState.adPosition
|
|
158
|
+
: this.playerState.contentPosition;
|
|
159
159
|
|
|
160
160
|
getEntry = (): ZappEntry | null => this.entry;
|
|
161
161
|
|
package/navigationUtils/index.ts
CHANGED
|
@@ -644,8 +644,8 @@ export const getScreenId = (
|
|
|
644
644
|
fallbackRiver: ZappRiver
|
|
645
645
|
) => {
|
|
646
646
|
return screenData?.targetScreen
|
|
647
|
-
? screenData?.targetScreen?.id ?? fallbackRiver.id
|
|
647
|
+
? (screenData?.targetScreen?.id ?? fallbackRiver.id)
|
|
648
648
|
: "screen_id" in screenData
|
|
649
|
-
|
|
650
|
-
|
|
649
|
+
? screenData.screen_id
|
|
650
|
+
: fallbackRiver.id;
|
|
651
651
|
};
|
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.26",
|
|
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": "13.0.0-rc.
|
|
31
|
+
"@applicaster/applicaster-types": "13.0.0-rc.26",
|
|
32
32
|
"buffer": "^5.2.1",
|
|
33
33
|
"camelize": "^1.0.0",
|
|
34
34
|
"create-react-context": "^0.2.3",
|
|
@@ -4,9 +4,10 @@ import { subscriber } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
|
4
4
|
const subscriberObjects = Object.create({});
|
|
5
5
|
|
|
6
6
|
interface UseSubscriberFor {
|
|
7
|
-
(
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
(
|
|
8
|
+
eventName: string,
|
|
9
|
+
handler?: (...args: unknown[]) => void
|
|
10
|
+
): (...args: unknown[]) => ReturnType<typeof subscriber>;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
/**
|
package/theme/index.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const ThemeContext = React.createContext({
|
|
|
14
14
|
export function useTheme<
|
|
15
15
|
T extends Record<string, any> =
|
|
16
16
|
| BaseThemePropertiesTV
|
|
17
|
-
| BaseThemePropertiesMobile
|
|
17
|
+
| BaseThemePropertiesMobile,
|
|
18
18
|
>(): T {
|
|
19
19
|
const { themes, selectedThemeId } = React.useContext(ThemeContext);
|
|
20
20
|
|
package/time/Timer.ts
CHANGED
|
@@ -3,7 +3,10 @@ export class Timer {
|
|
|
3
3
|
private remaining: number;
|
|
4
4
|
private timeoutId: NodeJS.Timeout | null;
|
|
5
5
|
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(
|
|
7
|
+
private callback: () => void,
|
|
8
|
+
private duration: number
|
|
9
|
+
) {
|
|
7
10
|
this.remaining = this.duration;
|
|
8
11
|
this.timeoutId = null;
|
|
9
12
|
}
|
|
@@ -92,9 +92,8 @@ export const PresentHookPluginOneTime = (
|
|
|
92
92
|
const presentOneTimeVersionName =
|
|
93
93
|
await getLatestWatchedVersionNumberFromStorage(storageKey, namespace);
|
|
94
94
|
|
|
95
|
-
const applicationVersionName =
|
|
96
|
-
versionNameKey
|
|
97
|
-
);
|
|
95
|
+
const applicationVersionName =
|
|
96
|
+
await sessionStorage.getItem(versionNameKey);
|
|
98
97
|
|
|
99
98
|
if (!presentOneTimeVersionName || !applicationVersionName) {
|
|
100
99
|
log_info(
|