@react-navigation/elements 1.3.6 → 1.3.9-alpha.0

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 (131) hide show
  1. package/lib/commonjs/Background.js +1 -8
  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 +1 -9
  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 +1 -9
  16. package/lib/commonjs/Header/HeaderTitle.js.map +1 -1
  17. package/lib/commonjs/Header/getDefaultHeaderHeight.js +1 -5
  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 +2 -15
  34. package/lib/commonjs/PlatformPressable.js.map +1 -1
  35. package/lib/commonjs/ResourceSavingView.js +7 -13
  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 +1 -2
  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 +1 -2
  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 +1 -2
  58. package/lib/module/Header/HeaderTitle.js.map +1 -1
  59. package/lib/module/Header/getDefaultHeaderHeight.js +1 -3
  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 +2 -8
  72. package/lib/module/PlatformPressable.js.map +1 -1
  73. package/lib/module/ResourceSavingView.js +7 -7
  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 +2 -1
  85. package/lib/typescript/src/Background.d.ts.map +1 -0
  86. package/lib/typescript/src/Header/Header.d.ts +2 -1
  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 +2 -1
  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 +2 -1
  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 +2 -1
  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 +3 -2
  113. package/lib/typescript/src/MaskedViewNative.d.ts.map +1 -0
  114. package/lib/typescript/src/MissingIcon.d.ts +2 -1
  115. package/lib/typescript/src/MissingIcon.d.ts.map +1 -0
  116. package/lib/typescript/src/PlatformPressable.d.ts +2 -1
  117. package/lib/typescript/src/PlatformPressable.d.ts.map +1 -0
  118. package/lib/typescript/src/ResourceSavingView.d.ts +2 -1
  119. package/lib/typescript/src/ResourceSavingView.d.ts.map +1 -0
  120. package/lib/typescript/src/SafeAreaProviderCompat.d.ts +2 -1
  121. package/lib/typescript/src/SafeAreaProviderCompat.d.ts.map +1 -0
  122. package/lib/typescript/src/Screen.d.ts +2 -1
  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 +6 -5
  129. package/lib/typescript/src/types.d.ts.map +1 -0
  130. package/package.json +12 -12
  131. package/src/Header/getDefaultHeaderHeight.tsx +1 -1
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = MaskedView;
7
-
8
7
  /**
9
8
  * Use a stub for MaskedView on all Platforms that don't support it.
10
9
  */
