@applicaster/quick-brick-core 12.0.0-alpha.4840257570 → 12.0.0-alpha.4885205607
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/App/NavigationProvider/NavigationProvider.tsx +24 -11
- package/App/NetworkStatusProvider/utils.ts +6 -4
- package/App/index.tsx +3 -1
- package/const/index.ts +4 -0
- package/createZappApp/__tests__/__snapshots__/createZappApp.test.js.snap +0 -1
- package/createZappApp/index.tsx +9 -2
- package/package.json +8 -8
|
@@ -414,9 +414,12 @@ export function NavigationProvider({ children }: Props) {
|
|
|
414
414
|
}
|
|
415
415
|
};
|
|
416
416
|
|
|
417
|
-
const handleHookCancel = ({ hookPlugin }, dispose) => {
|
|
418
|
-
|
|
419
|
-
|
|
417
|
+
const handleHookCancel = ({ hookPlugin, callback }, dispose) => {
|
|
418
|
+
dispose();
|
|
419
|
+
setStartUpHooks(false);
|
|
420
|
+
|
|
421
|
+
if (callback && typeof callback === "function") {
|
|
422
|
+
callback();
|
|
420
423
|
}
|
|
421
424
|
|
|
422
425
|
if (hookPlugin.isModalHook()) {
|
|
@@ -482,7 +485,13 @@ export function NavigationProvider({ children }: Props) {
|
|
|
482
485
|
return false;
|
|
483
486
|
}, [pluginConfigurations, plugins, rivers]);
|
|
484
487
|
|
|
485
|
-
const [startUpHooks,
|
|
488
|
+
const [startUpHooks, _setStartUpHooks] = React.useState(checkStartUpHooks);
|
|
489
|
+
const currentStartUpHooks = React.useRef(checkStartUpHooks);
|
|
490
|
+
|
|
491
|
+
const setStartUpHooks = (value) => {
|
|
492
|
+
_setStartUpHooks(value);
|
|
493
|
+
currentStartUpHooks.current = value;
|
|
494
|
+
};
|
|
486
495
|
|
|
487
496
|
const handleHookComplete =
|
|
488
497
|
(navigationAction, targetRoute, { screen, options }) =>
|
|
@@ -490,7 +499,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
490
499
|
if (hookPlugin?.lastHook) {
|
|
491
500
|
dispose({ disposeAll: true });
|
|
492
501
|
|
|
493
|
-
startUpHooks && setStartUpHooks(false);
|
|
502
|
+
startUpHooks.current && setStartUpHooks(false);
|
|
494
503
|
}
|
|
495
504
|
|
|
496
505
|
dispatch(
|
|
@@ -599,7 +608,10 @@ export function NavigationProvider({ children }: Props) {
|
|
|
599
608
|
targetScreen: screen,
|
|
600
609
|
rivers,
|
|
601
610
|
plugins,
|
|
602
|
-
startUpHooksData: {
|
|
611
|
+
startUpHooksData: {
|
|
612
|
+
startUpHooks: currentStartUpHooks.current,
|
|
613
|
+
setStartUpHooks,
|
|
614
|
+
},
|
|
603
615
|
};
|
|
604
616
|
|
|
605
617
|
HooksManager(hooksOptions)
|
|
@@ -672,15 +684,15 @@ export function NavigationProvider({ children }: Props) {
|
|
|
672
684
|
|
|
673
685
|
// It will only work for the regular stack and pathname, It won't work for modals
|
|
674
686
|
// TODO: integrate video/hook and regular modal into stack.
|
|
675
|
-
const getStackForPathname =
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
const stack = [...
|
|
687
|
+
const getStackForPathname = (
|
|
688
|
+
pathname: string
|
|
689
|
+
): NavigationScreenState | undefined => {
|
|
690
|
+
const stack = [...state?.stack?.mainStack];
|
|
679
691
|
|
|
680
692
|
const currentStack = stack.find(({ route }) => route === pathname);
|
|
681
693
|
|
|
682
694
|
return currentStack;
|
|
683
|
-
}
|
|
695
|
+
};
|
|
684
696
|
|
|
685
697
|
const navigator: QuickBrickAppNavigator = React.useMemo(
|
|
686
698
|
() => ({
|
|
@@ -724,6 +736,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
724
736
|
replaceTop,
|
|
725
737
|
getStack,
|
|
726
738
|
getStackForPathname,
|
|
739
|
+
mainStack: state.stack.mainStack,
|
|
727
740
|
}),
|
|
728
741
|
[rivers, plugins, JSON.stringify(state), appLaunched, startUpHooks]
|
|
729
742
|
);
|
|
@@ -3,9 +3,11 @@ import * as R from "ramda";
|
|
|
3
3
|
|
|
4
4
|
import { NetInfoState } from "@react-native-community/netinfo";
|
|
5
5
|
import { NETWORK_HOOKS_KEYS } from "./const";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
isVizioPlatform,
|
|
8
|
+
platformSelect,
|
|
9
|
+
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
7
10
|
import { Platform } from "react-native";
|
|
8
|
-
import { hasVizioAPIs } from "@applicaster/zapp-react-dom-app/App/Loader/utils/platform";
|
|
9
11
|
|
|
10
12
|
type ConnectionStatus = boolean;
|
|
11
13
|
type NetInfoNotReady = null;
|
|
@@ -208,7 +210,7 @@ export const subscribeToDeviceNetworkChanges = (callback: NetCb) => {
|
|
|
208
210
|
return;
|
|
209
211
|
}
|
|
210
212
|
|
|
211
|
-
if (
|
|
213
|
+
if (isVizioPlatform()) {
|
|
212
214
|
window.addEventListener("online", function () {
|
|
213
215
|
callback({ online: true });
|
|
214
216
|
});
|
|
@@ -231,7 +233,7 @@ export const unsubscribeToDeviceNetworkChanges = (id = registeredListener) => {
|
|
|
231
233
|
return;
|
|
232
234
|
}
|
|
233
235
|
|
|
234
|
-
if (
|
|
236
|
+
if (isVizioPlatform()) {
|
|
235
237
|
window.removeEventListener("online", function () {});
|
|
236
238
|
window.removeEventListener("offline", function () {});
|
|
237
239
|
}
|
package/App/index.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
3
|
import {
|
|
4
|
-
SafeAreaProvider,
|
|
5
4
|
initialWindowMetrics,
|
|
5
|
+
SafeAreaProvider,
|
|
6
6
|
} from "react-native-safe-area-context";
|
|
7
7
|
|
|
8
8
|
import { ErrorBoundary } from "./ErrorBoundary";
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
import { withURLSchemeContextProvider } from "./DeepLinking/URLSchemeListener/URLSchemeContextProvider";
|
|
28
28
|
import { appRemoteDataLoader } from "./appRemoteDataLoader";
|
|
29
29
|
import { withActionExecutor } from "@applicaster/zapp-react-native-utils/actionsExecutor/ActionExecutorContext";
|
|
30
|
+
import { withScreenDataContextProvider } from "@applicaster/zapp-react-native-ui-components/Contexts/ScreenDataContext";
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* @typedef {Object} AppOptions
|
|
@@ -99,6 +100,7 @@ export function createQuickBrickApp(options): ZappApp {
|
|
|
99
100
|
withURLSchemeContextProvider,
|
|
100
101
|
withNetworkStatusProvider,
|
|
101
102
|
withNavigationProvider,
|
|
103
|
+
withScreenDataContextProvider,
|
|
102
104
|
ZappPipesSearchContext.withProvider,
|
|
103
105
|
InteractionManager,
|
|
104
106
|
withActionExecutor,
|
package/const/index.ts
CHANGED
package/createZappApp/index.tsx
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import * as R from "ramda";
|
|
9
9
|
import { Dimensions } from "react-native";
|
|
10
|
+
import {
|
|
11
|
+
isNotEmpty,
|
|
12
|
+
isNotNil,
|
|
13
|
+
} from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
|
|
10
14
|
|
|
11
15
|
import {
|
|
12
16
|
createZappReduxStore,
|
|
@@ -27,6 +31,9 @@ import { remoteDataLoader } from "../App/appRemoteDataLoader/remoteDataLoader";
|
|
|
27
31
|
import * as QuickBrickManager from "@applicaster/zapp-react-native-bridge/QuickBrick";
|
|
28
32
|
import { isAndroidPlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
29
33
|
|
|
34
|
+
const isNotEmptyObject = (value: unknown) =>
|
|
35
|
+
isNotNil(value) && R.is(Object, value) && isNotEmpty(value);
|
|
36
|
+
|
|
30
37
|
/**
|
|
31
38
|
* Creates a Zapp App with the provided options
|
|
32
39
|
* @export
|
|
@@ -55,8 +62,8 @@ export function createZappApp(zappAppConfig: ZappAppConfig) {
|
|
|
55
62
|
|
|
56
63
|
const useTabletLayout =
|
|
57
64
|
isTablet({ width, height }, width > height ? "landscape" : "portrait") &&
|
|
58
|
-
tabletLayout &&
|
|
59
|
-
tabletCellStyles;
|
|
65
|
+
isNotEmptyObject(tabletLayout) &&
|
|
66
|
+
isNotEmptyObject(tabletCellStyles);
|
|
60
67
|
|
|
61
68
|
function fetchPluginConfiguration(plugin) {
|
|
62
69
|
const configuration = R.compose(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-core",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.4885205607",
|
|
4
4
|
"description": "Core package for Applicaster's Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@applicaster/applicaster-types": "12.0.0-alpha.
|
|
34
|
-
"@applicaster/quick-brick-core-plugins": "12.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-pipes-v2-client": "12.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.
|
|
38
|
-
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.
|
|
39
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
33
|
+
"@applicaster/applicaster-types": "12.0.0-alpha.4885205607",
|
|
34
|
+
"@applicaster/quick-brick-core-plugins": "12.0.0-alpha.4885205607",
|
|
35
|
+
"@applicaster/zapp-pipes-v2-client": "12.0.0-alpha.4885205607",
|
|
36
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.4885205607",
|
|
37
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.4885205607",
|
|
38
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.4885205607",
|
|
39
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.4885205607",
|
|
40
40
|
"atob": "^2.1.2",
|
|
41
41
|
"axios": "^0.28.0",
|
|
42
42
|
"btoa": "^1.2.1",
|