@react-navigation/elements 1.3.9 → 1.3.11

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.
Files changed (130) hide show
  1. package/lib/commonjs/Background.js +0 -7
  2. package/lib/commonjs/Background.js.map +1 -1
  3. package/lib/commonjs/Header/Header.js +3 -20
  4. package/lib/commonjs/Header/Header.js.map +1 -1
  5. package/lib/commonjs/Header/HeaderBackButton.js +4 -22
  6. package/lib/commonjs/Header/HeaderBackButton.js.map +1 -1
  7. package/lib/commonjs/Header/HeaderBackContext.js +0 -3
  8. package/lib/commonjs/Header/HeaderBackContext.js.map +1 -1
  9. package/lib/commonjs/Header/HeaderBackground.js +0 -8
  10. package/lib/commonjs/Header/HeaderBackground.js.map +1 -1
  11. package/lib/commonjs/Header/HeaderHeightContext.js +0 -3
  12. package/lib/commonjs/Header/HeaderHeightContext.js.map +1 -1
  13. package/lib/commonjs/Header/HeaderShownContext.js +0 -3
  14. package/lib/commonjs/Header/HeaderShownContext.js.map +1 -1
  15. package/lib/commonjs/Header/HeaderTitle.js +0 -8
  16. package/lib/commonjs/Header/HeaderTitle.js.map +1 -1
  17. package/lib/commonjs/Header/getDefaultHeaderHeight.js +0 -4
  18. package/lib/commonjs/Header/getDefaultHeaderHeight.js.map +1 -1
  19. package/lib/commonjs/Header/getHeaderTitle.js +0 -1
  20. package/lib/commonjs/Header/getHeaderTitle.js.map +1 -1
  21. package/lib/commonjs/Header/useHeaderHeight.js +0 -8
  22. package/lib/commonjs/Header/useHeaderHeight.js.map +1 -1
  23. package/lib/commonjs/MaskedView.android.js +0 -2
  24. package/lib/commonjs/MaskedView.android.js.map +1 -1
  25. package/lib/commonjs/MaskedView.ios.js +0 -2
  26. package/lib/commonjs/MaskedView.ios.js.map +1 -1
  27. package/lib/commonjs/MaskedView.js +1 -1
  28. package/lib/commonjs/MaskedView.js.map +1 -1
  29. package/lib/commonjs/MaskedViewNative.js +3 -11
  30. package/lib/commonjs/MaskedViewNative.js.map +1 -1
  31. package/lib/commonjs/MissingIcon.js +0 -6
  32. package/lib/commonjs/MissingIcon.js.map +1 -1
  33. package/lib/commonjs/PlatformPressable.js +1 -14
  34. package/lib/commonjs/PlatformPressable.js.map +1 -1
  35. package/lib/commonjs/ResourceSavingView.js +6 -12
  36. package/lib/commonjs/ResourceSavingView.js.map +1 -1
  37. package/lib/commonjs/SafeAreaProviderCompat.js +3 -13
  38. package/lib/commonjs/SafeAreaProviderCompat.js.map +1 -1
  39. package/lib/commonjs/Screen.js +1 -14
  40. package/lib/commonjs/Screen.js.map +1 -1
  41. package/lib/commonjs/getNamedContext.js +1 -10
  42. package/lib/commonjs/getNamedContext.js.map +1 -1
  43. package/lib/commonjs/index.js +4 -22
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/commonjs/types.js.map +1 -1
  46. package/lib/module/Background.js +0 -1
  47. package/lib/module/Background.js.map +1 -1
  48. package/lib/module/Header/Header.js +3 -8
  49. package/lib/module/Header/Header.js.map +1 -1
  50. package/lib/module/Header/HeaderBackButton.js +4 -12
  51. package/lib/module/Header/HeaderBackButton.js.map +1 -1
  52. package/lib/module/Header/HeaderBackContext.js.map +1 -1
  53. package/lib/module/Header/HeaderBackground.js +0 -1
  54. package/lib/module/Header/HeaderBackground.js.map +1 -1
  55. package/lib/module/Header/HeaderHeightContext.js.map +1 -1
  56. package/lib/module/Header/HeaderShownContext.js.map +1 -1
  57. package/lib/module/Header/HeaderTitle.js +0 -1
  58. package/lib/module/Header/HeaderTitle.js.map +1 -1
  59. package/lib/module/Header/getDefaultHeaderHeight.js +0 -2
  60. package/lib/module/Header/getDefaultHeaderHeight.js.map +1 -1
  61. package/lib/module/Header/getHeaderTitle.js.map +1 -1
  62. package/lib/module/Header/useHeaderHeight.js +0 -2
  63. package/lib/module/Header/useHeaderHeight.js.map +1 -1
  64. package/lib/module/MaskedView.android.js.map +1 -1
  65. package/lib/module/MaskedView.ios.js.map +1 -1
  66. package/lib/module/MaskedView.js +1 -0
  67. package/lib/module/MaskedView.js.map +1 -1
  68. package/lib/module/MaskedViewNative.js +2 -5
  69. package/lib/module/MaskedViewNative.js.map +1 -1
  70. package/lib/module/MissingIcon.js.map +1 -1
  71. package/lib/module/PlatformPressable.js +1 -7
  72. package/lib/module/PlatformPressable.js.map +1 -1
  73. package/lib/module/ResourceSavingView.js +6 -6
  74. package/lib/module/ResourceSavingView.js.map +1 -1
  75. package/lib/module/SafeAreaProviderCompat.js +3 -3
  76. package/lib/module/SafeAreaProviderCompat.js.map +1 -1
  77. package/lib/module/Screen.js +1 -1
  78. package/lib/module/Screen.js.map +1 -1
  79. package/lib/module/getNamedContext.js +1 -5
  80. package/lib/module/getNamedContext.js.map +1 -1
  81. package/lib/module/index.js +4 -2
  82. package/lib/module/index.js.map +1 -1
  83. package/lib/module/types.js.map +1 -1
  84. package/lib/typescript/src/Background.d.ts +1 -0
  85. package/lib/typescript/src/Background.d.ts.map +1 -0
  86. package/lib/typescript/src/Header/Header.d.ts +1 -0
  87. package/lib/typescript/src/Header/Header.d.ts.map +1 -0
  88. package/lib/typescript/src/Header/HeaderBackButton.d.ts +1 -0
  89. package/lib/typescript/src/Header/HeaderBackButton.d.ts.map +1 -0
  90. package/lib/typescript/src/Header/HeaderBackContext.d.ts +1 -0
  91. package/lib/typescript/src/Header/HeaderBackContext.d.ts.map +1 -0
  92. package/lib/typescript/src/Header/HeaderBackground.d.ts +1 -0
  93. package/lib/typescript/src/Header/HeaderBackground.d.ts.map +1 -0
  94. package/lib/typescript/src/Header/HeaderHeightContext.d.ts +1 -0
  95. package/lib/typescript/src/Header/HeaderHeightContext.d.ts.map +1 -0
  96. package/lib/typescript/src/Header/HeaderShownContext.d.ts +1 -0
  97. package/lib/typescript/src/Header/HeaderShownContext.d.ts.map +1 -0
  98. package/lib/typescript/src/Header/HeaderTitle.d.ts +1 -0
  99. package/lib/typescript/src/Header/HeaderTitle.d.ts.map +1 -0
  100. package/lib/typescript/src/Header/getDefaultHeaderHeight.d.ts +1 -0
  101. package/lib/typescript/src/Header/getDefaultHeaderHeight.d.ts.map +1 -0
  102. package/lib/typescript/src/Header/getHeaderTitle.d.ts +1 -0
  103. package/lib/typescript/src/Header/getHeaderTitle.d.ts.map +1 -0
  104. package/lib/typescript/src/Header/useHeaderHeight.d.ts +1 -0
  105. package/lib/typescript/src/Header/useHeaderHeight.d.ts.map +1 -0
  106. package/lib/typescript/src/MaskedView.android.d.ts +1 -0
  107. package/lib/typescript/src/MaskedView.android.d.ts.map +1 -0
  108. package/lib/typescript/src/MaskedView.d.ts +1 -0
  109. package/lib/typescript/src/MaskedView.d.ts.map +1 -0
  110. package/lib/typescript/src/MaskedView.ios.d.ts +1 -0
  111. package/lib/typescript/src/MaskedView.ios.d.ts.map +1 -0
  112. package/lib/typescript/src/MaskedViewNative.d.ts +1 -0
  113. package/lib/typescript/src/MaskedViewNative.d.ts.map +1 -0
  114. package/lib/typescript/src/MissingIcon.d.ts +1 -0
  115. package/lib/typescript/src/MissingIcon.d.ts.map +1 -0
  116. package/lib/typescript/src/PlatformPressable.d.ts +1 -0
  117. package/lib/typescript/src/PlatformPressable.d.ts.map +1 -0
  118. package/lib/typescript/src/ResourceSavingView.d.ts +1 -0
  119. package/lib/typescript/src/ResourceSavingView.d.ts.map +1 -0
  120. package/lib/typescript/src/SafeAreaProviderCompat.d.ts +1 -0
  121. package/lib/typescript/src/SafeAreaProviderCompat.d.ts.map +1 -0
  122. package/lib/typescript/src/Screen.d.ts +1 -0
  123. package/lib/typescript/src/Screen.d.ts.map +1 -0
  124. package/lib/typescript/src/getNamedContext.d.ts +1 -0
  125. package/lib/typescript/src/getNamedContext.d.ts.map +1 -0
  126. package/lib/typescript/src/index.d.ts +1 -0
  127. package/lib/typescript/src/index.d.ts.map +1 -0
  128. package/lib/typescript/src/types.d.ts +1 -0
  129. package/lib/typescript/src/types.d.ts.map +1 -0
  130. package/package.json +4 -4
