@react-navigation/elements 1.1.1
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/LICENSE +21 -0
- package/README.md +5 -0
- package/lib/commonjs/Background.js +34 -0
- package/lib/commonjs/Background.js.map +1 -0
- package/lib/commonjs/Header/Header.js +250 -0
- package/lib/commonjs/Header/Header.js.map +1 -0
- package/lib/commonjs/Header/HeaderBackButton.js +222 -0
- package/lib/commonjs/Header/HeaderBackButton.js.map +1 -0
- package/lib/commonjs/Header/HeaderBackContext.js +15 -0
- package/lib/commonjs/Header/HeaderBackContext.js.map +1 -0
- package/lib/commonjs/Header/HeaderBackground.js +57 -0
- package/lib/commonjs/Header/HeaderBackground.js.map +1 -0
- package/lib/commonjs/Header/HeaderHeightContext.js +15 -0
- package/lib/commonjs/Header/HeaderHeightContext.js.map +1 -0
- package/lib/commonjs/Header/HeaderShownContext.js +15 -0
- package/lib/commonjs/Header/HeaderShownContext.js.map +1 -0
- package/lib/commonjs/Header/HeaderTitle.js +56 -0
- package/lib/commonjs/Header/HeaderTitle.js.map +1 -0
- package/lib/commonjs/Header/getDefaultHeaderHeight.js +40 -0
- package/lib/commonjs/Header/getDefaultHeaderHeight.js.map +1 -0
- package/lib/commonjs/Header/getHeaderTitle.js +11 -0
- package/lib/commonjs/Header/getHeaderTitle.js.map +1 -0
- package/lib/commonjs/Header/useHeaderHeight.js +27 -0
- package/lib/commonjs/Header/useHeaderHeight.js.map +1 -0
- package/lib/commonjs/MaskedView.android.js +16 -0
- package/lib/commonjs/MaskedView.android.js.map +1 -0
- package/lib/commonjs/MaskedView.ios.js +16 -0
- package/lib/commonjs/MaskedView.ios.js.map +1 -0
- package/lib/commonjs/MaskedView.js +16 -0
- package/lib/commonjs/MaskedView.js.map +1 -0
- package/lib/commonjs/MaskedViewNative.js +40 -0
- package/lib/commonjs/MaskedViewNative.js.map +1 -0
- package/lib/commonjs/MissingIcon.js +34 -0
- package/lib/commonjs/MissingIcon.js.map +1 -0
- package/lib/commonjs/PlatformPressable.js +77 -0
- package/lib/commonjs/PlatformPressable.js.map +1 -0
- package/lib/commonjs/ResourceSavingView.js +64 -0
- package/lib/commonjs/ResourceSavingView.js.map +1 -0
- package/lib/commonjs/SafeAreaProviderCompat.js +69 -0
- package/lib/commonjs/SafeAreaProviderCompat.js.map +1 -0
- package/lib/commonjs/Screen.js +89 -0
- package/lib/commonjs/Screen.js.map +1 -0
- package/lib/commonjs/assets/back-icon-mask.png +0 -0
- package/lib/commonjs/assets/back-icon.png +0 -0
- package/lib/commonjs/assets/back-icon@1.5x.android.png +0 -0
- package/lib/commonjs/assets/back-icon@1.5x.ios.png +0 -0
- package/lib/commonjs/assets/back-icon@1x.android.png +0 -0
- package/lib/commonjs/assets/back-icon@1x.ios.png +0 -0
- package/lib/commonjs/assets/back-icon@2x.android.png +0 -0
- package/lib/commonjs/assets/back-icon@2x.ios.png +0 -0
- package/lib/commonjs/assets/back-icon@3x.android.png +0 -0
- package/lib/commonjs/assets/back-icon@3x.ios.png +0 -0
- package/lib/commonjs/assets/back-icon@4x.android.png +0 -0
- package/lib/commonjs/assets/back-icon@4x.ios.png +0 -0
- package/lib/commonjs/getNamedContext.js +32 -0
- package/lib/commonjs/getNamedContext.js.map +1 -0
- package/lib/commonjs/index.js +175 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/Background.js +20 -0
- package/lib/module/Background.js.map +1 -0
- package/lib/module/Header/Header.js +229 -0
- package/lib/module/Header/Header.js.map +1 -0
- package/lib/module/Header/HeaderBackButton.js +203 -0
- package/lib/module/Header/HeaderBackButton.js.map +1 -0
- package/lib/module/Header/HeaderBackContext.js +4 -0
- package/lib/module/Header/HeaderBackContext.js.map +1 -0
- package/lib/module/Header/HeaderBackground.js +42 -0
- package/lib/module/Header/HeaderBackground.js.map +1 -0
- package/lib/module/Header/HeaderHeightContext.js +4 -0
- package/lib/module/Header/HeaderHeightContext.js.map +1 -0
- package/lib/module/Header/HeaderShownContext.js +4 -0
- package/lib/module/Header/HeaderShownContext.js.map +1 -0
- package/lib/module/Header/HeaderTitle.js +41 -0
- package/lib/module/Header/HeaderTitle.js.map +1 -0
- package/lib/module/Header/getDefaultHeaderHeight.js +32 -0
- package/lib/module/Header/getDefaultHeaderHeight.js.map +1 -0
- package/lib/module/Header/getHeaderTitle.js +4 -0
- package/lib/module/Header/getHeaderTitle.js.map +1 -0
- package/lib/module/Header/useHeaderHeight.js +12 -0
- package/lib/module/Header/useHeaderHeight.js.map +1 -0
- package/lib/module/MaskedView.android.js +2 -0
- package/lib/module/MaskedView.android.js.map +1 -0
- package/lib/module/MaskedView.ios.js +2 -0
- package/lib/module/MaskedView.ios.js.map +1 -0
- package/lib/module/MaskedView.js +9 -0
- package/lib/module/MaskedView.js.map +1 -0
- package/lib/module/MaskedViewNative.js +26 -0
- package/lib/module/MaskedViewNative.js.map +1 -0
- package/lib/module/MissingIcon.js +20 -0
- package/lib/module/MissingIcon.js.map +1 -0
- package/lib/module/PlatformPressable.js +62 -0
- package/lib/module/PlatformPressable.js.map +1 -0
- package/lib/module/ResourceSavingView.js +50 -0
- package/lib/module/ResourceSavingView.js.map +1 -0
- package/lib/module/SafeAreaProviderCompat.js +51 -0
- package/lib/module/SafeAreaProviderCompat.js.map +1 -0
- package/lib/module/Screen.js +67 -0
- package/lib/module/Screen.js.map +1 -0
- package/lib/module/assets/back-icon-mask.png +0 -0
- package/lib/module/assets/back-icon.png +0 -0
- package/lib/module/assets/back-icon@1.5x.android.png +0 -0
- package/lib/module/assets/back-icon@1.5x.ios.png +0 -0
- package/lib/module/assets/back-icon@1x.android.png +0 -0
- package/lib/module/assets/back-icon@1x.ios.png +0 -0
- package/lib/module/assets/back-icon@2x.android.png +0 -0
- package/lib/module/assets/back-icon@2x.ios.png +0 -0
- package/lib/module/assets/back-icon@3x.android.png +0 -0
- package/lib/module/assets/back-icon@3x.ios.png +0 -0
- package/lib/module/assets/back-icon@4x.android.png +0 -0
- package/lib/module/assets/back-icon@4x.ios.png +0 -0
- package/lib/module/getNamedContext.js +19 -0
- package/lib/module/getNamedContext.js.map +1 -0
- package/lib/module/index.js +21 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/src/Background.d.ts +7 -0
- package/lib/typescript/src/Header/Header.d.ts +18 -0
- package/lib/typescript/src/Header/HeaderBackButton.d.ts +3 -0
- package/lib/typescript/src/Header/HeaderBackContext.d.ts +5 -0
- package/lib/typescript/src/Header/HeaderBackground.d.ts +8 -0
- package/lib/typescript/src/Header/HeaderHeightContext.d.ts +3 -0
- package/lib/typescript/src/Header/HeaderShownContext.d.ts +3 -0
- package/lib/typescript/src/Header/HeaderTitle.d.ts +9 -0
- package/lib/typescript/src/Header/getDefaultHeaderHeight.d.ts +2 -0
- package/lib/typescript/src/Header/getHeaderTitle.d.ts +5 -0
- package/lib/typescript/src/Header/useHeaderHeight.d.ts +1 -0
- package/lib/typescript/src/MaskedView.android.d.ts +1 -0
- package/lib/typescript/src/MaskedView.d.ts +10 -0
- package/lib/typescript/src/MaskedView.ios.d.ts +1 -0
- package/lib/typescript/src/MaskedViewNative.d.ts +10 -0
- package/lib/typescript/src/MissingIcon.d.ts +9 -0
- package/lib/typescript/src/PlatformPressable.d.ts +12 -0
- package/lib/typescript/src/ResourceSavingView.d.ts +9 -0
- package/lib/typescript/src/SafeAreaProviderCompat.d.ts +11 -0
- package/lib/typescript/src/Screen.d.ts +17 -0
- package/lib/typescript/src/getNamedContext.d.ts +5 -0
- package/lib/typescript/src/index.d.ts +18 -0
- package/lib/typescript/src/types.d.ts +202 -0
- package/package.json +72 -0
- package/src/Background.tsx +18 -0
- package/src/Header/Header.tsx +306 -0
- package/src/Header/HeaderBackButton.tsx +240 -0
- package/src/Header/HeaderBackContext.tsx +8 -0
- package/src/Header/HeaderBackground.tsx +56 -0
- package/src/Header/HeaderHeightContext.tsx +8 -0
- package/src/Header/HeaderShownContext.tsx +5 -0
- package/src/Header/HeaderTitle.tsx +52 -0
- package/src/Header/getDefaultHeaderHeight.tsx +39 -0
- package/src/Header/getHeaderTitle.tsx +12 -0
- package/src/Header/useHeaderHeight.tsx +15 -0
- package/src/MaskedView.android.tsx +1 -0
- package/src/MaskedView.ios.tsx +1 -0
- package/src/MaskedView.tsx +13 -0
- package/src/MaskedViewNative.tsx +33 -0
- package/src/MissingIcon.tsx +18 -0
- package/src/PlatformPressable.tsx +86 -0
- package/src/ResourceSavingView.tsx +70 -0
- package/src/SafeAreaProviderCompat.tsx +61 -0
- package/src/Screen.tsx +109 -0
- package/src/assets/back-icon-mask.png +0 -0
- package/src/assets/back-icon.png +0 -0
- package/src/assets/back-icon@1.5x.android.png +0 -0
- package/src/assets/back-icon@1.5x.ios.png +0 -0
- package/src/assets/back-icon@1x.android.png +0 -0
- package/src/assets/back-icon@1x.ios.png +0 -0
- package/src/assets/back-icon@2x.android.png +0 -0
- package/src/assets/back-icon@2x.ios.png +0 -0
- package/src/assets/back-icon@3x.android.png +0 -0
- package/src/assets/back-icon@3x.ios.png +0 -0
- package/src/assets/back-icon@4x.android.png +0 -0
- package/src/assets/back-icon@4x.ios.png +0 -0
- package/src/getNamedContext.tsx +28 -0
- package/src/index.tsx +25 -0
- package/src/types.tsx +208 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["getDefaultHeaderHeight.tsx"],"names":["Platform","getDefaultHeaderHeight","layout","modalPresentation","statusBarHeight","headerHeight","isLandscape","width","height","OS","isPad"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AAIA,eAAe,SAASC,sBAAT,CACbC,MADa,EAEbC,iBAFa,EAGbC,eAHa,EAIL;AACR,MAAIC,YAAJ;AAEA,QAAMC,WAAW,GAAGJ,MAAM,CAACK,KAAP,GAAeL,MAAM,CAACM,MAA1C;;AAEA,MAAIR,QAAQ,CAACS,EAAT,KAAgB,KAApB,EAA2B;AACzB,QAAIT,QAAQ,CAACU,KAAb,EAAoB;AAClB,UAAIP,iBAAJ,EAAuB;AACrBE,QAAAA,YAAY,GAAG,EAAf;AACD,OAFD,MAEO;AACLA,QAAAA,YAAY,GAAG,EAAf;AACD;AACF,KAND,MAMO;AACL,UAAIC,WAAJ,EAAiB;AACfD,QAAAA,YAAY,GAAG,EAAf;AACD,OAFD,MAEO;AACL,YAAIF,iBAAJ,EAAuB;AACrBE,UAAAA,YAAY,GAAG,EAAf;AACD,SAFD,MAEO;AACLA,UAAAA,YAAY,GAAG,EAAf;AACD;AACF;AACF;AACF,GAlBD,MAkBO,IAAIL,QAAQ,CAACS,EAAT,KAAgB,SAApB,EAA+B;AACpCJ,IAAAA,YAAY,GAAG,EAAf;AACD,GAFM,MAEA;AACLA,IAAAA,YAAY,GAAG,EAAf;AACD;;AAED,SAAOA,YAAY,GAAGD,eAAtB;AACD","sourcesContent":["import { Platform } from 'react-native';\n\nimport type { Layout } from '../types';\n\nexport default function getDefaultHeaderHeight(\n layout: Layout,\n modalPresentation: boolean,\n statusBarHeight: number\n): number {\n let headerHeight;\n\n const isLandscape = layout.width > layout.height;\n\n if (Platform.OS === 'ios') {\n if (Platform.isPad) {\n if (modalPresentation) {\n headerHeight = 56;\n } else {\n headerHeight = 50;\n }\n } else {\n if (isLandscape) {\n headerHeight = 32;\n } else {\n if (modalPresentation) {\n headerHeight = 56;\n } else {\n headerHeight = 44;\n }\n }\n }\n } else if (Platform.OS === 'android') {\n headerHeight = 56;\n } else {\n headerHeight = 64;\n }\n\n return headerHeight + statusBarHeight;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["getHeaderTitle.tsx"],"names":["getHeaderTitle","options","fallback","headerTitle","title","undefined"],"mappings":"AAEA,eAAe,SAASA,cAAT,CACbC,OADa,EAEbC,QAFa,EAGL;AACR,SAAO,OAAOD,OAAO,CAACE,WAAf,KAA+B,QAA/B,GACHF,OAAO,CAACE,WADL,GAEHF,OAAO,CAACG,KAAR,KAAkBC,SAAlB,GACAJ,OAAO,CAACG,KADR,GAEAF,QAJJ;AAKD","sourcesContent":["import type { HeaderOptions } from '../types';\n\nexport default function getHeaderTitle(\n options: { title?: string; headerTitle?: HeaderOptions['headerTitle'] },\n fallback: string\n): string {\n return typeof options.headerTitle === 'string'\n ? options.headerTitle\n : options.title !== undefined\n ? options.title\n : fallback;\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import HeaderHeightContext from './HeaderHeightContext';
|
|
3
|
+
export default function useHeaderHeight() {
|
|
4
|
+
const height = React.useContext(HeaderHeightContext);
|
|
5
|
+
|
|
6
|
+
if (height === undefined) {
|
|
7
|
+
throw new Error("Couldn't find the header height. Are you inside a screen in a navigator with a header?");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return height;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=useHeaderHeight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useHeaderHeight.tsx"],"names":["React","HeaderHeightContext","useHeaderHeight","height","useContext","undefined","Error"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,mBAAP,MAAgC,uBAAhC;AAEA,eAAe,SAASC,eAAT,GAA2B;AACxC,QAAMC,MAAM,GAAGH,KAAK,CAACI,UAAN,CAAiBH,mBAAjB,CAAf;;AAEA,MAAIE,MAAM,KAAKE,SAAf,EAA0B;AACxB,UAAM,IAAIC,KAAJ,CACJ,wFADI,CAAN;AAGD;;AAED,SAAOH,MAAP;AACD","sourcesContent":["import * as React from 'react';\n\nimport HeaderHeightContext from './HeaderHeightContext';\n\nexport default function useHeaderHeight() {\n const height = React.useContext(HeaderHeightContext);\n\n if (height === undefined) {\n throw new Error(\n \"Couldn't find the header height. Are you inside a screen in a navigator with a header?\"\n );\n }\n\n return height;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["MaskedView.android.tsx"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,oBAAxB","sourcesContent":["export { default } from './MaskedViewNative';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["MaskedView.ios.tsx"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,oBAAxB","sourcesContent":["export { default } from './MaskedViewNative';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["MaskedView.tsx"],"names":["MaskedView","children"],"mappings":"AAAA;AACA;AACA;AAQA,eAAe,SAASA,UAAT,CAAoB;AAAEC,EAAAA;AAAF,CAApB,EAAyC;AACtD,SAAOA,QAAP;AACD","sourcesContent":["/**\n * Use a stub for MaskedView on all Platforms that don't support it.\n */\nimport type * as React from 'react';\n\ntype Props = {\n maskElement: React.ReactElement;\n children: React.ReactElement;\n};\n\nexport default function MaskedView({ children }: Props) {\n return children;\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.
|
|
3
|
+
*/
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { UIManager } from 'react-native';
|
|
6
|
+
let RNCMaskedView;
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
// Add try/catch to support usage even if it's not installed, since it's optional.
|
|
10
|
+
// Newer versions of Metro will handle it properly.
|
|
11
|
+
RNCMaskedView = require('@react-native-masked-view/masked-view').default;
|
|
12
|
+
} catch (e) {// Ignore
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const isMaskedViewAvailable = UIManager.getViewManagerConfig('RNCMaskedView') != null;
|
|
16
|
+
export default function MaskedView({
|
|
17
|
+
children,
|
|
18
|
+
...rest
|
|
19
|
+
}) {
|
|
20
|
+
if (isMaskedViewAvailable && RNCMaskedView) {
|
|
21
|
+
return /*#__PURE__*/React.createElement(RNCMaskedView, rest, children);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return children;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=MaskedViewNative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["MaskedViewNative.tsx"],"names":["React","UIManager","RNCMaskedView","require","default","e","isMaskedViewAvailable","getViewManagerConfig","MaskedView","children","rest"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,cAA1B;AASA,IAAIC,aAAJ;;AAEA,IAAI;AACF;AACA;AACAA,EAAAA,aAAa,GAAGC,OAAO,CAAC,uCAAD,CAAP,CAAiDC,OAAjE;AACD,CAJD,CAIE,OAAOC,CAAP,EAAU,CACV;AACD;;AAED,MAAMC,qBAAqB,GACzBL,SAAS,CAACM,oBAAV,CAA+B,eAA/B,KAAmD,IADrD;AAGA,eAAe,SAASC,UAAT,CAAoB;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAApB,EAAkD;AAC/D,MAAIJ,qBAAqB,IAAIJ,aAA7B,EAA4C;AAC1C,wBAAO,oBAAC,aAAD,EAAmBQ,IAAnB,EAA0BD,QAA1B,CAAP;AACD;;AAED,SAAOA,QAAP;AACD","sourcesContent":["/**\n * The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.\n */\nimport * as React from 'react';\nimport { UIManager } from 'react-native';\n\ntype MaskedViewType =\n typeof import('@react-native-masked-view/masked-view').default;\n\ntype Props = React.ComponentProps<MaskedViewType> & {\n children: React.ReactElement;\n};\n\nlet RNCMaskedView: MaskedViewType | undefined;\n\ntry {\n // Add try/catch to support usage even if it's not installed, since it's optional.\n // Newer versions of Metro will handle it properly.\n RNCMaskedView = require('@react-native-masked-view/masked-view').default;\n} catch (e) {\n // Ignore\n}\n\nconst isMaskedViewAvailable =\n UIManager.getViewManagerConfig('RNCMaskedView') != null;\n\nexport default function MaskedView({ children, ...rest }: Props) {\n if (isMaskedViewAvailable && RNCMaskedView) {\n return <RNCMaskedView {...rest}>{children}</RNCMaskedView>;\n }\n\n return children;\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet, Text } from 'react-native';
|
|
3
|
+
export default function MissingIcon({
|
|
4
|
+
color,
|
|
5
|
+
size,
|
|
6
|
+
style
|
|
7
|
+
}) {
|
|
8
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
9
|
+
style: [styles.icon, {
|
|
10
|
+
color,
|
|
11
|
+
fontSize: size
|
|
12
|
+
}, style]
|
|
13
|
+
}, "\u23F7");
|
|
14
|
+
}
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
icon: {
|
|
17
|
+
backgroundColor: 'transparent'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=MissingIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["MissingIcon.tsx"],"names":["React","StyleSheet","Text","MissingIcon","color","size","style","styles","icon","fontSize","create","backgroundColor"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAAoBC,UAApB,EAAgCC,IAAhC,QAAuD,cAAvD;AAQA,eAAe,SAASC,WAAT,CAAqB;AAAEC,EAAAA,KAAF;AAASC,EAAAA,IAAT;AAAeC,EAAAA;AAAf,CAArB,EAAoD;AACjE,sBAAO,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAE,CAACC,MAAM,CAACC,IAAR,EAAc;AAAEJ,MAAAA,KAAF;AAASK,MAAAA,QAAQ,EAAEJ;AAAnB,KAAd,EAAyCC,KAAzC;AAAb,cAAP;AACD;AAED,MAAMC,MAAM,GAAGN,UAAU,CAACS,MAAX,CAAkB;AAC/BF,EAAAA,IAAI,EAAE;AACJG,IAAAA,eAAe,EAAE;AADb;AADyB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport { StyleProp, StyleSheet, Text, TextStyle } from 'react-native';\n\ntype Props = {\n color?: string;\n size?: number;\n style?: StyleProp<TextStyle>;\n};\n\nexport default function MissingIcon({ color, size, style }: Props) {\n return <Text style={[styles.icon, { color, fontSize: size }, style]}>⏷</Text>;\n}\n\nconst styles = StyleSheet.create({\n icon: {\n backgroundColor: 'transparent',\n },\n});\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import { useTheme } from '@react-navigation/native';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { Animated, Easing, Platform, Pressable } from 'react-native';
|
|
6
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
7
|
+
const ANDROID_VERSION_LOLLIPOP = 21;
|
|
8
|
+
const ANDROID_SUPPORTS_RIPPLE = Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP;
|
|
9
|
+
/**
|
|
10
|
+
* PlatformPressable provides an abstraction on top of Pressable to handle platform differences.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default function PlatformPressable({
|
|
14
|
+
onPressIn,
|
|
15
|
+
onPressOut,
|
|
16
|
+
android_ripple,
|
|
17
|
+
pressColor,
|
|
18
|
+
pressOpacity = 0.3,
|
|
19
|
+
style,
|
|
20
|
+
...rest
|
|
21
|
+
}) {
|
|
22
|
+
const {
|
|
23
|
+
dark
|
|
24
|
+
} = useTheme();
|
|
25
|
+
const [opacity] = React.useState(() => new Animated.Value(1));
|
|
26
|
+
|
|
27
|
+
const animateTo = (toValue, duration) => {
|
|
28
|
+
if (ANDROID_SUPPORTS_RIPPLE) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
Animated.timing(opacity, {
|
|
33
|
+
toValue,
|
|
34
|
+
duration,
|
|
35
|
+
easing: Easing.inOut(Easing.quad),
|
|
36
|
+
useNativeDriver: true
|
|
37
|
+
}).start();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const handlePressIn = e => {
|
|
41
|
+
animateTo(pressOpacity, 0);
|
|
42
|
+
onPressIn === null || onPressIn === void 0 ? void 0 : onPressIn(e);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const handlePressOut = e => {
|
|
46
|
+
animateTo(1, 200);
|
|
47
|
+
onPressOut === null || onPressOut === void 0 ? void 0 : onPressOut(e);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/React.createElement(AnimatedPressable, _extends({
|
|
51
|
+
onPressIn: handlePressIn,
|
|
52
|
+
onPressOut: handlePressOut,
|
|
53
|
+
android_ripple: ANDROID_SUPPORTS_RIPPLE ? {
|
|
54
|
+
color: pressColor !== undefined ? pressColor : dark ? 'rgba(255, 255, 255, .32)' : 'rgba(0, 0, 0, .32)',
|
|
55
|
+
...android_ripple
|
|
56
|
+
} : undefined,
|
|
57
|
+
style: [{
|
|
58
|
+
opacity: !ANDROID_SUPPORTS_RIPPLE ? opacity : 1
|
|
59
|
+
}, style]
|
|
60
|
+
}, rest));
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=PlatformPressable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PlatformPressable.tsx"],"names":["useTheme","React","Animated","Easing","Platform","Pressable","AnimatedPressable","createAnimatedComponent","ANDROID_VERSION_LOLLIPOP","ANDROID_SUPPORTS_RIPPLE","OS","Version","PlatformPressable","onPressIn","onPressOut","android_ripple","pressColor","pressOpacity","style","rest","dark","opacity","useState","Value","animateTo","toValue","duration","timing","easing","inOut","quad","useNativeDriver","start","handlePressIn","e","handlePressOut","color","undefined"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAO,KAAKC,KAA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HD;;AAKA,QAAMC,cAAc,GAAID,CAAD,IAA8B;AACnDV,IAAAA,SAAS,CAAC,CAAD,EAAI,GAAJ,CAAT;AACAV,IAAAA,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAGoB,CAAH,CAAV;AACD,GAHD;;AAKA,sBACE,oBAAC,iBAAD;AACE,IAAA,SAAS,EAAED,aADb;AAEE,IAAA,UAAU,EAAEE,cAFd;AAGE,IAAA,cAAc,EACZ1B,uBAAuB,GACnB;AACE2B,MAAAA,KAAK,EACHpB,UAAU,KAAKqB,SAAf,GACIrB,UADJ,GAEII,IAAI,GACJ,0BADI,GAEJ,oBANR;AAOE,SAAGL;AAPL,KADmB,GAUnBsB,SAdR;AAgBE,IAAA,KAAK,EAAE,CAAC;AAAEhB,MAAAA,OAAO,EAAE,CAACZ,uBAAD,GAA2BY,OAA3B,GAAqC;AAAhD,KAAD,EAAsDH,KAAtD;AAhBT,KAiBMC,IAjBN,EADF;AAqBD","sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n Easing,\n GestureResponderEvent,\n Platform,\n Pressable,\n PressableProps,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nexport type Props = Omit<PressableProps, 'style'> & {\n pressColor?: string;\n pressOpacity?: number;\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n children: React.ReactNode;\n};\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nconst ANDROID_VERSION_LOLLIPOP = 21;\nconst ANDROID_SUPPORTS_RIPPLE =\n Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP;\n\n/**\n * PlatformPressable provides an abstraction on top of Pressable to handle platform differences.\n */\nexport default function PlatformPressable({\n onPressIn,\n onPressOut,\n android_ripple,\n pressColor,\n pressOpacity = 0.3,\n style,\n ...rest\n}: Props) {\n const { dark } = useTheme();\n const [opacity] = React.useState(() => new Animated.Value(1));\n\n const animateTo = (toValue: number, duration: number) => {\n if (ANDROID_SUPPORTS_RIPPLE) {\n return;\n }\n\n Animated.timing(opacity, {\n toValue,\n duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver: true,\n }).start();\n };\n\n const handlePressIn = (e: GestureResponderEvent) => {\n animateTo(pressOpacity, 0);\n onPressIn?.(e);\n };\n\n const handlePressOut = (e: GestureResponderEvent) => {\n animateTo(1, 200);\n onPressOut?.(e);\n };\n\n return (\n <AnimatedPressable\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n android_ripple={\n ANDROID_SUPPORTS_RIPPLE\n ? {\n color:\n pressColor !== undefined\n ? pressColor\n : dark\n ? 'rgba(255, 255, 255, .32)'\n : 'rgba(0, 0, 0, .32)',\n ...android_ripple,\n }\n : undefined\n }\n style={[{ opacity: !ANDROID_SUPPORTS_RIPPLE ? opacity : 1 }, style]}\n {...rest}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
5
|
+
const FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container
|
|
6
|
+
|
|
7
|
+
export default function ResourceSavingScene({
|
|
8
|
+
visible,
|
|
9
|
+
children,
|
|
10
|
+
style,
|
|
11
|
+
...rest
|
|
12
|
+
}) {
|
|
13
|
+
if (Platform.OS === 'web') {
|
|
14
|
+
return /*#__PURE__*/React.createElement(View // @ts-expect-error: hidden exists on web, but not in React Native
|
|
15
|
+
, _extends({
|
|
16
|
+
hidden: !visible,
|
|
17
|
+
style: [{
|
|
18
|
+
display: visible ? 'flex' : 'none'
|
|
19
|
+
}, styles.container, style],
|
|
20
|
+
pointerEvents: visible ? 'auto' : 'none'
|
|
21
|
+
}, rest), children);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
25
|
+
style: [styles.container, style] // box-none doesn't seem to work properly on Android
|
|
26
|
+
,
|
|
27
|
+
pointerEvents: visible ? 'auto' : 'none'
|
|
28
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
29
|
+
collapsable: false,
|
|
30
|
+
removeClippedSubviews: // On iOS & macOS, set removeClippedSubviews to true only when not focused
|
|
31
|
+
// This is an workaround for a bug where the clipped view never re-appears
|
|
32
|
+
Platform.OS === 'ios' || Platform.OS === 'macos' ? !visible : true,
|
|
33
|
+
pointerEvents: visible ? 'auto' : 'none',
|
|
34
|
+
style: visible ? styles.attached : styles.detached
|
|
35
|
+
}, children));
|
|
36
|
+
}
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
container: {
|
|
39
|
+
flex: 1,
|
|
40
|
+
overflow: 'hidden'
|
|
41
|
+
},
|
|
42
|
+
attached: {
|
|
43
|
+
flex: 1
|
|
44
|
+
},
|
|
45
|
+
detached: {
|
|
46
|
+
flex: 1,
|
|
47
|
+
top: FAR_FAR_AWAY
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=ResourceSavingView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ResourceSavingView.tsx"],"names":["React","Platform","StyleSheet","View","FAR_FAR_AWAY","ResourceSavingScene","visible","children","style","rest","OS","display","styles","container","attached","detached","create","flex","overflow","top"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAA8BC,UAA9B,EAA0CC,IAA1C,QAAiE,cAAjE;AAQA,MAAMC,YAAY,GAAG,KAArB,C,CAA4B;;AAE5B,eAAe,SAASC,mBAAT,CAA6B;AAC1CC,EAAAA,OAD0C;AAE1CC,EAAAA,QAF0C;AAG1CC,EAAAA,KAH0C;AAI1C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CAAf","sourcesContent":["import * as React from 'react';\nimport { Platform, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\ntype Props = {\n visible: boolean;\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container\n\nexport default function ResourceSavingScene({\n visible,\n children,\n style,\n ...rest\n}: Props) {\n if (Platform.OS === 'web') {\n return (\n <View\n // @ts-expect-error: hidden exists on web, but not in React Native\n hidden={!visible}\n style={[\n { display: visible ? 'flex' : 'none' },\n styles.container,\n style,\n ]}\n pointerEvents={visible ? 'auto' : 'none'}\n {...rest}\n >\n {children}\n </View>\n );\n }\n\n return (\n <View\n style={[styles.container, style]}\n // box-none doesn't seem to work properly on Android\n pointerEvents={visible ? 'auto' : 'none'}\n >\n <View\n collapsable={false}\n removeClippedSubviews={\n // On iOS & macOS, set removeClippedSubviews to true only when not focused\n // This is an workaround for a bug where the clipped view never re-appears\n Platform.OS === 'ios' || Platform.OS === 'macos' ? !visible : true\n }\n pointerEvents={visible ? 'auto' : 'none'}\n style={visible ? styles.attached : styles.detached}\n >\n {children}\n </View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden',\n },\n attached: {\n flex: 1,\n },\n detached: {\n flex: 1,\n top: FAR_FAR_AWAY,\n },\n});\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dimensions, Platform, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { initialWindowMetrics, SafeAreaInsetsContext, SafeAreaProvider } from 'react-native-safe-area-context';
|
|
4
|
+
const {
|
|
5
|
+
width = 0,
|
|
6
|
+
height = 0
|
|
7
|
+
} = Dimensions.get('window'); // To support SSR on web, we need to have empty insets for initial values
|
|
8
|
+
// Otherwise there can be mismatch between SSR and client output
|
|
9
|
+
// We also need to specify empty values to support tests environments
|
|
10
|
+
|
|
11
|
+
const initialMetrics = Platform.OS === 'web' || initialWindowMetrics == null ? {
|
|
12
|
+
frame: {
|
|
13
|
+
x: 0,
|
|
14
|
+
y: 0,
|
|
15
|
+
width,
|
|
16
|
+
height
|
|
17
|
+
},
|
|
18
|
+
insets: {
|
|
19
|
+
top: 0,
|
|
20
|
+
left: 0,
|
|
21
|
+
right: 0,
|
|
22
|
+
bottom: 0
|
|
23
|
+
}
|
|
24
|
+
} : initialWindowMetrics;
|
|
25
|
+
export default function SafeAreaProviderCompat({
|
|
26
|
+
children,
|
|
27
|
+
style
|
|
28
|
+
}) {
|
|
29
|
+
return /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, insets => {
|
|
30
|
+
if (insets) {
|
|
31
|
+
// If we already have insets, don't wrap the stack in another safe area provider
|
|
32
|
+
// This avoids an issue with updates at the cost of potentially incorrect values
|
|
33
|
+
// https://github.com/react-navigation/react-navigation/issues/174
|
|
34
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
35
|
+
style: [styles.container, style]
|
|
36
|
+
}, children);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return /*#__PURE__*/React.createElement(SafeAreaProvider, {
|
|
40
|
+
initialMetrics: initialMetrics,
|
|
41
|
+
style: style
|
|
42
|
+
}, children);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
SafeAreaProviderCompat.initialMetrics = initialMetrics;
|
|
46
|
+
const styles = StyleSheet.create({
|
|
47
|
+
container: {
|
|
48
|
+
flex: 1
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=SafeAreaProviderCompat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["SafeAreaProviderCompat.tsx"],"names":["React","Dimensions","Platform","StyleSheet","View","initialWindowMetrics","SafeAreaInsetsContext","SafeAreaProvider","width","height","get","initialMetrics","OS","frame","x","y","insets","top","left","right","bottom","SafeAreaProviderCompat","children","style","styles","container","create","flex"],"mappings":"AAAA,OAAO,KAAK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AU,CAACuB,MAAX,CAAkB;AAC/BD,EAAAA,SAAS,EAAE;AACTE,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport {\n Dimensions,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\nimport {\n initialWindowMetrics,\n SafeAreaInsetsContext,\n SafeAreaProvider,\n} from 'react-native-safe-area-context';\n\ntype Props = {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst { width = 0, height = 0 } = Dimensions.get('window');\n\n// To support SSR on web, we need to have empty insets for initial values\n// Otherwise there can be mismatch between SSR and client output\n// We also need to specify empty values to support tests environments\nconst initialMetrics =\n Platform.OS === 'web' || initialWindowMetrics == null\n ? {\n frame: { x: 0, y: 0, width, height },\n insets: { top: 0, left: 0, right: 0, bottom: 0 },\n }\n : initialWindowMetrics;\n\nexport default function SafeAreaProviderCompat({ children, style }: Props) {\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets) => {\n if (insets) {\n // If we already have insets, don't wrap the stack in another safe area provider\n // This avoids an issue with updates at the cost of potentially incorrect values\n // https://github.com/react-navigation/react-navigation/issues/174\n return <View style={[styles.container, style]}>{children}</View>;\n }\n\n return (\n <SafeAreaProvider initialMetrics={initialMetrics} style={style}>\n {children}\n </SafeAreaProvider>\n );\n }}\n </SafeAreaInsetsContext.Consumer>\n );\n}\n\nSafeAreaProviderCompat.initialMetrics = initialMetrics;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { NavigationContext, NavigationRouteContext } from '@react-navigation/native';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { useSafeAreaFrame, useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
|
+
import Background from './Background';
|
|
6
|
+
import getDefaultHeaderHeight from './Header/getDefaultHeaderHeight';
|
|
7
|
+
import HeaderHeightContext from './Header/HeaderHeightContext';
|
|
8
|
+
import HeaderShownContext from './Header/HeaderShownContext';
|
|
9
|
+
export default function Screen(props) {
|
|
10
|
+
const dimensions = useSafeAreaFrame();
|
|
11
|
+
const insets = useSafeAreaInsets();
|
|
12
|
+
const isParentHeaderShown = React.useContext(HeaderShownContext);
|
|
13
|
+
const parentHeaderHeight = React.useContext(HeaderHeightContext);
|
|
14
|
+
const {
|
|
15
|
+
focused,
|
|
16
|
+
modal = false,
|
|
17
|
+
header,
|
|
18
|
+
headerShown = true,
|
|
19
|
+
headerTransparent,
|
|
20
|
+
headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,
|
|
21
|
+
navigation,
|
|
22
|
+
route,
|
|
23
|
+
children,
|
|
24
|
+
style
|
|
25
|
+
} = props;
|
|
26
|
+
const [headerHeight, setHeaderHeight] = React.useState(() => getDefaultHeaderHeight(dimensions, modal, headerStatusBarHeight));
|
|
27
|
+
return /*#__PURE__*/React.createElement(Background, {
|
|
28
|
+
accessibilityElementsHidden: !focused,
|
|
29
|
+
importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
|
|
30
|
+
style: [styles.container, style]
|
|
31
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
32
|
+
style: styles.content
|
|
33
|
+
}, /*#__PURE__*/React.createElement(HeaderShownContext.Provider, {
|
|
34
|
+
value: isParentHeaderShown || headerShown !== false
|
|
35
|
+
}, /*#__PURE__*/React.createElement(HeaderHeightContext.Provider, {
|
|
36
|
+
value: headerShown ? headerHeight : parentHeaderHeight !== null && parentHeaderHeight !== void 0 ? parentHeaderHeight : 0
|
|
37
|
+
}, children))), headerShown ? /*#__PURE__*/React.createElement(NavigationContext.Provider, {
|
|
38
|
+
value: navigation
|
|
39
|
+
}, /*#__PURE__*/React.createElement(NavigationRouteContext.Provider, {
|
|
40
|
+
value: route
|
|
41
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
42
|
+
onLayout: e => {
|
|
43
|
+
const {
|
|
44
|
+
height
|
|
45
|
+
} = e.nativeEvent.layout;
|
|
46
|
+
setHeaderHeight(height);
|
|
47
|
+
},
|
|
48
|
+
style: headerTransparent ? styles.absolute : null
|
|
49
|
+
}, header))) : null);
|
|
50
|
+
}
|
|
51
|
+
const styles = StyleSheet.create({
|
|
52
|
+
container: {
|
|
53
|
+
flex: 1,
|
|
54
|
+
flexDirection: 'column-reverse'
|
|
55
|
+
},
|
|
56
|
+
// This is necessary to avoid applying 'column-reverse' to screen content
|
|
57
|
+
content: {
|
|
58
|
+
flex: 1
|
|
59
|
+
},
|
|
60
|
+
absolute: {
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
top: 0,
|
|
63
|
+
left: 0,
|
|
64
|
+
right: 0
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=Screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Screen.tsx"],"names":["NavigationContext","NavigationRouteContext","React","StyleSheet","View","useSafeAreaFrame","useSafeAreaInsets","Background","getDefaultHeaderHeight","HeaderHeightContext","HeaderShownContext","Screen","props","dimensions","insets","isParentHeaderShown","useContext","parentHeaderHeight","focused","modal","header","headerShown","headerTransparent","headerStatusBarHeight","top","navigation","route","children","style","headerHeight","setHeaderHeight","useState","styles","container","content","e","height","nativeEvent","layout","absolute","create","flex","flexDirection","position","left","right"],"mappings":"AAAA,SACEA,iBADF,EAGEC,sBAHF,QAMO,0BANP;AAOA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAAoBC,UAApB,EAAgCC,IAAhC,QAAuD,cAAvD;AACA,SACEC,gBADF,EAEEC,iBAFF,QAGO,gCAHP;AAKA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,sBAAP,MAAmC,iCAAnC;AACA,OAAOC,mBAAP,MAAgC,8BAAhC;AACA,OAAOC,kBAAP,MAA+B,6BAA/B;AAeA,eAAe,SAASC,MAAT,CAAgBC,K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V,oBAAC,iBAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAEI;AAAnC,kBACE,oBAAC,sBAAD,CAAwB,QAAxB;AAAiC,IAAA,KAAK,EAAEC;AAAxC,kBACE,oBAAC,IAAD;AACE,IAAA,QAAQ,EAAGS,CAAD,IAAO;AACf,YAAM;AAAEC,QAAAA;AAAF,UAAaD,CAAC,CAACE,WAAF,CAAcC,MAAjC;AAEAR,MAAAA,eAAe,CAACM,MAAD,CAAf;AACD,KALH;AAME,IAAA,KAAK,EAAEd,iBAAiB,GAAGU,MAAM,CAACO,QAAV,GAAqB;AAN/C,KAQGnB,MARH,CADF,CADF,CADU,GAeR,IA/BN,CADF;AAmCD;AAED,MAAMY,MAAM,GAAG7B,UAAU,CAACqC,MAAX,CAAkB;AAC/BP,EAAAA,SAAS,EAAE;AACTQ,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,aAAa,EAAE;AAFN,GADoB;AAK/B;AACAR,EAAAA,OAAO,EAAE;AACPO,IAAAA,IAAI,EAAE;AADC,GANsB;AAS/BF,EAAAA,QAAQ,EAAE;AACRI,IAAAA,QAAQ,EAAE,UADF;AAERnB,IAAAA,GAAG,EAAE,CAFG;AAGRoB,IAAAA,IAAI,EAAE,CAHE;AAIRC,IAAAA,KAAK,EAAE;AAJC;AATqB,CAAlB,CAAf","sourcesContent":["import {\n NavigationContext,\n NavigationProp,\n NavigationRouteContext,\n ParamListBase,\n RouteProp,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport Background from './Background';\nimport getDefaultHeaderHeight from './Header/getDefaultHeaderHeight';\nimport HeaderHeightContext from './Header/HeaderHeightContext';\nimport HeaderShownContext from './Header/HeaderShownContext';\n\ntype Props = {\n focused: boolean;\n modal?: boolean;\n navigation: NavigationProp<ParamListBase>;\n route: RouteProp<ParamListBase>;\n header: React.ReactNode;\n headerShown?: boolean;\n headerStatusBarHeight?: number;\n headerTransparent?: boolean;\n style?: StyleProp<ViewStyle>;\n children: React.ReactNode;\n};\n\nexport default function Screen(props: Props) {\n const dimensions = useSafeAreaFrame();\n const insets = useSafeAreaInsets();\n\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n const parentHeaderHeight = React.useContext(HeaderHeightContext);\n\n const {\n focused,\n modal = false,\n header,\n headerShown = true,\n headerTransparent,\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n navigation,\n route,\n children,\n style,\n } = props;\n\n const [headerHeight, setHeaderHeight] = React.useState(() =>\n getDefaultHeaderHeight(dimensions, modal, headerStatusBarHeight)\n );\n\n return (\n <Background\n accessibilityElementsHidden={!focused}\n importantForAccessibility={focused ? 'auto' : 'no-hide-descendants'}\n style={[styles.container, style]}\n >\n <View style={styles.content}>\n <HeaderShownContext.Provider\n value={isParentHeaderShown || headerShown !== false}\n >\n <HeaderHeightContext.Provider\n value={headerShown ? headerHeight : parentHeaderHeight ?? 0}\n >\n {children}\n </HeaderHeightContext.Provider>\n </HeaderShownContext.Provider>\n </View>\n {headerShown ? (\n <NavigationContext.Provider value={navigation}>\n <NavigationRouteContext.Provider value={route}>\n <View\n onLayout={(e) => {\n const { height } = e.nativeEvent.layout;\n\n setHeaderHeight(height);\n }}\n style={headerTransparent ? styles.absolute : null}\n >\n {header}\n </View>\n </NavigationRouteContext.Provider>\n </NavigationContext.Provider>\n ) : null}\n </Background>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'column-reverse',\n },\n // This is necessary to avoid applying 'column-reverse' to screen content\n content: {\n flex: 1,\n },\n absolute: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n },\n});\n"]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var _global$contexts;
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
const contexts = '__react_navigation__elements_contexts';
|
|
5
|
+
// We use a global variable to keep our contexts so that we can reuse same contexts across packages
|
|
6
|
+
global[contexts] = (_global$contexts = global[contexts]) !== null && _global$contexts !== void 0 ? _global$contexts : new Map();
|
|
7
|
+
export default function getNamedContext(name, initialValue) {
|
|
8
|
+
let context = global[contexts].get(name);
|
|
9
|
+
|
|
10
|
+
if (context) {
|
|
11
|
+
return context;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
context = /*#__PURE__*/React.createContext(initialValue);
|
|
15
|
+
context.displayName = name;
|
|
16
|
+
global[contexts].set(name, context);
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=getNamedContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["getNamedContext.tsx"],"names":["React","contexts","global","Map","getNamedContext","name","initialValue","context","get","createContext","displayName","set"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,MAAMC,QAAQ,GAAG,uCAAjB;AAMA;AACAC,MAAM,CAACD,QAAD,CAAN,uBAAmBC,MAAM,CAACD,QAAD,CAAzB,+DAAuC,IAAIE,GAAJ,EAAvC;AAEA,eAAe,SAASC,eAAT,CACbC,IADa,EAEbC,YAFa,EAGK;AAClB,MAAIC,OAAO,GAAGL,MAAM,CAACD,QAAD,CAAN,CAAiBO,GAAjB,CAAqBH,IAArB,CAAd;;AAEA,MAAIE,OAAJ,EAAa;AACX,WAAOA,OAAP;AACD;;AAEDA,EAAAA,OAAO,gBAAGP,KAAK,CAACS,aAAN,CAAuBH,YAAvB,CAAV;AACAC,EAAAA,OAAO,CAACG,WAAR,GAAsBL,IAAtB;AAEAH,EAAAA,MAAM,CAACD,QAAD,CAAN,CAAiBU,GAAjB,CAAqBN,IAArB,EAA2BE,OAA3B;AAEA,SAAOA,OAAP;AACD","sourcesContent":["import * as React from 'react';\n\nconst contexts = '__react_navigation__elements_contexts';\n\ndeclare global {\n var __react_navigation__elements_contexts: Map<string, React.Context<any>>;\n}\n\n// We use a global variable to keep our contexts so that we can reuse same contexts across packages\nglobal[contexts] = global[contexts] ?? new Map<string, React.Context<any>>();\n\nexport default function getNamedContext<T>(\n name: string,\n initialValue: T\n): React.Context<T> {\n let context = global[contexts].get(name);\n\n if (context) {\n return context;\n }\n\n context = React.createContext<T>(initialValue);\n context.displayName = name;\n\n global[contexts].set(name, context);\n\n return context;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { default as Background } from './Background';
|
|
2
|
+
export { default as getDefaultHeaderHeight } from './Header/getDefaultHeaderHeight';
|
|
3
|
+
export { default as getHeaderTitle } from './Header/getHeaderTitle';
|
|
4
|
+
export { default as Header } from './Header/Header';
|
|
5
|
+
export { default as HeaderBackButton } from './Header/HeaderBackButton';
|
|
6
|
+
export { default as HeaderBackContext } from './Header/HeaderBackContext';
|
|
7
|
+
export { default as HeaderBackground } from './Header/HeaderBackground';
|
|
8
|
+
export { default as HeaderHeightContext } from './Header/HeaderHeightContext';
|
|
9
|
+
export { default as HeaderShownContext } from './Header/HeaderShownContext';
|
|
10
|
+
export { default as HeaderTitle } from './Header/HeaderTitle';
|
|
11
|
+
export { default as useHeaderHeight } from './Header/useHeaderHeight';
|
|
12
|
+
export { default as MissingIcon } from './MissingIcon';
|
|
13
|
+
export { default as PlatformPressable } from './PlatformPressable';
|
|
14
|
+
export { default as ResourceSavingView } from './ResourceSavingView';
|
|
15
|
+
export { default as SafeAreaProviderCompat } from './SafeAreaProviderCompat';
|
|
16
|
+
export { default as Screen } from './Screen';
|
|
17
|
+
export const Assets = [// eslint-disable-next-line import/no-commonjs
|
|
18
|
+
require('./assets/back-icon.png'), // eslint-disable-next-line import/no-commonjs
|
|
19
|
+
require('./assets/back-icon-mask.png')];
|
|
20
|
+
export * from './types';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["default","Background","getDefaultHeaderHeight","getHeaderTitle","Header","HeaderBackButton","HeaderBackContext","HeaderBackground","HeaderHeightContext","HeaderShownContext","HeaderTitle","useHeaderHeight","MissingIcon","PlatformPressable","ResourceSavingView","SafeAreaProviderCompat","Screen","Assets","require"],"mappings":"AAAA,SAASA,OAAO,IAAIC,UAApB,QAAsC,cAAtC;AACA,SAASD,OAAO,IAAIE,sBAApB,QAAkD,iCAAlD;AACA,SAASF,OAAO,IAAIG,cAApB,QAA0C,yBAA1C;AACA,SAASH,OAAO,IAAII,MAApB,QAAkC,iBAAlC;AACA,SAASJ,OAAO,IAAIK,gBAApB,QAA4C,2BAA5C;AACA,SAASL,OAAO,IAAIM,iBAApB,QAA6C,4BAA7C;AACA,SAASN,OAAO,IAAIO,gBAApB,QAA4C,2BAA5C;AACA,SAASP,OAAO,IAAIQ,mBAApB,QAA+C,8BAA/C;AACA,SAASR,OAAO,IAAIS,kBAApB,QAA8C,6BAA9C;AACA,SAAST,OAAO,IAAIU,WAApB,QAAuC,sBAAvC;AACA,SAASV,OAAO,IAAIW,eAApB,QAA2C,0BAA3C;AACA,SAASX,OAAO,IAAIY,WAApB,QAAuC,eAAvC;AACA,SAASZ,OAAO,IAAIa,iBAApB,QAA6C,qBAA7C;AACA,SAASb,OAAO,IAAIc,kBAApB,QAA8C,sBAA9C;AACA,SAASd,OAAO,IAAIe,sBAApB,QAAkD,0BAAlD;AACA,SAASf,OAAO,IAAIgB,MAApB,QAAkC,UAAlC;AAEA,OAAO,MAAMC,MAAM,GAAG,CACpB;AACAC,OAAO,CAAC,wBAAD,CAFa,EAGpB;AACAA,OAAO,CAAC,6BAAD,CAJa,CAAf;AAOP,cAAc,SAAd","sourcesContent":["export { default as Background } from './Background';\nexport { default as getDefaultHeaderHeight } from './Header/getDefaultHeaderHeight';\nexport { default as getHeaderTitle } from './Header/getHeaderTitle';\nexport { default as Header } from './Header/Header';\nexport { default as HeaderBackButton } from './Header/HeaderBackButton';\nexport { default as HeaderBackContext } from './Header/HeaderBackContext';\nexport { default as HeaderBackground } from './Header/HeaderBackground';\nexport { default as HeaderHeightContext } from './Header/HeaderHeightContext';\nexport { default as HeaderShownContext } from './Header/HeaderShownContext';\nexport { default as HeaderTitle } from './Header/HeaderTitle';\nexport { default as useHeaderHeight } from './Header/useHeaderHeight';\nexport { default as MissingIcon } from './MissingIcon';\nexport { default as PlatformPressable } from './PlatformPressable';\nexport { default as ResourceSavingView } from './ResourceSavingView';\nexport { default as SafeAreaProviderCompat } from './SafeAreaProviderCompat';\nexport { default as Screen } from './Screen';\n\nexport const Assets = [\n // eslint-disable-next-line import/no-commonjs\n require('./assets/back-icon.png'),\n // eslint-disable-next-line import/no-commonjs\n require('./assets/back-icon-mask.png'),\n];\n\nexport * from './types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { HeaderOptions, Layout } from '../types';
|
|
3
|
+
declare type Props = HeaderOptions & {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the header is in a modal
|
|
6
|
+
*/
|
|
7
|
+
modal?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Layout of the screen.
|
|
10
|
+
*/
|
|
11
|
+
layout?: Layout;
|
|
12
|
+
/**
|
|
13
|
+
* Title text for the header.
|
|
14
|
+
*/
|
|
15
|
+
title: string;
|
|
16
|
+
};
|
|
17
|
+
export default function Header(props: Props): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { HeaderBackButtonProps } from '../types';
|
|
3
|
+
export default function HeaderBackButton({ disabled, allowFontScaling, backImage, label, labelStyle, labelVisible, onLabelLayout, onPress, pressColor, pressOpacity, screenLayout, tintColor: customTintColor, titleLayout, truncatedLabel, accessibilityLabel, testID, style, }: HeaderBackButtonProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Animated, StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
declare type Props = ViewProps & {
|
|
4
|
+
style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export default function HeaderBackground({ style, ...rest }: Props): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Animated, StyleProp, TextProps, TextStyle } from 'react-native';
|
|
3
|
+
declare type Props = Omit<TextProps, 'style'> & {
|
|
4
|
+
tintColor?: string;
|
|
5
|
+
children?: string;
|
|
6
|
+
style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;
|
|
7
|
+
};
|
|
8
|
+
export default function HeaderTitle({ tintColor, style, ...rest }: Props): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useHeaderHeight(): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MaskedViewNative';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use a stub for MaskedView on all Platforms that don't support it.
|
|
3
|
+
*/
|
|
4
|
+
import type * as React from 'react';
|
|
5
|
+
declare type Props = {
|
|
6
|
+
maskElement: React.ReactElement;
|
|
7
|
+
children: React.ReactElement;
|
|
8
|
+
};
|
|
9
|
+
export default function MaskedView({ children }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MaskedViewNative';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.
|
|
3
|
+
*/
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
declare type MaskedViewType = typeof import('@react-native-masked-view/masked-view').default;
|
|
6
|
+
declare type Props = React.ComponentProps<MaskedViewType> & {
|
|
7
|
+
children: React.ReactElement;
|
|
8
|
+
};
|
|
9
|
+
export default function MaskedView({ children, ...rest }: Props): JSX.Element;
|
|
10
|
+
export {};
|