@applicaster/quick-brick-core 13.0.0-alpha.4936752427 → 13.0.0-alpha.5004843012
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.
|
@@ -68,8 +68,6 @@ import { useSubscriberFor } from "@applicaster/zapp-react-native-utils/reactHook
|
|
|
68
68
|
import { QBUIComponentEvents } from "@applicaster/zapp-react-native-ui-components/events";
|
|
69
69
|
import { Hook } from "@applicaster/zapp-react-native-utils/appUtils/HooksManager/Hook";
|
|
70
70
|
|
|
71
|
-
import { loadingOverlayManager } from "../LoadingOverlay";
|
|
72
|
-
|
|
73
71
|
const logger = coreAppLogger.addSubsystem("Navigator");
|
|
74
72
|
|
|
75
73
|
type Props = {
|
|
@@ -395,8 +393,6 @@ export function NavigationProvider({ children }: Props) {
|
|
|
395
393
|
} else {
|
|
396
394
|
dispatch(push(route, { entry: payload, screen: hookPlugin }));
|
|
397
395
|
}
|
|
398
|
-
|
|
399
|
-
closeLoadingOverlay();
|
|
400
396
|
};
|
|
401
397
|
|
|
402
398
|
const handleHookError = ({ error, hookPlugin, callback }, dispose) => {
|
|
@@ -415,8 +411,6 @@ export function NavigationProvider({ children }: Props) {
|
|
|
415
411
|
if (callback && typeof callback === "function") {
|
|
416
412
|
callback();
|
|
417
413
|
}
|
|
418
|
-
|
|
419
|
-
closeLoadingOverlay();
|
|
420
414
|
};
|
|
421
415
|
|
|
422
416
|
const handleHookCancel = ({ hookPlugin, callback }, dispose) => {
|
|
@@ -432,8 +426,6 @@ export function NavigationProvider({ children }: Props) {
|
|
|
432
426
|
} else {
|
|
433
427
|
goBack(true, true);
|
|
434
428
|
}
|
|
435
|
-
|
|
436
|
-
closeLoadingOverlay();
|
|
437
429
|
};
|
|
438
430
|
|
|
439
431
|
const handleHookSuccess = ({ hookPlugin, callback }) => {
|
|
@@ -444,10 +436,6 @@ export function NavigationProvider({ children }: Props) {
|
|
|
444
436
|
}
|
|
445
437
|
};
|
|
446
438
|
|
|
447
|
-
const handleBackgroundHook = () => {
|
|
448
|
-
openLoadingOverlay();
|
|
449
|
-
};
|
|
450
|
-
|
|
451
439
|
const checkStartUpHooks = React.useMemo(() => {
|
|
452
440
|
if (!pluginConfigurations) return false;
|
|
453
441
|
|
|
@@ -517,8 +505,6 @@ export function NavigationProvider({ children }: Props) {
|
|
|
517
505
|
);
|
|
518
506
|
|
|
519
507
|
callback?.();
|
|
520
|
-
|
|
521
|
-
closeLoadingOverlay();
|
|
522
508
|
};
|
|
523
509
|
|
|
524
510
|
const offlinePlugin = React.useMemo(() => {
|
|
@@ -633,7 +619,6 @@ export function NavigationProvider({ children }: Props) {
|
|
|
633
619
|
.on(HOOKS_EVENTS.ERROR, handleHookError)
|
|
634
620
|
.on(HOOKS_EVENTS.CANCEL, handleHookCancel)
|
|
635
621
|
.on(HOOKS_EVENTS.SUCCESS, handleHookSuccess)
|
|
636
|
-
.on(HOOKS_EVENTS.START_BACKGROUND_HOOK, handleBackgroundHook)
|
|
637
622
|
.on(
|
|
638
623
|
HOOKS_EVENTS.COMPLETE,
|
|
639
624
|
handleHookComplete(navigationAction, targetRoute, {
|
|
@@ -649,14 +634,6 @@ export function NavigationProvider({ children }: Props) {
|
|
|
649
634
|
},
|
|
650
635
|
});
|
|
651
636
|
|
|
652
|
-
const openLoadingOverlay = React.useCallback(() => {
|
|
653
|
-
isTV() && loadingOverlayManager.show();
|
|
654
|
-
}, []);
|
|
655
|
-
|
|
656
|
-
const closeLoadingOverlay = React.useCallback(() => {
|
|
657
|
-
loadingOverlayManager.hide();
|
|
658
|
-
}, []);
|
|
659
|
-
|
|
660
637
|
const openPiP = React.useCallback(() => {
|
|
661
638
|
dispatch(setVideoPiP());
|
|
662
639
|
}, []);
|
package/App/index.tsx
CHANGED
|
@@ -29,7 +29,6 @@ import { appRemoteDataLoader } from "./appRemoteDataLoader";
|
|
|
29
29
|
import { withActionExecutor } from "@applicaster/zapp-react-native-utils/actionsExecutor/ActionExecutorContext";
|
|
30
30
|
import { withScreenDataContextProvider } from "@applicaster/zapp-react-native-ui-components/Contexts/ScreenDataContext";
|
|
31
31
|
import { LogicAggregatorContainer } from "./LogicAggregatorContainer";
|
|
32
|
-
import { LoadingOverlay } from "./LoadingOverlay";
|
|
33
32
|
|
|
34
33
|
interface AppOptions {
|
|
35
34
|
Layout: React.ComponentType;
|
|
@@ -75,7 +74,6 @@ const App = ({
|
|
|
75
74
|
<LogicAggregatorContainer
|
|
76
75
|
components={[InteractionManager, ApplyScreenHooks]}
|
|
77
76
|
/>
|
|
78
|
-
<LoadingOverlay />
|
|
79
77
|
</ErrorBoundary>
|
|
80
78
|
</AppContainer>
|
|
81
79
|
</SafeAreaProvider>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-core",
|
|
3
|
-
"version": "13.0.0-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.5004843012",
|
|
4
4
|
"description": "Core package for Applicaster's Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@applicaster/applicaster-types": "13.0.0-alpha.
|
|
33
|
-
"@applicaster/quick-brick-core-plugins": "13.0.0-alpha.
|
|
34
|
-
"@applicaster/zapp-pipes-v2-client": "13.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.
|
|
38
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.
|
|
32
|
+
"@applicaster/applicaster-types": "13.0.0-alpha.5004843012",
|
|
33
|
+
"@applicaster/quick-brick-core-plugins": "13.0.0-alpha.5004843012",
|
|
34
|
+
"@applicaster/zapp-pipes-v2-client": "13.0.0-alpha.5004843012",
|
|
35
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.5004843012",
|
|
36
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.5004843012",
|
|
37
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.5004843012",
|
|
38
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.5004843012",
|
|
39
39
|
"atob": "^2.1.2",
|
|
40
40
|
"axios": "^0.28.0",
|
|
41
41
|
"btoa": "^1.2.1",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject } from "rxjs";
|
|
2
|
-
|
|
3
|
-
class LoadingOverlayManager {
|
|
4
|
-
visibilitySubject: BehaviorSubject<boolean>;
|
|
5
|
-
|
|
6
|
-
constructor() {
|
|
7
|
-
this.visibilitySubject = new BehaviorSubject(false);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
show() {
|
|
11
|
-
this.visibilitySubject.next(true);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
hide() {
|
|
15
|
-
this.visibilitySubject.next(false);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
onVisibilityStateChange(cb: (value: boolean) => void) {
|
|
19
|
-
return this.visibilitySubject.subscribe(cb);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
get visibility(): boolean {
|
|
23
|
-
return this.visibilitySubject.value;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const loadingOverlayManager = new LoadingOverlayManager();
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
|
|
4
|
-
import { Spinner } from "@applicaster/zapp-react-native-ui-components/Components/Spinner";
|
|
5
|
-
import { Spinner as CSSSpinner } from "@applicaster/zapp-react-dom-ui-components/Components/Spinner";
|
|
6
|
-
import { isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
7
|
-
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
8
|
-
|
|
9
|
-
import { useLoadingOverlayVisibility } from "./useLoadingOverlayVisibility";
|
|
10
|
-
|
|
11
|
-
export { loadingOverlayManager } from "./LoadingOverlayManager";
|
|
12
|
-
|
|
13
|
-
const styles = StyleSheet.create({
|
|
14
|
-
container: {
|
|
15
|
-
opacity: 0.5,
|
|
16
|
-
alignItems: "center",
|
|
17
|
-
justifyContent: "center",
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const SpinnerComponent = isWeb() ? CSSSpinner : Spinner;
|
|
22
|
-
|
|
23
|
-
export const LoadingOverlay = () => {
|
|
24
|
-
const visible = useLoadingOverlayVisibility();
|
|
25
|
-
const theme = useTheme();
|
|
26
|
-
|
|
27
|
-
const backgroundColor = React.useMemo(() => {
|
|
28
|
-
return theme?.app_background_color || "black";
|
|
29
|
-
}, [theme?.app_background_color]);
|
|
30
|
-
|
|
31
|
-
React.useEffect(() => {
|
|
32
|
-
if (visible) {
|
|
33
|
-
focusManager.disableFocus();
|
|
34
|
-
} else {
|
|
35
|
-
focusManager.enableFocus();
|
|
36
|
-
}
|
|
37
|
-
}, [visible]);
|
|
38
|
-
|
|
39
|
-
return visible ? (
|
|
40
|
-
<View
|
|
41
|
-
style={[StyleSheet.absoluteFill, styles.container, { backgroundColor }]}
|
|
42
|
-
>
|
|
43
|
-
<SpinnerComponent />
|
|
44
|
-
</View>
|
|
45
|
-
) : null;
|
|
46
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { loadingOverlayManager } from "./LoadingOverlayManager";
|
|
3
|
-
|
|
4
|
-
export const useLoadingOverlayVisibility = () => {
|
|
5
|
-
const [visible, setVisible] = React.useState(
|
|
6
|
-
loadingOverlayManager.visibility
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
React.useEffect(() => {
|
|
10
|
-
const listener = loadingOverlayManager.onVisibilityStateChange(setVisible);
|
|
11
|
-
|
|
12
|
-
return () => {
|
|
13
|
-
listener.unsubscribe();
|
|
14
|
-
};
|
|
15
|
-
}, []);
|
|
16
|
-
|
|
17
|
-
return visible;
|
|
18
|
-
};
|