@applicaster/quick-brick-core 13.0.0-alpha.6234681660 → 13.0.0-alpha.6400875052
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/ModalProvider/ModalBottomSheet/Overlay.tsx +5 -7
- package/App/ModalProvider/index.tsx +2 -2
- package/App/NavigationProvider/NavigationProvider.tsx +18 -43
- package/package.json +8 -8
- package/App/ModalProvider/ModalChildrenWrapper/index.web.ts +0 -1
- /package/App/ModalProvider/ModalChildrenWrapper/{index.ios.ts → index.ts} +0 -0
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { StyleSheet, TouchableOpacity, Easing, View } from "react-native";
|
|
3
3
|
|
|
4
4
|
import { AnimatedInOut } from "@applicaster/zapp-react-native-ui-components/Components/AnimatedInOut";
|
|
5
|
-
import {
|
|
5
|
+
import { dismissModal } from "@applicaster/zapp-react-native-utils/modalState";
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
8
8
|
overlayColor: string;
|
|
@@ -35,21 +35,19 @@ const fadeInAnimation = {
|
|
|
35
35
|
delay,
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const animationConfig =
|
|
38
|
+
const animationConfig = {
|
|
39
39
|
in: fadeInAnimation,
|
|
40
40
|
out: {
|
|
41
41
|
...fadeInAnimation,
|
|
42
|
-
onAnimationEnd,
|
|
42
|
+
onAnimationEnd: dismissModal,
|
|
43
43
|
},
|
|
44
|
-
}
|
|
44
|
+
};
|
|
45
45
|
|
|
46
46
|
export function Overlay(props: Props) {
|
|
47
|
-
const navigator = useNavigation();
|
|
48
|
-
|
|
49
47
|
return (
|
|
50
48
|
<AnimatedInOut
|
|
51
49
|
visible={props.visible}
|
|
52
|
-
animationConfig={animationConfig
|
|
50
|
+
animationConfig={animationConfig}
|
|
53
51
|
staticStyles={styles.container}
|
|
54
52
|
>
|
|
55
53
|
<TouchableOpacity
|
|
@@ -6,10 +6,10 @@ import { ModalChildrenWrapper } from "./ModalChildrenWrapper";
|
|
|
6
6
|
import { PathnameContext } from "@applicaster/zapp-react-native-ui-components/Contexts/PathnameContext";
|
|
7
7
|
import { ScreenContextProvider } from "@applicaster/zapp-react-native-ui-components/Contexts/ScreenContext";
|
|
8
8
|
import { ROUTE_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/routeTypes";
|
|
9
|
-
import {
|
|
9
|
+
import { useModalStoreState } from "@applicaster/zapp-react-native-utils/modalState";
|
|
10
10
|
|
|
11
11
|
export function ModalProvider() {
|
|
12
|
-
const
|
|
12
|
+
const modalState = useModalStoreState();
|
|
13
13
|
|
|
14
14
|
const [modalVisible, setModalVisible] = React.useState(false);
|
|
15
15
|
const [modalShown, setModalShown] = React.useState(false);
|
|
@@ -64,7 +64,11 @@ import { findParent } from "@applicaster/zapp-react-native-ui-components/Context
|
|
|
64
64
|
import { ZappPipesEntryContext } from "@applicaster/zapp-react-native-ui-components/Contexts";
|
|
65
65
|
import { PlayNextState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/OverlayObserver/OverlaysObserver";
|
|
66
66
|
import { inflateUrl } from "@applicaster/zapp-react-native-ui-components/Components/LinkHandler/LinkHandler";
|
|
67
|
-
import {
|
|
67
|
+
import {
|
|
68
|
+
dismissModal,
|
|
69
|
+
modalStore,
|
|
70
|
+
openModal,
|
|
71
|
+
} from "@applicaster/zapp-react-native-utils/modalState";
|
|
68
72
|
import { useSubscriberFor } from "@applicaster/zapp-react-native-utils/reactHooks/useSubscriberFor";
|
|
69
73
|
import { QBUIComponentEvents } from "@applicaster/zapp-react-native-ui-components/events";
|
|
70
74
|
import { Hook } from "@applicaster/zapp-react-native-utils/appUtils/HooksManager/Hook";
|
|
@@ -120,8 +124,6 @@ export function NavigationProvider({ children }: Props) {
|
|
|
120
124
|
|
|
121
125
|
const { context } = React.useContext(ZappPipesEntryContext.Context);
|
|
122
126
|
|
|
123
|
-
const { openModal, dismissModal } = useModalStore();
|
|
124
|
-
|
|
125
127
|
const playNextOverlayState = React.useRef();
|
|
126
128
|
|
|
127
129
|
const online = useConnectionInfo(true);
|
|
@@ -147,7 +149,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
147
149
|
);
|
|
148
150
|
|
|
149
151
|
const getModalState: () => ModalState = () => {
|
|
150
|
-
const { modalState } =
|
|
152
|
+
const { modalState } = modalStore.getState();
|
|
151
153
|
|
|
152
154
|
return modalState;
|
|
153
155
|
};
|
|
@@ -391,7 +393,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
391
393
|
}
|
|
392
394
|
|
|
393
395
|
if (hookPlugin.isModalHook()) {
|
|
394
|
-
|
|
396
|
+
openModal({
|
|
395
397
|
item: payload,
|
|
396
398
|
props: { screenType: "hooks" },
|
|
397
399
|
options: { ModalContainer: hookPlugin.getModalContainer() },
|
|
@@ -411,7 +413,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
411
413
|
}
|
|
412
414
|
|
|
413
415
|
if (hookPlugin.isModalHook()) {
|
|
414
|
-
|
|
416
|
+
dismissModal();
|
|
415
417
|
} else {
|
|
416
418
|
goBack(true, true);
|
|
417
419
|
}
|
|
@@ -423,7 +425,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
423
425
|
closeLoadingOverlay();
|
|
424
426
|
};
|
|
425
427
|
|
|
426
|
-
const handleHookCancel = ({ hookPlugin, callback }, dispose) => {
|
|
428
|
+
const handleHookCancel = ({ hookPlugin, callback, abort }, dispose) => {
|
|
427
429
|
dispose();
|
|
428
430
|
setStartUpHooks(false);
|
|
429
431
|
|
|
@@ -431,10 +433,12 @@ export function NavigationProvider({ children }: Props) {
|
|
|
431
433
|
callback();
|
|
432
434
|
}
|
|
433
435
|
|
|
434
|
-
if (
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
436
|
+
if (!abort) {
|
|
437
|
+
if (hookPlugin.isModalHook()) {
|
|
438
|
+
dismissModal();
|
|
439
|
+
} else {
|
|
440
|
+
goBack(true, true);
|
|
441
|
+
}
|
|
438
442
|
}
|
|
439
443
|
|
|
440
444
|
closeLoadingOverlay();
|
|
@@ -444,7 +448,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
444
448
|
callback?.();
|
|
445
449
|
|
|
446
450
|
if (hookPlugin.isModalHook()) {
|
|
447
|
-
|
|
451
|
+
dismissModal();
|
|
448
452
|
}
|
|
449
453
|
};
|
|
450
454
|
|
|
@@ -681,33 +685,6 @@ export function NavigationProvider({ children }: Props) {
|
|
|
681
685
|
}
|
|
682
686
|
}, [state?.options?.videoModal?.previousMode]);
|
|
683
687
|
|
|
684
|
-
const openModalBottomSheet = React.useCallback(
|
|
685
|
-
({
|
|
686
|
-
ModalBottomSheetContent,
|
|
687
|
-
modalBottomSheetContentProps,
|
|
688
|
-
props = {},
|
|
689
|
-
options = {},
|
|
690
|
-
}) => {
|
|
691
|
-
openModal({
|
|
692
|
-
item: {
|
|
693
|
-
ModalBottomSheetContent,
|
|
694
|
-
modalBottomSheetContentProps,
|
|
695
|
-
},
|
|
696
|
-
props,
|
|
697
|
-
options: {
|
|
698
|
-
animationType: "none",
|
|
699
|
-
animated: false,
|
|
700
|
-
...options,
|
|
701
|
-
},
|
|
702
|
-
});
|
|
703
|
-
},
|
|
704
|
-
[openModal]
|
|
705
|
-
);
|
|
706
|
-
|
|
707
|
-
const closeModalBottomSheet = React.useCallback(() => {
|
|
708
|
-
dismissModal();
|
|
709
|
-
}, [dismissModal]);
|
|
710
|
-
|
|
711
688
|
const getNestedEntry = () => state?.location?.state?.nested?.entry ?? null;
|
|
712
689
|
|
|
713
690
|
// It will only work for the regular stack and pathname, It won't work for modals
|
|
@@ -745,11 +722,9 @@ export function NavigationProvider({ children }: Props) {
|
|
|
745
722
|
getNestedEntry,
|
|
746
723
|
key: state?.location?.key,
|
|
747
724
|
modalData: state.stack.modal?.state ?? null,
|
|
748
|
-
openModal,
|
|
749
|
-
dismissModal,
|
|
725
|
+
openModal: openModal,
|
|
726
|
+
dismissModal: dismissModal,
|
|
750
727
|
getModalState,
|
|
751
|
-
openModalBottomSheet,
|
|
752
|
-
closeModalBottomSheet,
|
|
753
728
|
videoModalState: state.options.videoModal,
|
|
754
729
|
openVideoModal,
|
|
755
730
|
closeVideoModal,
|
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.6400875052",
|
|
4
4
|
"description": "Core package for Applicaster's Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "13.0.0-alpha.
|
|
32
|
-
"@applicaster/quick-brick-core-plugins": "13.0.0-alpha.
|
|
33
|
-
"@applicaster/zapp-pipes-v2-client": "13.0.0-alpha.
|
|
34
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.
|
|
31
|
+
"@applicaster/applicaster-types": "13.0.0-alpha.6400875052",
|
|
32
|
+
"@applicaster/quick-brick-core-plugins": "13.0.0-alpha.6400875052",
|
|
33
|
+
"@applicaster/zapp-pipes-v2-client": "13.0.0-alpha.6400875052",
|
|
34
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.6400875052",
|
|
35
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.6400875052",
|
|
36
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.6400875052",
|
|
37
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.6400875052",
|
|
38
38
|
"atob": "^2.1.2",
|
|
39
39
|
"axios": "^0.28.0",
|
|
40
40
|
"btoa": "^1.2.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Fragment as ModalChildrenWrapper } from "react";
|
|
File without changes
|