@@ -4,39 +4,31 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = MaskedView;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
11
  /**
17
12
  * The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.
18
13
  */
19
- let RNCMaskedView;
20
14
 
15
+ let RNCMaskedView;
21
16
  try {
22
17
  // Add try/catch to support usage even if it's not installed, since it's optional.
23
18
  // Newer versions of Metro will handle it properly.
24
19
  RNCMaskedView = require('@react-native-masked-view/masked-view').default;
25
- } catch (e) {// Ignore
20
+ } catch (e) {
21
+ // Ignore
26
22
  }
27
-
28
23
  const isMaskedViewAvailable = _reactNative.UIManager.getViewManagerConfig('RNCMaskedView') != null;
29
-
30
24
  function MaskedView(_ref) {
31
25
  let {
32
26
  children,
33
27
  ...rest
34
28
  } = _ref;
35
-
36
29
  if (isMaskedViewAvailable && RNCMaskedView) {
37
30
  return /*#__PURE__*/React.createElement(RNCMaskedView, rest, children);
38
31
  }
39
-
40
32
  return children;
41
33
  }
42
34
  //# sourceMappingURL=MaskedViewNative.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["RNCMaskedView","require","default","e","isMaskedViewAvailable","UIManager","getViewManagerConfig","MaskedView","children","rest"],"sources":["MaskedViewNative.tsx"],"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"],"mappings":";;;;;;;AAGA;;AACA;;;;;;AAJA;AACA;AACA;AAWA,IAAIA,aAAJ;;AAEA,IAAI;EACF;EACA;EACAA,aAAa,GAAGC,OAAO,CAAC,uCAAD,CAAP,CAAiDC,OAAjE;AACD,CAJD,CAIE,OAAOC,CAAP,EAAU,CACV;AACD;;AAED,MAAMC,qBAAqB,GACzBC,sBAAA,CAAUC,oBAAV,CAA+B,eAA/B,KAAmD,IADrD;;AAGe,SAASC,UAAT,OAAkD;EAAA,IAA9B;IAAEC,QAAF;IAAY,GAAGC;EAAf,CAA8B;;EAC/D,IAAIL,qBAAqB,IAAIJ,aAA7B,EAA4C;IAC1C,oBAAO,oBAAC,aAAD,EAAmBS,IAAnB,EAA0BD,QAA1B,CAAP;EACD;;EAED,OAAOA,QAAP;AACD"}
1
+ {"version":3,"names":["RNCMaskedView","require","default","e","isMaskedViewAvailable","UIManager","getViewManagerConfig","MaskedView","children","rest"],"sourceRoot":"../../src","sources":["MaskedViewNative.tsx"],"mappings":";;;;;;AAGA;AACA;AAAyC;AAAA;AAJzC;AACA;AACA;;AAWA,IAAIA,aAAyC;AAE7C,IAAI;EACF;EACA;EACAA,aAAa,GAAGC,OAAO,CAAC,uCAAuC,CAAC,CAACC,OAAO;AAC1E,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,MAAMC,qBAAqB,GACzBC,sBAAS,CAACC,oBAAoB,CAAC,eAAe,CAAC,IAAI,IAAI;AAE1C,SAASC,UAAU,OAA+B;EAAA,IAA9B;IAAEC,QAAQ;IAAE,GAAGC;EAAY,CAAC;EAC7D,IAAIL,qBAAqB,IAAIJ,aAAa,EAAE;IAC1C,oBAAO,oBAAC,aAAa,EAAKS,IAAI,EAAGD,QAAQ,CAAiB;EAC5D;EAEA,OAAOA,QAAQ;AACjB"}
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = MissingIcon;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
11
  function MissingIcon(_ref) {
17
12
  let {
18
13
  color,
@@ -26,7 +21,6 @@ function MissingIcon(_ref) {
26
21
  }, style]
27
22
  }, "\u23F7");
28
23
  }