10
+
11
11
  function MaskedView(_ref) {
12
12
  let {
13
13
  children
@@ -1 +1 @@
1
- {"version":3,"sources":["MaskedView.tsx"],"names":["MaskedView","children"],"mappings":";;;;;;;AAAA;AACA;AACA;AAQe,SAASA,UAAT,OAAyC;AAAA,MAArB;AAAEC,IAAAA;AAAF,GAAqB;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"]}
1
+ {"version":3,"names":["MaskedView","children"],"sourceRoot":"../../src","sources":["MaskedView.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;;AAQe,SAASA,UAAU,OAAsB;EAAA,IAArB;IAAEC;EAAgB,CAAC;EACpD,OAAOA,QAAQ;AACjB"}
@@ -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,"sources":["MaskedViewNative.tsx"],"names":["RNCMaskedView","require","default","e","isMaskedViewAvailable","UIManager","getViewManagerConfig","MaskedView","children","rest"],"mappings":";;;;;;;AAGA;;AACA;;;;;;AAJA;AACA;AACA;AAWA,IAAIA,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,GACzBC,uBAAUC,oBAAV,CAA+B,eAA/B,KAAmD,IADrD;;AAGe,SAASC,UAAT,OAAkD;AAAA,MAA9B;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAA8B;;AAC/D,MAAIL,qBAAqB,IAAIJ,aAA7B,EAA4C;AAC1C,wBAAO,oBAAC,aAAD,EAAmBS,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"]}
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,"sources":["MissingIcon.tsx"],"names":["MissingIcon","color","size","style","styles","icon","fontSize","StyleSheet","create","backgroundColor"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAQe,SAASA,WAAT,OAAoD;AAAA,MAA/B;AAAEC,IAAAA,KAAF;AAASC,IAAAA,IAAT;AAAeC,IAAAA;AAAf,GAA+B;AACjE,sBAAO,oBAAC,iBAAD;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,GAAGG,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,IAAI,EAAE;AACJI,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"]}
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,GAAC,QAAC,CAAO;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
- 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); }
19
-
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); }
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,"sources":["PlatformPressable.tsx"],"names":["AnimatedPressable","Animated","createAnimatedComponent","Pressable","ANDROID_VERSION_LOLLIPOP","ANDROID_SUPPORTS_RIPPLE","Platform","OS","Version","PlatformPressable","onPressIn","onPressOut","android_ripple","pressColor","pressOpacity","style","rest","dark","opacity","React","useState","Value","animateTo","toValue","duration","timing","easing","Easing","inOut","quad","useNativeDriver","start","handlePressIn","e","handlePressOut","color","undefined"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAkBA,MAAMA,iBAAiB,GAAGC,sBAASC,uBAAT,CAAiCC,sBAAjC,CAA1B;;AAEA,MAAMC,wBAAwB,GAAG,EAAjC;AACA,MAAMC,uBAAuB,GAC3BC,sBAASC,EAAT,KAAgB,S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AuB,GACnB;AACE8B,MAAAA,KAAK,EACHtB,UAAU,KAAKuB,SAAf,GACIvB,UADJ,GAEII,IAAI,GACJ,0BADI,GAEJ,oBANR;AAOE,SAAGL;AAPL,KADmB,GAUnBwB,SAdR;AAgBE,IAAA,KAAK,EAAE,CAAC;AAAElB,MAAAA,OAAO,EAAE,CAACb,uBAAD,GAA2Ba,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"]}
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
- 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); }
17
-
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); }
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,"sources":["ResourceSavingView.tsx"],"names":["FAR_FAR_AWAY","ResourceSavingScene","visible","children","style","rest","Platform","OS","display","styles","container","attached","detached","StyleSheet","create","flex","overflow","top"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;AAQA,MAAMA,YAAY,GAAG,KAArB,C,CAA4B;;AAEb,SAASC,mBAAT,OAKL;AAAA,MALkC;AAC1CC,IAAAA,OAD0C;AAE1CC,IAAAA,QAF0C;AAG1CC,IAAAA,KAH0C;AAI1C,OAAGC;AAJuC,GAKlC;;AACR,MAAIC,sBAASC,EAAT,KAAgB,KAApB,EAA2B;AACzB,wBACE,oBAAC,iBAAD,CACE;AADF;AAEE,MAAA,MAAM,EAAE,CAACL,OAFX;AAGE,MAAA,KAAK,EAAE,CACL;AAAEM,QAAAA,OAAO,EAAEN,OAAO,GAAG,MAAH,GAAY;AAA9B,OADK,EAELO,MAAM,CAACC,SAFF,EAGLN,KAHK,CAHT;AAQE,MAAA,aAAa,EAAEF,OAAO,GAAG,MAAH,GAAY;AARpC,OASMG,IATN,GAWGF,QAXH,CADF;AAeD;;AAED,sBACE,oBAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CAACM,MAAM,CAACC,SAAR,EAAmBN,KAAnB,CADT,CAEE;AAFF;AAGE,IAAA,aAAa,EAAEF,OAAO,GAAG,MAAH,GAAY;AAHpC,kBAKE,oBAAC,iBAAD;AACE,IAAA,WAAW,EAAE,KADf;AAEE,IAAA,qBAAqB,EACnB;AACA;AACAI,0BAASC,EAAT,KAAgB,KAAhB,IAAyBD,sBAASC,EAAT,KAAgB,OAAzC,GAAmD,CAACL,OAApD,GAA8D,IALlE;AAOE,IAAA,aAAa,EAAEA,OAAO,GAAG,MAAH,GAAY,MAPpC;AAQE,IAAA,KAAK,EAAEA,OAAO,GAAGO,MAAM,CAACE,QAAV,GAAqBF,MAAM,CAACG;AAR5C,KAUGT,QAVH,CALF,CADF;AAoBD;;AAED,MAAMM,MAAM,GAAGI,wBAAWC,MAAX,CAAkB;AAC/BJ,EAAAA,SAAS,EAAE;AACTK,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,QAAQ,EAAE;AAFD,GADoB;AAK/BL,EAAAA,QAAQ,EAAE;AACRI,IAAAA,IAAI,EAAE;AADE,GALqB;AAQ/BH,EAAAA,QAAQ,EAAE;AACRG,IAAAA,IAAI,EAAE,CADE;AAERE,IAAAA,GAAG,EAAEjB;AAFG;AARqB,CAAlB,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"]}
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,"sources":["SafeAreaProviderCompat.tsx"],"names":["width","height","Dimensions","get","initialMetrics","Platform","OS","initialWindowMetrics","frame","x","y","insets","top","left","right","bottom","SafeAreaProviderCompat","children","style","styles","container","St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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"]}
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,"sources":["Screen.tsx"],"names":["Screen","props","dimensions","insets","isParentHeaderShown","React","useContext","HeaderShownContext","parentHeaderHeight","HeaderHeightContext","focused","modal","header","headerShown","headerTransparent","headerStatusBarHeight","top","navigation","route","children","style","headerHeight","setHeaderHeight","useState","styles","container","content","e","height","nativeEvent","layout","absolute","StyleSheet","create","flex","flexDirection","position","left","right"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;;;;;;;AAee,SAASA,MAAT,CAAgBC,KAAhB,EAA8B;AAC3C,QAAMC,UAAU,GAAG,mDAAnB;AACA,QAAMC,MAAM,GAAG,oDAAf;AAEA,QAAMC,mBAAmB,GAAGC,KAAK,CAACC,UAAN,CAAiBC,2BAAjB,CAA5B;AACA,QAAMC,kBAAkB,GAAGH,KAAK,CAACC,UAAN,CAAiBG,4BAAjB,CAA3B;AAEA,QAAM;AACJC,IAAAA,OADI;AAEJC,IAAAA,KAAK,GAAG,KAFJ;AAGJC,IAAAA,MAHI;AAIJC,IAAAA,WAAW,GAAG,IAJV;AAKJC,IAAAA,iBALI;AAMJC,IAAAA,qBAAqB,GAAGX,mBAAmB,GAAG,CAAH,GAAOD,MAAM,CAACa,GANrD;AAOJC,IAAAA,UAPI;AAQJC,IAAAA,KARI;AASJC,IAAAA,QATI;AAUJC,IAAAA;AAVI,MAWFnB,KAXJ;AAaA,QAAM,CAACoB,YAAD,EAAeC,eAAf,IAAkCjB,KAAK,CAACkB,QAAN,CAAe,MACrD,qCAAuBrB,UAAvB,EAAmCS,KAAnC,EAA0CI,qBAA1C,CADsC,CAAxC;AAIA,sBACE,oB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,UADF;AAERpB,IAAAA,GAAG,EAAE,CAFG;AAGRqB,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"]}
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;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AAE;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,"sources":["getNamedContext.tsx"],"names":["contexts","global","Map","getNamedContext","name","initialValue","context","get","React","createContext","displayName","set"],"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;AAClB,MAAIC,OAAO,GAAGL,MAAM,CAACD,QAAD,CAAN,CAAiBO,GAAjB,CAAqBH,IAArB,CAAd;;AAEA,MAAIE,OAAJ,EAAa;AACX,WAAOA,OAAP;AACD;;AAEDA,EAAAA,OAAO,gBAAGE,KAAK,CAACC,aAAN,CAAuBJ,YAAvB,CAAV;AACAC,EAAAA,OAAO,CAACI,WAAR,GAAsBN,IAAtB;AAEAH,EAAAA,MAAM,CAACD,QAAD,CAAN,CAAiBW,GAAjB,CAAqBP,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"]}
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,"sources":["index.tsx"],"names":["Assets","require"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AASA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;AAPO,MAAMA,MAAM,GAAG,CACpB;AACAC,OAAO,CAAC,wBAAD,CAFa,EAGpB;AACAA,OAAO,CAAC,6BAAD,CAJa,CAAf","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"]}
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,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":""}
@@ -1,5 +1,4 @@
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
-
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); }
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,"sources":["Background.tsx"],"names":["useTheme","React","View","Background","style","rest","colors","flex","backgroundColor","background"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,QAAgC,cAAhC;AAMA,eAAe,SAASC,UAAT,OAA+C;AAAA,MAA3B;AAAEC,IAAAA,KAAF;AAAS,OAAGC;AAAZ,GAA2B;AAC5D,QAAM;AAAEC,IAAAA;AAAF,MAAaN,QAAQ,EAA3B;AAEA,sBACE,oBAAC,IAAD,eACMK,IADN;AAEE,IAAA,KAAK,EAAE,CAAC;AAAEE,MAAAA,IAAI,EAAE,CAAR;AAAWC,MAAAA,eAAe,EAAEF,MAAM,CAACG;AAAnC,KAAD,EAAkDL,KAAlD;AAFT,KADF;AAMD","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"]}
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,