29
-
30
24
  const styles = _reactNative.StyleSheet.create({
31
25
  icon: {
32
26
  backgroundColor: 'transparent'
@@ -1 +1 @@
1
- {"version":3,"names":["MissingIcon","color","size","style","styles","icon","fontSize","StyleSheet","create","backgroundColor"],"sources":["MissingIcon.tsx"],"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"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAQe,SAASA,WAAT,OAAoD;EAAA,IAA/B;IAAEC,KAAF;IAASC,IAAT;IAAeC;EAAf,CAA+B;EACjE,oBAAO,oBAAC,iBAAD;IAAM,KAAK,EAAE,CAACC,MAAM,CAACC,IAAR,EAAc;MAAEJ,KAAF;MAASK,QAAQ,EAAEJ;IAAnB,CAAd,EAAyCC,KAAzC;EAAb,YAAP;AACD;;AAED,MAAMC,MAAM,GAAGG,uBAAA,CAAWC,MAAX,CAAkB;EAC/BH,IAAI,EAAE;IACJI,eAAe,EAAE;EADb;AADyB,CAAlB,CAAf"}
1
+ {"version":3,"names":["MissingIcon","color","size","style","styles","icon","fontSize","StyleSheet","create","backgroundColor"],"sourceRoot":"../../src","sources":["MissingIcon.tsx"],"mappings":";;;;;;AAAA;AACA;AAAsE;AAAA;AAQvD,SAASA,WAAW,OAAgC;EAAA,IAA/B;IAAEC,KAAK;IAAEC,IAAI;IAAEC;EAAa,CAAC;EAC/D,oBAAO,oBAAC,iBAAI;IAAC,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAE;MAAEJ,KAAK;MAAEK,QAAQ,EAAEJ;IAAK,CAAC,EAAEC,KAAK;EAAE,YAAS;AAC/E;AAEA,MAAMC,MAAM,GAAGG,uBAAU,CAACC,MAAM,CAAC;EAC/BH,IAAI,EAAE;IACJI,eAAe,EAAE;EACnB;AACF,CAAC,CAAC"}
@@ -4,27 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = PlatformPressable;
7
-
8
7
  var _native = require("@react-navigation/native");
9
-
10
8
  var React = _interopRequireWildcard(require("react"));
11
-
12
9
  var _reactNative = require("react-native");
13
-
14
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
-
18
12
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
19
-
20
13
  const AnimatedPressable = _reactNative.Animated.createAnimatedComponent(_reactNative.Pressable);
21
-
22
14
  const ANDROID_VERSION_LOLLIPOP = 21;
23
15
  const ANDROID_SUPPORTS_RIPPLE = _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= ANDROID_VERSION_LOLLIPOP;
16
+
24
17
  /**
25
18
  * PlatformPressable provides an abstraction on top of Pressable to handle platform differences.
26
19
  */
27
-
28
20
  function PlatformPressable(_ref) {
29
21
  let {
30
22
  onPressIn,
@@ -39,12 +31,10 @@ function PlatformPressable(_ref) {
39
31
  dark
40
32
  } = (0, _native.useTheme)();
41
33
  const [opacity] = React.useState(() => new _reactNative.Animated.Value(1));
42
-
43
34
  const animateTo = (toValue, duration) => {
44
35
  if (ANDROID_SUPPORTS_RIPPLE) {
45
36
  return;
46
37
  }
47
-
48
38
  _reactNative.Animated.timing(opacity, {
49
39
  toValue,
50
40
  duration,
@@ -52,17 +42,14 @@ function PlatformPressable(_ref) {
52
42
  useNativeDriver: true
53
43
  }).start();
54
44
  };
55
-
56
45
  const handlePressIn = e => {
57
46
  animateTo(pressOpacity, 0);
58
47
  onPressIn === null || onPressIn === void 0 ? void 0 : onPressIn(e);
59
48
  };
60
-
61
49
  const handlePressOut = e => {
62
50
  animateTo(1, 200);
63
51
  onPressOut === null || onPressOut === void 0 ? void 0 : onPressOut(e);
64
52
  };
65
-
66
53
  return /*#__PURE__*/React.createElement(AnimatedPressable, _extends({
67
54
  onPressIn: handlePressIn,
68
55
  onPressOut: handlePressOut,
@@ -1 +1 @@
1
- {"version":3,"names":["AnimatedPressable","Animated","createAnimatedComponent","Pressable","ANDROID_VERSION_LOLLIPOP","ANDROID_SUPPORTS_RIPPLE","Platform","OS","Version","PlatformPressable","onPressIn","onPressOut","android_ripple","pressColor","pressOpacity","style","rest","dark","useTheme","opacity","React","useState","Value","animateTo","toValue","duration","timing","easing","Easing","inOut","quad","useNativeDriver","start","handlePressIn","e","handlePressOut","color","undefined"],"sources":["PlatformPressable.tsx"],"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"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAkBA,MAAMA,iBAAiB,GAAGC,qBAAA,CAASC,uBAAT,CAAiCC,sBAAjC,CAA1B;;AAEA,MAAMC,wBAAwB,GAAG,EAAjC;AACA,MAAMC,uBAAuB,GAC3BC,qBAAA,CAASC,EAAT,KAAgB,SAAhB,IAA6BD,qBAAA,CAASE,OAAT,IAAoBJ,wBADnD;AAGA;AACA;AACA;;AACe,SAASK,iBAAT,OAQL;EAAA,IARgC;IACxCC,SADwC;IAExCC,UAFwC;IAGxCC,cAHwC;IAIxCC,UAJwC;IAKxCC,YAAY,GAAG,GALyB;IAMxCC,KANwC;IAOxC,GAAGC;EAPqC,CAQhC;EACR,MAAM;IAAEC;EAAF,IAAW,IAAAC,gBAAA,GAAjB;EACA,MAAM,CAACC,OAAD,IAAYC,KAAK,CAACC,QAAN,CAAe,MAAM,IAAIpB,qBAAA,CAASqB,KAAb,CAAmB,CAAnB,CAArB,CAAlB;;EAEA,MAAMC,SAAS,GAAG,CAACC,OAAD,EAAkBC,QAAlB,KAAuC;IACvD,IAAIpB,uBAAJ,EAA6B;MAC3B;IACD;;IAEDJ,qBAAA,CAASyB,MAAT,CAAgBP,OAAhB,EAAyB;MACvBK,OADuB;MAEvBC,QAFuB;MAGvBE,MAAM,EAAEC,mBAAA,CAAOC,KAAP,CAAaD,mBAAA,CAAOE,IAApB,CAHe;MAIvBC,eAAe,EAAE;IAJM,CAAzB,EAKGC,KALH;EAMD,CAXD;;EAaA,MAAMC,aAAa,GAAIC,CAAD,IAA8B;IAClDX,SAAS,CAACT,YAAD,EAAe,CAAf,CAAT;IACAJ,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAGwB,CAAH,CAAT;EACD,CAHD;;EAKA,MAAMC,cAAc,GAAID,CAAD,IAA8B;IACnDX,SAAS,CAAC,CAAD,EAAI,GAAJ,CAAT;IACAZ,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAGuB,CAAH,CAAV;EACD,CAHD;;EAKA,oBACE,oBAAC,iBAAD;IACE,SAAS,EAAED,aADb;IAEE,UAAU,EAAEE,cAFd;IAGE,cAAc,EACZ9B,uBAAuB,GACnB;MACE+B,KAAK,EACHvB,UAAU,KAAKwB,SAAf,GACIxB,UADJ,GAEII,IAAI,GACJ,0BADI,GAEJ,oBANR;MAOE,GAAGL;IAPL,CADmB,GAUnByB,SAdR;IAgBE,KAAK,EAAE,CAAC;MAAElB,OAAO,EAAE,CAACd,uBAAD,GAA2Bc,OAA3B,GAAqC;IAAhD,CAAD,EAAsDJ,KAAtD;EAhBT,GAiBMC,IAjBN,EADF;AAqBD"}
1
+ {"version":3,"names":["AnimatedPressable","Animated","createAnimatedComponent","Pressable","ANDROID_VERSION_LOLLIPOP","ANDROID_SUPPORTS_RIPPLE","Platform","OS","Version","PlatformPressable","onPressIn","onPressOut","android_ripple","pressColor","pressOpacity","style","rest","dark","useTheme","opacity","React","useState","Value","animateTo","toValue","duration","timing","easing","Easing","inOut","quad","useNativeDriver","start","handlePressIn","e","handlePressOut","color","undefined"],"sourceRoot":"../../src","sources":["PlatformPressable.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AASsB;AAAA;AAAA;AAStB,MAAMA,iBAAiB,GAAGC,qBAAQ,CAACC,uBAAuB,CAACC,sBAAS,CAAC;AAErE,MAAMC,wBAAwB,GAAG,EAAE;AACnC,MAAMC,uBAAuB,GAC3BC,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAID,qBAAQ,CAACE,OAAO,IAAIJ,wBAAwB;;AAE3E;AACA;AACA;AACe,SAASK,iBAAiB,OAQ/B;EAAA,IARgC;IACxCC,SAAS;IACTC,UAAU;IACVC,cAAc;IACdC,UAAU;IACVC,YAAY,GAAG,GAAG;IAClBC,KAAK;IACL,GAAGC;EACE,CAAC;EACN,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,gBAAQ,GAAE;EAC3B,MAAM,CAACC,OAAO,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,MAAM,IAAIpB,qBAAQ,CAACqB,KAAK,CAAC,CAAC,CAAC,CAAC;EAE7D,MAAMC,SAAS,GAAG,CAACC,OAAe,EAAEC,QAAgB,KAAK;IACvD,IAAIpB,uBAAuB,EAAE;MAC3B;IACF;IAEAJ,qBAAQ,CAACyB,MAAM,CAACP,OAAO,EAAE;MACvBK,OAAO;MACPC,QAAQ;MACRE,MAAM,EAAEC,mBAAM,CAACC,KAAK,CAACD,mBAAM,CAACE,IAAI,CAAC;MACjCC,eAAe,EAAE;IACnB,CAAC,CAAC,CAACC,KAAK,EAAE;EACZ,CAAC;EAED,MAAMC,aAAa,GAAIC,CAAwB,IAAK;IAClDX,SAAS,CAACT,YAAY,EAAE,CAAC,CAAC;IAC1BJ,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAGwB,CAAC,CAAC;EAChB,CAAC;EAED,MAAMC,cAAc,GAAID,CAAwB,IAAK;IACnDX,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC;IACjBZ,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAGuB,CAAC,CAAC;EACjB,CAAC;EAED,oBACE,oBAAC,iBAAiB;IAChB,SAAS,EAAED,aAAc;IACzB,UAAU,EAAEE,cAAe;IAC3B,cAAc,EACZ9B,uBAAuB,GACnB;MACE+B,KAAK,EACHvB,UAAU,KAAKwB,SAAS,GACpBxB,UAAU,GACVI,IAAI,GACJ,0BAA0B,GAC1B,oBAAoB;MAC1B,GAAGL;IACL,CAAC,GACDyB,SACL;IACD,KAAK,EAAE,CAAC;MAAElB,OAAO,EAAE,CAACd,uBAAuB,GAAGc,OAAO,GAAG;IAAE,CAAC,EAAEJ,KAAK;EAAE,GAChEC,IAAI,EACR;AAEN"}
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = ResourceSavingScene;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
11
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
17
-
18
12
  const FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container
19
13
 
20
14
  function ResourceSavingScene(_ref) {
@@ -24,9 +18,9 @@ function ResourceSavingScene(_ref) {
24
18
  style,
25
19
  ...rest
26
20
  } = _ref;
27
-
28
21
  if (_reactNative.Platform.OS === 'web') {
29
- return /*#__PURE__*/React.createElement(_reactNative.View // @ts-expect-error: hidden exists on web, but not in React Native
22
+ return /*#__PURE__*/React.createElement(_reactNative.View
23
+ // @ts-expect-error: hidden exists on web, but not in React Native
30
24
  , _extends({
31
25
  hidden: !visible,
32
26
  style: [{
@@ -35,21 +29,21 @@ function ResourceSavingScene(_ref) {
35
29
  pointerEvents: visible ? 'auto' : 'none'
36
30
  }, rest), children);
37
31
  }
38
-
39
32
  return /*#__PURE__*/React.createElement(_reactNative.View, {
40
- style: [styles.container, style] // box-none doesn't seem to work properly on Android
33
+ style: [styles.container, style]
34
+ // box-none doesn't seem to work properly on Android
41
35
  ,
42
36
  pointerEvents: visible ? 'auto' : 'none'
43
37
  }, /*#__PURE__*/React.createElement(_reactNative.View, {
44
38
  collapsable: false,
45
- removeClippedSubviews: // On iOS & macOS, set removeClippedSubviews to true only when not focused
39
+ removeClippedSubviews:
40
+ // On iOS & macOS, set removeClippedSubviews to true only when not focused
46
41
  // This is an workaround for a bug where the clipped view never re-appears
47
42
  _reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'macos' ? !visible : true,
48
43
  pointerEvents: visible ? 'auto' : 'none',
49
44
  style: visible ? styles.attached : styles.detached
50
45
  }, children));
51
46
  }
52
-
53
47
  const styles = _reactNative.StyleSheet.create({
54
48
  container: {
55
49
  flex: 1,
@@ -1 +1 @@
1
- {"version":3,"names":["FAR_FAR_AWAY","ResourceSavingScene","visible","children","style","rest","Platform","OS","display","styles","container","attached","detached","StyleSheet","create","flex","overflow","top"],"sources":["ResourceSavingView.tsx"],"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"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;AAQA,MAAMA,YAAY,GAAG,KAArB,C,CAA4B;;AAEb,SAASC,mBAAT,OAKL;EAAA,IALkC;IAC1CC,OAD0C;IAE1CC,QAF0C;IAG1CC,KAH0C;IAI1C,GAAGC;EAJuC,CAKlC;;EACR,IAAIC,qBAAA,CAASC,EAAT,KAAgB,KAApB,EAA2B;IACzB,oBACE,oBAAC,iBAAD,CACE;IADF;MAEE,MAAM,EAAE,CAACL,OAFX;MAGE,KAAK,EAAE,CACL;QAAEM,OAAO,EAAEN,OAAO,GAAG,MAAH,GAAY;MAA9B,CADK,EAELO,MAAM,CAACC,SAFF,EAGLN,KAHK,CAHT;MAQE,aAAa,EAAEF,OAAO,GAAG,MAAH,GAAY;IARpC,GASMG,IATN,GAWGF,QAXH,CADF;EAeD;;EAED,oBACE,oBAAC,iBAAD;IACE,KAAK,EAAE,CAACM,MAAM,CAACC,SAAR,EAAmBN,KAAnB,CADT,CAEE;IAFF;IAGE,aAAa,EAAEF,OAAO,GAAG,MAAH,GAAY;EAHpC,gBAKE,oBAAC,iBAAD;IACE,WAAW,EAAE,KADf;IAEE,qBAAqB,EACnB;IACA;IACAI,qBAAA,CAASC,EAAT,KAAgB,KAAhB,IAAyBD,qBAAA,CAASC,EAAT,KAAgB,OAAzC,GAAmD,CAACL,OAApD,GAA8D,IALlE;IAOE,aAAa,EAAEA,OAAO,GAAG,MAAH,GAAY,MAPpC;IAQE,KAAK,EAAEA,OAAO,GAAGO,MAAM,CAACE,QAAV,GAAqBF,MAAM,CAACG;EAR5C,GAUGT,QAVH,CALF,CADF;AAoBD;;AAED,MAAMM,MAAM,GAAGI,uBAAA,CAAWC,MAAX,CAAkB;EAC/BJ,SAAS,EAAE;IACTK,IAAI,EAAE,CADG;IAETC,QAAQ,EAAE;EAFD,CADoB;EAK/BL,QAAQ,EAAE;IACRI,IAAI,EAAE;EADE,CALqB;EAQ/BH,QAAQ,EAAE;IACRG,IAAI,EAAE,CADE;IAERE,GAAG,EAAEjB;EAFG;AARqB,CAAlB,CAAf"}
1
+ {"version":3,"names":["FAR_FAR_AWAY","ResourceSavingScene","visible","children","style","rest","Platform","OS","display","styles","container","attached","detached","StyleSheet","create","flex","overflow","top"],"sourceRoot":"../../src","sources":["ResourceSavingView.tsx"],"mappings":";;;;;;AAAA;AACA;AAAgF;AAAA;AAAA;AAQhF,MAAMA,YAAY,GAAG,KAAK,CAAC,CAAC;;AAEb,SAASC,mBAAmB,OAKjC;EAAA,IALkC;IAC1CC,OAAO;IACPC,QAAQ;IACRC,KAAK;IACL,GAAGC;EACE,CAAC;EACN,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,oBACE,oBAAC;IACC;IAAA;MACA,MAAM,EAAE,CAACL,OAAQ;MACjB,KAAK,EAAE,CACL;QAAEM,OAAO,EAAEN,OAAO,GAAG,MAAM,GAAG;MAAO,CAAC,EACtCO,MAAM,CAACC,SAAS,EAChBN,KAAK,CACL;MACF,aAAa,EAAEF,OAAO,GAAG,MAAM,GAAG;IAAO,GACrCG,IAAI,GAEPF,QAAQ,CACJ;EAEX;EAEA,oBACE,oBAAC,iBAAI;IACH,KAAK,EAAE,CAACM,MAAM,CAACC,SAAS,EAAEN,KAAK;IAC/B;IAAA;IACA,aAAa,EAAEF,OAAO,GAAG,MAAM,GAAG;EAAO,gBAEzC,oBAAC,iBAAI;IACH,WAAW,EAAE,KAAM;IACnB,qBAAqB;IACnB;IACA;IACAI,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAID,qBAAQ,CAACC,EAAE,KAAK,OAAO,GAAG,CAACL,OAAO,GAAG,IAC/D;IACD,aAAa,EAAEA,OAAO,GAAG,MAAM,GAAG,MAAO;IACzC,KAAK,EAAEA,OAAO,GAAGO,MAAM,CAACE,QAAQ,GAAGF,MAAM,CAACG;EAAS,GAElDT,QAAQ,CACJ,CACF;AAEX;AAEA,MAAMM,MAAM,GAAGI,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IACTK,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE;EACZ,CAAC;EACDL,QAAQ,EAAE;IACRI,IAAI,EAAE;EACR,CAAC;EACDH,QAAQ,EAAE;IACRG,IAAI,EAAE,CAAC;IACPE,GAAG,EAAEjB;EACP;AACF,CAAC,CAAC"}
@@ -4,25 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = SafeAreaProviderCompat;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
13
-
14
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
-
18
12
  const {
19
13
  width = 0,
20
14
  height = 0
21
- } = _reactNative.Dimensions.get('window'); // To support SSR on web, we need to have empty insets for initial values
15
+ } = _reactNative.Dimensions.get('window');
16
+
17
+ // To support SSR on web, we need to have empty insets for initial values
22
18
  // Otherwise there can be mismatch between SSR and client output
23
19
  // We also need to specify empty values to support tests environments
24
-
25
-
26
20
  const initialMetrics = _reactNative.Platform.OS === 'web' || _reactNativeSafeAreaContext.initialWindowMetrics == null ? {
27
21
  frame: {
28
22
  x: 0,
@@ -37,7 +31,6 @@ const initialMetrics = _reactNative.Platform.OS === 'web' || _reactNativeSafeAre
37
31
  bottom: 0
38
32
  }
39
33
  } : _reactNativeSafeAreaContext.initialWindowMetrics;
40
-
41
34
  function SafeAreaProviderCompat(_ref) {
42
35
  let {
43
36
  children,
@@ -52,16 +45,13 @@ function SafeAreaProviderCompat(_ref) {
52
45
  style: [styles.container, style]
53
46
  }, children);
54
47
  }
55
-
56
48
  return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaProvider, {
57
49
  initialMetrics: initialMetrics,
58
50
  style: style
59
51
  }, children);
60
52
  });
61
53
  }
62
-
63
54
  SafeAreaProviderCompat.initialMetrics = initialMetrics;
64
-
65
55
  const styles = _reactNative.StyleSheet.create({
66
56
  container: {
67
57
  flex: 1
@@ -1 +1 @@
1
- {"version":3,"names":["width","height","Dimensions","get","initialMetrics","Platform","OS","initialWindowMetrics","frame","x","y","insets","top","left","right","bottom","SafeAreaProviderCompat","children","style","styles","container","StyleSheet","create","flex"],"sources":["SafeAreaProviderCompat.tsx"],"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"],"mappings":";;;;;;;AAAA;;AACA;;AAQA;;;;;;AAWA,MAAM;EAAEA,KAAK,GAAG,CAAV;EAAaC,MAAM,GAAG;AAAtB,IAA4BC,uBAAA,CAAWC,GAAX,CAAe,QAAf,CAAlC,C,CAEA;AACA;AACA;;;AACA,MAAMC,cAAc,GAClBC,qBAAA,CAASC,EAAT,KAAgB,KAAhB,IAAyBC,gDAAA,IAAwB,IAAjD,GACI;EACEC,KAAK,EAAE;IAAEC,CAAC,EAAE,CAAL;IAAQC,CAAC,EAAE,CAAX;IAAcV,KAAd;IAAqBC;EAArB,CADT;EAEEU,MAAM,EAAE;IAAEC,GAAG,EAAE,CAAP;IAAUC,IAAI,EAAE,CAAhB;IAAmBC,KAAK,EAAE,CAA1B;IAA6BC,MAAM,EAAE;EAArC;AAFV,CADJ,GAKIR,gDANN;;AAQe,SAASS,sBAAT,OAA4D;EAAA,IAA5B;IAAEC,QAAF;IAAYC;EAAZ,CAA4B;EACzE,oBACE,oBAAC,iDAAD,CAAuB,QAAvB,QACIP,MAAD,IAAY;IACX,IAAIA,MAAJ,EAAY;MACV;MACA;MACA;MACA,oBAAO,oBAAC,iBAAD;QAAM,KAAK,EAAE,CAACQ,MAAM,CAACC,SAAR,EAAmBF,KAAnB;MAAb,GAAyCD,QAAzC,CAAP;IACD;;IAED,oBACE,oBAAC,4CAAD;MAAkB,cAAc,EAAEb,cAAlC;MAAkD,KAAK,EAAEc;IAAzD,GACGD,QADH,CADF;EAKD,CAdH,CADF;AAkBD;;AAEDD,sBAAsB,CAACZ,cAAvB,GAAwCA,cAAxC;;AAEA,MAAMe,MAAM,GAAGE,uBAAA,CAAWC,MAAX,CAAkB;EAC/BF,SAAS,EAAE;IACTG,IAAI,EAAE;EADG;AADoB,CAAlB,CAAf"}
1
+ {"version":3,"names":["width","height","Dimensions","get","initialMetrics","Platform","OS","initialWindowMetrics","frame","x","y","insets","top","left","right","bottom","SafeAreaProviderCompat","children","style","styles","container","StyleSheet","create","flex"],"sourceRoot":"../../src","sources":["SafeAreaProviderCompat.tsx"],"mappings":";;;;;;AAAA;AACA;AAQA;AAIwC;AAAA;AAOxC,MAAM;EAAEA,KAAK,GAAG,CAAC;EAAEC,MAAM,GAAG;AAAE,CAAC,GAAGC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC;;AAE1D;AACA;AACA;AACA,MAAMC,cAAc,GAClBC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAIC,gDAAoB,IAAI,IAAI,GACjD;EACEC,KAAK,EAAE;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEV,KAAK;IAAEC;EAAO,CAAC;EACpCU,MAAM,EAAE;IAAEC,GAAG,EAAE,CAAC;IAAEC,IAAI,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE;AACjD,CAAC,GACDR,gDAAoB;AAEX,SAASS,sBAAsB,OAA6B;EAAA,IAA5B;IAAEC,QAAQ;IAAEC;EAAa,CAAC;EACvE,oBACE,oBAAC,iDAAqB,CAAC,QAAQ,QAC3BP,MAAM,IAAK;IACX,IAAIA,MAAM,EAAE;MACV;MACA;MACA;MACA,oBAAO,oBAAC,iBAAI;QAAC,KAAK,EAAE,CAACQ,MAAM,CAACC,SAAS,EAAEF,KAAK;MAAE,GAAED,QAAQ,CAAQ;IAClE;IAEA,oBACE,oBAAC,4CAAgB;MAAC,cAAc,EAAEb,cAAe;MAAC,KAAK,EAAEc;IAAM,GAC5DD,QAAQ,CACQ;EAEvB,CAAC,CAC8B;AAErC;AAEAD,sBAAsB,CAACZ,cAAc,GAAGA,cAAc;AAEtD,MAAMe,MAAM,GAAGE,uBAAU,CAACC,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
@@ -4,29 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = Screen;
7
-
8
7
  var _native = require("@react-navigation/native");
9
-
10
8
  var React = _interopRequireWildcard(require("react"));
11
-
12
9
  var _reactNative = require("react-native");
13
-
14
10
  var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
15
-
16
11
  var _Background = _interopRequireDefault(require("./Background"));
17
-
18
12
  var _getDefaultHeaderHeight = _interopRequireDefault(require("./Header/getDefaultHeaderHeight"));
19
-
20
13
  var _HeaderHeightContext = _interopRequireDefault(require("./Header/HeaderHeightContext"));
21
-
22
14
  var _HeaderShownContext = _interopRequireDefault(require("./Header/HeaderShownContext"));
23
-
24
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
-
28
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
-
30
18
  function Screen(props) {
31
19
  const dimensions = (0, _reactNativeSafeAreaContext.useSafeAreaFrame)();
32
20
  const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
@@ -54,7 +42,7 @@ function Screen(props) {
54
42
  }, /*#__PURE__*/React.createElement(_HeaderShownContext.default.Provider, {
55
43
  value: isParentHeaderShown || headerShown !== false
56
44
  }, /*#__PURE__*/React.createElement(_HeaderHeightContext.default.Provider, {
57
- value: headerShown ? headerHeight : parentHeaderHeight !== null && parentHeaderHeight !== void 0 ? parentHeaderHeight : 0
45
+ value: headerShown ? headerHeight : parentHeaderHeight ?? 0
58
46
  }, children))), headerShown ? /*#__PURE__*/React.createElement(_native.NavigationContext.Provider, {
59
47
  value: navigation
60
48
  }, /*#__PURE__*/React.createElement(_native.NavigationRouteContext.Provider, {
@@ -69,7 +57,6 @@ function Screen(props) {
69
57
  style: headerTransparent ? styles.absolute : null
70
58
  }, header))) : null);
71
59
  }
72
-
73
60
  const styles = _reactNative.StyleSheet.create({
74
61
  container: {
75
62
  flex: 1,
@@ -1 +1 @@
1
- {"version":3,"names":["Screen","props","dimensions","useSafeAreaFrame","insets","useSafeAreaInsets","isParentHeaderShown","React","useContext","HeaderShownContext","parentHeaderHeight","HeaderHeightContext","focused","modal","header","headerShown","headerTransparent","headerStatusBarHeight","top","navigation","route","children","style","headerHeight","setHeaderHeight","useState","getDefaultHeaderHeight","styles","container","content","e","height","nativeEvent","layout","absolute","StyleSheet","create","flex","flexDirection","position","left","right"],"sources":["Screen.tsx"],"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"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;;;;;;;AAee,SAASA,MAAT,CAAgBC,KAAhB,EAA8B;EAC3C,MAAMC,UAAU,GAAG,IAAAC,4CAAA,GAAnB;EACA,MAAMC,MAAM,GAAG,IAAAC,6CAAA,GAAf;EAEA,MAAMC,mBAAmB,GAAGC,KAAK,CAACC,UAAN,CAAiBC,2BAAjB,CAA5B;EACA,MAAMC,kBAAkB,GAAGH,KAAK,CAACC,UAAN,CAAiBG,4BAAjB,CAA3B;EAEA,MAAM;IACJC,OADI;IAEJC,KAAK,GAAG,KAFJ;IAGJC,MAHI;IAIJC,WAAW,GAAG,IAJV;IAKJC,iBALI;IAMJC,qBAAqB,GAAGX,mBAAmB,GAAG,CAAH,GAAOF,MAAM,CAACc,GANrD;IAOJC,UAPI;IAQJC,KARI;IASJC,QATI;IAUJC;EAVI,IAWFrB,KAXJ;EAaA,MAAM,CAACsB,YAAD,EAAeC,eAAf,IAAkCjB,KAAK,CAACkB,QAAN,CAAe,MACrD,IAAAC,+BAAA,EAAuBxB,UAAvB,EAAmCW,KAAnC,EAA0CI,qBAA1C,CADsC,CAAxC;EAIA,oBACE,oBAAC,mBAAD;IACE,2BAA2B,EAAE,CAACL,OADhC;IAEE,yBAAyB,EAAEA,OAAO,GAAG,MAAH,GAAY,qBAFhD;IAGE,KAAK,EAAE,CAACe,MAAM,CAACC,SAAR,EAAmBN,KAAnB;EAHT,gBAKE,oBAAC,iBAAD;IAAM,KAAK,EAAEK,MAAM,CAACE;EAApB,gBACE,oBAAC,2BAAD,CAAoB,QAApB;IACE,KAAK,EAAEvB,mBAAmB,IAAIS,WAAW,KAAK;EADhD,gBAGE,oBAAC,4BAAD,CAAqB,QAArB;IACE,KAAK,EAAEA,WAAW,GAAGQ,YAAH,GAAkBb,kBAAlB,aAAkBA,kBAAlB,cAAkBA,kBAAlB,GAAwC;EAD5D,GAGGW,QAHH,CAHF,CADF,CALF,EAgBGN,WAAW,gBACV,oBAAC,yBAAD,CAAmB,QAAnB;IAA4B,KAAK,EAAEI;EAAnC,gBACE,oBAAC,8BAAD,CAAwB,QAAxB;IAAiC,KAAK,EAAEC;EAAxC,gBACE,oBAAC,iBAAD;IACE,QAAQ,EAAGU,CAAD,IAAO;MACf,MAAM;QAAEC;MAAF,IAAaD,CAAC,CAACE,WAAF,CAAcC,MAAjC;MAEAT,eAAe,CAACO,MAAD,CAAf;IACD,CALH;IAME,KAAK,EAAEf,iBAAiB,GAAGW,MAAM,CAACO,QAAV,GAAqB;EAN/C,GAQGpB,MARH,CADF,CADF,CADU,GAeR,IA/BN,CADF;AAmCD;;AAED,MAAMa,MAAM,GAAGQ,uBAAA,CAAWC,MAAX,CAAkB;EAC/BR,SAAS,EAAE;IACTS,IAAI,EAAE,CADG;IAETC,aAAa,EAAE;EAFN,CADoB;EAK/B;EACAT,OAAO,EAAE;IACPQ,IAAI,EAAE;EADC,CANsB;EAS/BH,QAAQ,EAAE;IACRK,QAAQ,EAAE,UADF;IAERrB,GAAG,EAAE,CAFG;IAGRsB,IAAI,EAAE,CAHE;IAIRC,KAAK,EAAE;EAJC;AATqB,CAAlB,CAAf"}
1
+ {"version":3,"names":["Screen","props","dimensions","useSafeAreaFrame","insets","useSafeAreaInsets","isParentHeaderShown","React","useContext","HeaderShownContext","parentHeaderHeight","HeaderHeightContext","focused","modal","header","headerShown","headerTransparent","headerStatusBarHeight","top","navigation","route","children","style","headerHeight","setHeaderHeight","useState","getDefaultHeaderHeight","styles","container","content","e","height","nativeEvent","layout","absolute","StyleSheet","create","flex","flexDirection","position","left","right"],"sourceRoot":"../../src","sources":["Screen.tsx"],"mappings":";;;;;;AAAA;AAOA;AACA;AACA;AAKA;AACA;AACA;AACA;AAA6D;AAAA;AAAA;AAe9C,SAASA,MAAM,CAACC,KAAY,EAAE;EAC3C,MAAMC,UAAU,GAAG,IAAAC,4CAAgB,GAAE;EACrC,MAAMC,MAAM,GAAG,IAAAC,6CAAiB,GAAE;EAElC,MAAMC,mBAAmB,GAAGC,KAAK,CAACC,UAAU,CAACC,2BAAkB,CAAC;EAChE,MAAMC,kBAAkB,GAAGH,KAAK,CAACC,UAAU,CAACG,4BAAmB,CAAC;EAEhE,MAAM;IACJC,OAAO;IACPC,KAAK,GAAG,KAAK;IACbC,MAAM;IACNC,WAAW,GAAG,IAAI;IAClBC,iBAAiB;IACjBC,qBAAqB,GAAGX,mBAAmB,GAAG,CAAC,GAAGF,MAAM,CAACc,GAAG;IAC5DC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC;EACF,CAAC,GAAGrB,KAAK;EAET,MAAM,CAACsB,YAAY,EAAEC,eAAe,CAAC,GAAGjB,KAAK,CAACkB,QAAQ,CAAC,MACrD,IAAAC,+BAAsB,EAACxB,UAAU,EAAEW,KAAK,EAAEI,qBAAqB,CAAC,CACjE;EAED,oBACE,oBAAC,mBAAU;IACT,2BAA2B,EAAE,CAACL,OAAQ;IACtC,yBAAyB,EAAEA,OAAO,GAAG,MAAM,GAAG,qBAAsB;IACpE,KAAK,EAAE,CAACe,MAAM,CAACC,SAAS,EAAEN,KAAK;EAAE,gBAEjC,oBAAC,iBAAI;IAAC,KAAK,EAAEK,MAAM,CAACE;EAAQ,gBAC1B,oBAAC,2BAAkB,CAAC,QAAQ;IAC1B,KAAK,EAAEvB,mBAAmB,IAAIS,WAAW,KAAK;EAAM,gBAEpD,oBAAC,4BAAmB,CAAC,QAAQ;IAC3B,KAAK,EAAEA,WAAW,GAAGQ,YAAY,GAAGb,kBAAkB,IAAI;EAAE,GAE3DW,QAAQ,CACoB,CACH,CACzB,EACNN,WAAW,gBACV,oBAAC,yBAAiB,CAAC,QAAQ;IAAC,KAAK,EAAEI;EAAW,gBAC5C,oBAAC,8BAAsB,CAAC,QAAQ;IAAC,KAAK,EAAEC;EAAM,gBAC5C,oBAAC,iBAAI;IACH,QAAQ,EAAGU,CAAC,IAAK;MACf,MAAM;QAAEC;MAAO,CAAC,GAAGD,CAAC,CAACE,WAAW,CAACC,MAAM;MAEvCT,eAAe,CAACO,MAAM,CAAC;IACzB,CAAE;IACF,KAAK,EAAEf,iBAAiB,GAAGW,MAAM,CAACO,QAAQ,GAAG;EAAK,GAEjDpB,MAAM,CACF,CACyB,CACP,GAC3B,IAAI,CACG;AAEjB;AAEA,MAAMa,MAAM,GAAGQ,uBAAU,CAACC,MAAM,CAAC;EAC/BR,SAAS,EAAE;IACTS,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE;EACjB,CAAC;EACD;EACAT,OAAO,EAAE;IACPQ,IAAI,EAAE;EACR,CAAC;EACDH,QAAQ,EAAE;IACRK,QAAQ,EAAE,UAAU;IACpBrB,GAAG,EAAE,CAAC;IACNsB,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC"}
@@ -4,26 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = getNamedContext;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
- var _global$contexts;
11
-
12
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
10
  const contexts = '__react_navigation__elements_contexts';
17
11
  // We use a global variable to keep our contexts so that we can reuse same contexts across packages
18
- global[contexts] = (_global$contexts = global[contexts]) !== null && _global$contexts !== void 0 ? _global$contexts : new Map();
19
-
12
+ global[contexts] = global[contexts] ?? new Map();
20
13
  function getNamedContext(name, initialValue) {
21
14
  let context = global[contexts].get(name);
22
-
23
15
  if (context) {
24
16
  return context;
25
17
  }
26
-
27
18
  context = /*#__PURE__*/React.createContext(initialValue);
28
19
  context.displayName = name;
29
20
  global[contexts].set(name, context);
@@ -1 +1 @@
1
- {"version":3,"names":["contexts","global","Map","getNamedContext","name","initialValue","context","get","React","createContext","displayName","set"],"sources":["getNamedContext.tsx"],"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"],"mappings":";;;;;;;AAAA;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,uCAAjB;AAMA;AACAC,MAAM,CAACD,QAAD,CAAN,uBAAmBC,MAAM,CAACD,QAAD,CAAzB,+DAAuC,IAAIE,GAAJ,EAAvC;;AAEe,SAASC,eAAT,CACbC,IADa,EAEbC,YAFa,EAGK;EAClB,IAAIC,OAAO,GAAGL,MAAM,CAACD,QAAD,CAAN,CAAiBO,GAAjB,CAAqBH,IAArB,CAAd;;EAEA,IAAIE,OAAJ,EAAa;IACX,OAAOA,OAAP;EACD;;EAEDA,OAAO,gBAAGE,KAAK,CAACC,aAAN,CAAuBJ,YAAvB,CAAV;EACAC,OAAO,CAACI,WAAR,GAAsBN,IAAtB;EAEAH,MAAM,CAACD,QAAD,CAAN,CAAiBW,GAAjB,CAAqBP,IAArB,EAA2BE,OAA3B;EAEA,OAAOA,OAAP;AACD"}
1
+ {"version":3,"names":["contexts","global","Map","getNamedContext","name","initialValue","context","get","React","createContext","displayName","set"],"sourceRoot":"../../src","sources":["getNamedContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAE/B,MAAMA,QAAQ,GAAG,uCAAuC;AAMxD;AACAC,MAAM,CAACD,QAAQ,CAAC,GAAGC,MAAM,CAACD,QAAQ,CAAC,IAAI,IAAIE,GAAG,EAA8B;AAE7D,SAASC,eAAe,CACrCC,IAAY,EACZC,YAAe,EACG;EAClB,IAAIC,OAAO,GAAGL,MAAM,CAACD,QAAQ,CAAC,CAACO,GAAG,CAACH,IAAI,CAAC;EAExC,IAAIE,OAAO,EAAE;IACX,OAAOA,OAAO;EAChB;EAEAA,OAAO,gBAAGE,KAAK,CAACC,aAAa,CAAIJ,YAAY,CAAC;EAC9CC,OAAO,CAACI,WAAW,GAAGN,IAAI;EAE1BH,MAAM,CAACD,QAAQ,CAAC,CAACW,GAAG,CAACP,IAAI,EAAEE,OAAO,CAAC;EAEnC,OAAOA,OAAO;AAChB"}
@@ -119,41 +119,23 @@ Object.defineProperty(exports, "useHeaderHeight", {
119
119
  return _useHeaderHeight.default;
120
120
  }
121
121
  });
122
-
123
122
  var _Background = _interopRequireDefault(require("./Background"));
124
-
125
123
  var _getDefaultHeaderHeight = _interopRequireDefault(require("./Header/getDefaultHeaderHeight"));
126
-
127
124
  var _getHeaderTitle = _interopRequireDefault(require("./Header/getHeaderTitle"));
128
-
129
125
  var _Header = _interopRequireDefault(require("./Header/Header"));
130
-
131
126
  var _HeaderBackButton = _interopRequireDefault(require("./Header/HeaderBackButton"));
132
-
133
127
  var _HeaderBackContext = _interopRequireDefault(require("./Header/HeaderBackContext"));
134
-
135
128
  var _HeaderBackground = _interopRequireDefault(require("./Header/HeaderBackground"));
136
-
137
129
  var _HeaderHeightContext = _interopRequireDefault(require("./Header/HeaderHeightContext"));
138
-
139
130
  var _HeaderShownContext = _interopRequireDefault(require("./Header/HeaderShownContext"));
140
-
141
131
  var _HeaderTitle = _interopRequireDefault(require("./Header/HeaderTitle"));
142
-
143
132
  var _useHeaderHeight = _interopRequireDefault(require("./Header/useHeaderHeight"));
144
-
145
133
  var _MissingIcon = _interopRequireDefault(require("./MissingIcon"));
146
-
147
134
  var _PlatformPressable = _interopRequireDefault(require("./PlatformPressable"));
148
-
149
135
  var _ResourceSavingView = _interopRequireDefault(require("./ResourceSavingView"));
150
-
151
136
  var _SafeAreaProviderCompat = _interopRequireDefault(require("./SafeAreaProviderCompat"));
152
-
153
137
  var _Screen = _interopRequireDefault(require("./Screen"));
154
-
155
138
  var _types = require("./types");
156
-
157
139
  Object.keys(_types).forEach(function (key) {
158
140
  if (key === "default" || key === "__esModule") return;
159
141
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -165,11 +147,11 @@ Object.keys(_types).forEach(function (key) {
165
147
  }
166
148
  });
167
149
  });
168
-
169
150
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
170
-
171
- const Assets = [// eslint-disable-next-line import/no-commonjs
172
- require('./assets/back-icon.png'), // eslint-disable-next-line import/no-commonjs
151
+ const Assets = [
152
+ // eslint-disable-next-line import/no-commonjs
153
+ require('./assets/back-icon.png'),
154
+ // eslint-disable-next-line import/no-commonjs
173
155
  require('./assets/back-icon-mask.png')];
174
156
  exports.Assets = Assets;
175
157
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Assets","require"],"sources":["index.tsx"],"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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AASA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AAPO,MAAMA,MAAM,GAAG,CACpB;AACAC,OAAO,CAAC,wBAAD,CAFa,EAGpB;AACAA,OAAO,CAAC,6BAAD,CAJa,CAAf"}
1
+ {"version":3,"names":["Assets","require"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAAwB;AAPjB,MAAMA,MAAM,GAAG;AACpB;AACAC,OAAO,CAAC,wBAAwB,CAAC;AACjC;AACAA,OAAO,CAAC,6BAA6B,CAAC,CACvC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import type {\n Animated,\n LayoutChangeEvent,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\n\nexport type Layout = { width: number; height: number };\n\nexport type HeaderOptions = {\n /**\n * String or a function that returns a React Element to be used by the header.\n * Defaults to screen `title` or route name.\n *\n * It receives `allowFontScaling`, `tintColor`, `style` and `children` in the options object as an argument.\n * The title string is passed in `children`.\n */\n headerTitle?: string | ((props: HeaderTitleProps) => React.ReactNode);\n /**\n * How to align the the header title.\n * Defaults to `center` on iOS and `left` on Android.\n */\n headerTitleAlign?: 'left' | 'center';\n /**\n * Style object for the title component.\n */\n headerTitleStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n /**\n * Style object for the container of the `headerTitle` element.\n */\n headerTitleContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Whether header title font should scale to respect Text Size accessibility settings. Defaults to `false`.\n */\n headerTitleAllowFontScaling?: boolean;\n /**\n * Function which returns a React Element to display on the left side of the header.\n */\n headerLeft?: (props: {\n tintColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n labelVisible?: boolean;\n }) => React.ReactNode;\n /**\n * Whether a label is visible in the left button. Used to add extra padding.\n */\n headerLeftLabelVisible?: boolean;\n /**\n * Style object for the container of the `headerLeft` element`.\n */\n headerLeftContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Function which returns a React Element to display on the right side of the header.\n */\n headerRight?: (props: {\n tintColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n }) => React.ReactNode;\n /**\n * Style object for the container of the `headerRight` element.\n */\n headerRightContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Color for material ripple (Android >= 5.0 only).\n */\n headerPressColor?: string;\n /**\n * Color for material ripple (Android >= 5.0 only).\n */\n headerPressOpacity?: number;\n /**\n * Tint color for the header.\n */\n headerTintColor?: string;\n /**\n * Function which returns a React Element to render as the background of the header.\n * This is useful for using backgrounds such as an image, a gradient, blur effect etc.\n * You can use this with `headerTransparent` to render a blur view, for example, to create a translucent header.\n */\n headerBackground?: (props: {\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n }) => React.ReactNode;\n /**\n * Style object for the container of the `headerBackground` element.\n */\n headerBackgroundContainerStyle?: Animated.WithAnimatedValue<\n StyleProp<ViewStyle>\n >;\n /**\n * Defaults to `false`. If `true`, the header will not have a background unless you explicitly provide it with `headerBackground`.\n * The header will also float over the screen so that it overlaps the content underneath.\n * This is useful if you want to render a semi-transparent header or a blurred background.\n */\n headerTransparent?: boolean;\n /**\n * Style object for the header. You can specify a custom background color here, for example.\n */\n headerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Whether to hide the elevation shadow (Android) or the bottom border (iOS) on the header.\n *\n * This is a short-hand for the following styles:\n *\n * ```js\n * {\n * elevation: 0,\n * shadowOpacity: 0,\n * borderBottomWidth: 0,\n * }\n * ```\n *\n * If the above styles are specified in `headerStyle` along with `headerShadowVisible: false`,\n * then `headerShadowVisible: false` will take precedence.\n */\n headerShadowVisible?: boolean;\n /**\n * Extra padding to add at the top of header to account for translucent status bar.\n * By default, it uses the top value from the safe area insets of the device.\n * Pass 0 or a custom value to disable the default behaviour, and customize the height.\n */\n headerStatusBarHeight?: number;\n};\n\nexport type HeaderTitleProps = {\n /**\n * The title text of the header.\n */\n children: string;\n /**\n * Whether title font should scale to respect Text Size accessibility settings.\n */\n allowFontScaling?: boolean;\n /**\n * Tint color for the header.\n */\n tintColor?: string;\n /**\n * Callback to trigger when the size of the title element changes.\n */\n onLayout?: (e: LayoutChangeEvent) => void;\n /**\n * Style object for the title element.\n */\n style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n};\n\nexport type HeaderButtonProps = {\n /**\n * Tint color for the header button.\n */\n tintColor?: string;\n /**\n * Color for material ripple (Android >= 5.0 only).\n */\n pressColor?: string;\n /**\n * Opacity when the button is pressed, used when ripple is not supported.\n */\n pressOpacity?: number;\n /**\n * Whether it's possible to navigate back in stack.\n */\n canGoBack?: boolean;\n};\n\nexport type HeaderBackButtonProps = HeaderButtonProps & {\n /**\n * Whether the button is disabled.\n */\n disabled?: boolean;\n /**\n * Callback to call when the button is pressed.\n */\n onPress?: () => void;\n /**\n * Function which returns a React Element to display custom image in header's back button.\n */\n backImage?: (props: { tintColor: string }) => React.ReactNode;\n /**\n * Label text for the button. Usually the title of the previous screen.\n * By default, this is only shown on iOS.\n */\n label?: string;\n /**\n * Label text to show when there isn't enough space for the full label.\n */\n truncatedLabel?: string;\n /**\n * Whether the label text is visible.\n * Defaults to `true` on iOS and `false` on Android.\n */\n labelVisible?: boolean;\n /**\n * Style object for the label.\n */\n labelStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n /**\n * Whether label font should scale to respect Text Size accessibility settings.\n */\n allowFontScaling?: boolean;\n /**\n * Callback to trigger when the size of the label changes.\n */\n onLabelLayout?: (e: LayoutChangeEvent) => void;\n /**\n * Layout of the screen.\n */\n screenLayout?: Layout;\n /**\n * Layout of the title element in the header.\n */\n titleLayout?: Layout;\n /**\n * Accessibility label for the button for screen readers.\n */\n accessibilityLabel?: string;\n /**\n * ID to locate this button in tests.\n */\n testID?: string;\n /**\n * Style object for the button.\n */\n style?: StyleProp<ViewStyle>;\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":""}
@@ -1,5 +1,4 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
2
  import { useTheme } from '@react-navigation/native';
4
3
  import * as React from 'react';
5
4
  import { View } from 'react-native';
@@ -1 +1 @@
1
- {"version":3,"names":["useTheme","React","View","Background","style","rest","colors","flex","backgroundColor","background"],"sources":["Background.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport { View, ViewProps } from 'react-native';\n\ntype Props = ViewProps & {\n children: React.ReactNode;\n};\n\nexport default function Background({ style, ...rest }: Props) {\n const { colors } = useTheme();\n\n return (\n <View\n {...rest}\n style={[{ flex: 1, backgroundColor: colors.background }, style]}\n />\n );\n}\n"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,QAAgC,cAAhC;AAMA,eAAe,SAASC,UAAT,OAA+C;EAAA,IAA3B;IAAEC,KAAF;IAAS,GAAGC;EAAZ,CAA2B;EAC5D,MAAM;IAAEC;EAAF,IAAaN,QAAQ,EAA3B;EAEA,oBACE,oBAAC,IAAD,eACMK,IADN;IAEE,KAAK,EAAE,CAAC;MAAEE,IAAI,EAAE,CAAR;MAAWC,eAAe,EAAEF,MAAM,CAACG;IAAnC,CAAD,EAAkDL,KAAlD;EAFT,GADF;AAMD"}
1
+ {"version":3,"names":["useTheme","React","View","Background","style","rest","colors","flex","backgroundColor","background"],"sourceRoot":"../../src","sources":["Background.tsx"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAmB,cAAc;AAM9C,eAAe,SAASC,UAAU,OAA4B;EAAA,IAA3B;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC;EAC1D,MAAM;IAAEC;EAAO,CAAC,GAAGN,QAAQ,EAAE;EAE7B,oBACE,oBAAC,IAAI,eACCK,IAAI;IACR,KAAK,EAAE,CAAC;MAAEE,IAAI,EAAE,CAAC;MAAEC,eAAe,EAAEF,MAAM,CAACG;IAAW,CAAC,EAAEL,KAAK;EAAE,GAChE;AAEN"}
@@ -5,11 +5,9 @@ import getDefaultHeaderHeight from './getDefaultHeaderHeight';
5
5
  import HeaderBackground from './HeaderBackground';
6
6
  import HeaderShownContext from './HeaderShownContext';
7
7
  import HeaderTitle from './HeaderTitle';
8
-
9
8
  const warnIfHeaderStylesDefined = styles => {
10
9
  Object.keys(styles).forEach(styleProp => {
11
10
  const value = styles[styleProp];
12
-
13
11
  if (styleProp === 'position' && value === 'absolute') {
14
12
  console.warn("position: 'absolute' is not supported on headerStyle. If you would like to render content under the header, use the 'headerTransparent' option.");
15
13
  } else if (value !== undefined) {
@@ -17,7 +15,6 @@ const warnIfHeaderStylesDefined = styles => {
17
15
  }
18
16
  });
19
17
  };
20
-
21
18
  export default function Header(props) {
22
19
  const insets = useSafeAreaInsets();
23
20
  const frame = useSafeAreaFrame();
@@ -90,11 +87,9 @@ export default function Header(props) {
90
87
  transform,
91
88
  ...unsafeStyles
92
89
  } = StyleSheet.flatten(customHeaderStyle || {});
93
-
94
90
  if (process.env.NODE_ENV !== 'production') {
95
91
  warnIfHeaderStylesDefined(unsafeStyles);
96
92
  }
97
-
98
93
  const safeStyles = {
99
94
  backgroundColor,
100
95
  borderBottomColor,
@@ -130,10 +125,11 @@ export default function Header(props) {
130
125
  shadowRadius,
131
126
  opacity,
132
127
  transform
133
- }; // Setting a property to undefined triggers default style
128
+ };
129
+
130
+ // Setting a property to undefined triggers default style
134
131
  // So we need to filter them out
135
132
  // Users can use `null` instead
136
-
137
133
  for (const styleProp in safeStyles) {
138
134
  // @ts-expect-error: typescript wrongly complains that styleProp cannot be used to index safeStyles
139
135
  if (safeStyles[styleProp] === undefined) {
@@ -142,7 +138,6 @@ export default function Header(props) {
142
138
  delete safeStyles[styleProp];
143
139
  }
144
140
  }
145
-
146
141
  const backgroundStyle = [safeStyles, headerShadowVisible === false && {
147
142
  elevation: 0,
148
143
  shadowOpacity: 0,