@sentry/react-native 6.12.0 → 6.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/RNSentry.podspec CHANGED
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
 
38
38
  s.compiler_flags = other_cflags
39
39
 
40
- s.dependency 'Sentry/HybridSDK', '8.49.1'
40
+ s.dependency 'Sentry/HybridSDK', '8.49.2'
41
41
 
42
42
  if defined? install_modules_dependencies
43
43
  # Default React Native dependencies for 0.71 and above (new and legacy architecture)
@@ -90,6 +90,7 @@ import java.util.Properties;
90
90
  import java.util.concurrent.CountDownLatch;
91
91
  import org.jetbrains.annotations.NotNull;
92
92
  import org.jetbrains.annotations.Nullable;
93
+ import org.jetbrains.annotations.TestOnly;
93
94
 
94
95
  public class RNSentryModuleImpl {
95
96
 
@@ -177,12 +178,22 @@ public class RNSentryModuleImpl {
177
178
 
178
179
  public void initNativeSdk(final ReadableMap rnOptions, Promise promise) {
179
180
  SentryAndroid.init(
180
- this.getReactApplicationContext(),
181
- options -> getSentryAndroidOptions(options, rnOptions, logger));
181
+ getApplicationContext(), options -> getSentryAndroidOptions(options, rnOptions, logger));
182
182
 
183
183
  promise.resolve(true);
184
184
  }
185
185
 
186
+ @TestOnly
187
+ protected Context getApplicationContext() {
188
+ final Context context = this.getReactApplicationContext().getApplicationContext();
189
+ if (context == null) {
190
+ logger.log(
191
+ SentryLevel.ERROR, "ApplicationContext is null, using ReactApplicationContext fallback.");
192
+ return this.getReactApplicationContext();
193
+ }
194
+ return context;
195
+ }
196
+
186
197
  protected void getSentryAndroidOptions(
187
198
  @NotNull SentryAndroidOptions options, @NotNull ReadableMap rnOptions, ILogger logger) {
188
199
  @Nullable SdkVersion sdkVersion = options.getSdkVersion();
@@ -14,6 +14,7 @@ import io.sentry.android.core.AndroidLogger;
14
14
  import io.sentry.android.core.BuildInfoProvider;
15
15
  import io.sentry.android.core.SentryAndroidDateProvider;
16
16
  import io.sentry.android.core.internal.util.FirstDrawDoneListener;
17
+ import io.sentry.react.utils.RNSentryActivityUtils;
17
18
  import java.util.Objects;
18
19
  import org.jetbrains.annotations.NotNull;
19
20
  import org.jetbrains.annotations.Nullable;
@@ -151,11 +152,12 @@ public class RNSentryOnDrawReporterManager
151
152
  return;
152
153
  }
153
154
 
154
- @Nullable Activity activity = reactContext.getCurrentActivity();
155
+ final @Nullable Activity activity =
156
+ RNSentryActivityUtils.getCurrentActivity(reactContext, logger);
155
157
  if (activity == null) {
156
158
  logger.log(
157
159
  SentryLevel.ERROR,
158
- "[TimeToDisplay] Won't emit next frame drawn event, reactContext is null.");
160
+ "[TimeToDisplay] Won't emit next frame drawn event, activity is null.");
159
161
  return;
160
162
  }
161
163
 
@@ -2,7 +2,7 @@ package io.sentry.react;
2
2
 
3
3
  class RNSentryVersion {
4
4
  static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native";
5
- static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "6.12.0";
5
+ static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "6.13.1";
6
6
  static final String NATIVE_SDK_NAME = "sentry.native.android.react-native";
7
7
  static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
8
8
  static final String REACT_NATIVE_SDK_NAME = "sentry.javascript.react-native";
@@ -0,0 +1,31 @@
1
+ package io.sentry.react.utils;
2
+
3
+ import android.app.Activity;
4
+ import com.facebook.react.bridge.ReactApplicationContext;
5
+ import io.sentry.ILogger;
6
+ import io.sentry.SentryLevel;
7
+ import io.sentry.android.core.CurrentActivityHolder;
8
+ import org.jetbrains.annotations.NotNull;
9
+ import org.jetbrains.annotations.Nullable;
10
+
11
+ /** Utility class for React Native Activity related functionality. */
12
+ public final class RNSentryActivityUtils {
13
+
14
+ private RNSentryActivityUtils() {
15
+ // Prevent instantiation
16
+ }
17
+
18
+ public static @Nullable Activity getCurrentActivity(
19
+ final @NotNull ReactApplicationContext reactContext, final @NotNull ILogger logger) {
20
+ final Activity activity = reactContext.getCurrentActivity();
21
+ if (activity != null) {
22
+ return activity;
23
+ }
24
+
25
+ logger.log(
26
+ SentryLevel.DEBUG,
27
+ "[RNSentryActivityUtils] Given ReactApplicationContext has no activity attached, using"
28
+ + " CurrentActivityHolder as a fallback.");
29
+ return CurrentActivityHolder.getInstance().getActivity();
30
+ }
31
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackWidgetManager.d.ts","sourceRoot":"","sources":["../../../src/js/feedback/FeedbackWidgetManager.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAuE,MAAM,cAAc,CAAC;AAK7G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAoDnE,UAAU,2BAA2B;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED,UAAU,2BAA2B;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,QAAQ,CAAC,KAAK,CAAC;IAClC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,cAAM,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,2BAA2B,CAAC;IACxE,KAAK,EAAE,2BAA2B,CAKvC;IAEF,OAAO,CAAC,aAAa,CA8BlB;gBAEgB,KAAK,EAAE,2BAA2B;IAKrD;;OAEG;IACI,kBAAkB,CAAC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,2BAA2B,GAAG,IAAI;IAuBxF;;OAEG;IACI,MAAM,IAAI,KAAK,CAAC,SAAS;IA2ChC,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,sBAAsB,CA0B5B;IAEF,OAAO,CAAC,YAAY,CAElB;CACH;AAED,QAAA,MAAM,kBAAkB,QAAO,IAG9B,CAAC;AAEF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@ import { FeedbackWidget } from './FeedbackWidget';
6
6
  import { modalSheetContainer, modalWrapper, topSpacer } from './FeedbackWidget.styles';
7
7
  import { getFeedbackOptions } from './integration';
8
8
  import { lazyLoadAutoInjectFeedbackIntegration } from './lazy';
9
- import { isModalSupported } from './utils';
9
+ import { isModalSupported, isNativeDriverSupportedForColorAnimations } from './utils';
10
10
  const PULL_DOWN_CLOSE_THRESHOLD = 200;
11
11
  const SLIDE_ANIMATION_DURATION = 200;
12
12
  const BACKGROUND_ANIMATION_DURATION = 200;
13
+ const useNativeDriverForColorAnimations = isNativeDriverSupportedForColorAnimations();
13
14
  class FeedbackWidgetManager {
14
15
  static initialize(setVisibility) {
15
16
  this._setVisibility = setVisibility;
@@ -107,7 +108,7 @@ class FeedbackWidgetProvider extends React.Component {
107
108
  Animated.timing(this.state.backgroundOpacity, {
108
109
  toValue: 0,
109
110
  duration: BACKGROUND_ANIMATION_DURATION,
110
- useNativeDriver: true,
111
+ useNativeDriver: useNativeDriverForColorAnimations,
111
112
  easing: Easing.out(Easing.quad),
112
113
  })
113
114
  ]).start(() => {
@@ -134,7 +135,7 @@ class FeedbackWidgetProvider extends React.Component {
134
135
  Animated.timing(this.state.backgroundOpacity, {
135
136
  toValue: 1,
136
137
  duration: BACKGROUND_ANIMATION_DURATION,
137
- useNativeDriver: true,
138
+ useNativeDriver: useNativeDriverForColorAnimations,
138
139
  easing: Easing.in(Easing.quad),
139
140
  }),
140
141
  Animated.timing(this.state.panY, {
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackWidgetManager.js","sourceRoot":"","sources":["../../../src/js/feedback/FeedbackWidgetManager.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAA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4BAClC,oBAAC,UAAU,IACT,OAAO,EAAE,KAAK,EACd,yBAAyB,EAAC,SAAS,EACnC,iCAAiC,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,EACxD,QAAQ,EAAE,IAAI,CAAC,aAAa;gCAC5B,oBAAC,cAAc,oBAAK,kBAAkB,EAAE,IACtC,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,eAAe,EAAE,IAAI,CAAC,YAAY,IAClC,CACS,CACC,CACV,CACM,CAEjB,CACJ,CAAC;IACJ,CAAC;CAqCF;AAED,MAAM,kBAAkB,GAAG,GAAS,EAAE;IACpC,qCAAqC,EAAE,CAAC;IACxC,qBAAqB,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,GAAS,EAAE;IAC5C,qBAAqB,CAAC,KAAK,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,CAAC","sourcesContent":["import { logger } from '@sentry/core';\nimport * as React from 'react';\nimport type { NativeScrollEvent, NativeSyntheticEvent} from 'react-native';\nimport { Animated, Dimensions, Easing, Modal, PanResponder, Platform, ScrollView, View } from 'react-native';\n\nimport { notWeb } from '../utils/environment';\nimport { FeedbackWidget } from './FeedbackWidget';\nimport { modalSheetContainer, modalWrapper, topSpacer } from './FeedbackWidget.styles';\nimport type { FeedbackWidgetStyles } from './FeedbackWidget.types';\nimport { getFeedbackOptions } from './integration';\nimport { lazyLoadAutoInjectFeedbackIntegration } from './lazy';\nimport { isModalSupported } from './utils';\n\nconst PULL_DOWN_CLOSE_THRESHOLD = 200;\nconst SLIDE_ANIMATION_DURATION = 200;\nconst BACKGROUND_ANIMATION_DURATION = 200;\n\nclass FeedbackWidgetManager {\n private static _isVisible = false;\n private static _setVisibility: (visible: boolean) => void;\n\n public static initialize(setVisibility: (visible: boolean) => void): void {\n this._setVisibility = setVisibility;\n }\n\n /**\n * For testing purposes only.\n */\n public static reset(): void {\n this._isVisible = false;\n this._setVisibility = undefined;\n }\n\n public static show(): void {\n if (this._setVisibility) {\n this._isVisible = true;\n this._setVisibility(true);\n } else {\n // This message should be always shown otherwise it's not possible to use the widget.\n // eslint-disable-next-line no-console\n console.warn('[Sentry] FeedbackWidget requires `Sentry.wrap(RootComponent)` to be called before `showFeedbackWidget()`.');\n }\n }\n\n public static hide(): void {\n if (this._setVisibility) {\n this._isVisible = false;\n this._setVisibility(false);\n } else {\n // This message should be always shown otherwise it's not possible to use the widget.\n // eslint-disable-next-line no-console\n console.warn('[Sentry] FeedbackWidget requires `Sentry.wrap(RootComponent)` before interacting with the widget.');\n }\n }\n\n public static isFormVisible(): boolean {\n return this._isVisible;\n }\n}\n\ninterface FeedbackWidgetProviderProps {\n children: React.ReactNode;\n styles?: FeedbackWidgetStyles;\n}\n\ninterface FeedbackWidgetProviderState {\n isVisible: boolean;\n backgroundOpacity: Animated.Value;\n panY: Animated.Value;\n isScrollAtTop: boolean;\n}\n\nclass FeedbackWidgetProvider extends React.Component<FeedbackWidgetProviderProps> {\n public state: FeedbackWidgetProviderState = {\n isVisible: false,\n backgroundOpacity: new Animated.Value(0),\n panY: new Animated.Value(Dimensions.get('screen').height),\n isScrollAtTop: true,\n };\n\n private _panResponder = PanResponder.create({\n onStartShouldSetPanResponder: (_, gestureState) => {\n return notWeb() && this.state.isScrollAtTop && gestureState.dy > 0;\n },\n onMoveShouldSetPanResponder: (_, gestureState) => {\n return notWeb() && this.state.isScrollAtTop && gestureState.dy > 0;\n },\n onPanResponderMove: (_, gestureState) => {\n if (gestureState.dy > 0) {\n this.state.panY.setValue(gestureState.dy);\n }\n },\n onPanResponderRelease: (_, gestureState) => {\n if (gestureState.dy > PULL_DOWN_CLOSE_THRESHOLD) {\n // Close on swipe below a certain threshold\n Animated.timing(this.state.panY, {\n toValue: Dimensions.get('screen').height,\n duration: SLIDE_ANIMATION_DURATION,\n useNativeDriver: true,\n }).start(() => {\n this._handleClose();\n });\n } else {\n // Animate it back to the original position\n Animated.spring(this.state.panY, {\n toValue: 0,\n useNativeDriver: true,\n }).start();\n }\n },\n });\n\n public constructor(props: FeedbackWidgetProviderProps) {\n super(props);\n FeedbackWidgetManager.initialize(this._setVisibilityFunction);\n }\n\n /**\n * Animates the background opacity when the modal is shown.\n */\n public componentDidUpdate(_prevProps: any, prevState: FeedbackWidgetProviderState): void {\n if (!prevState.isVisible && this.state.isVisible) {\n Animated.parallel([\n Animated.timing(this.state.backgroundOpacity, {\n toValue: 1,\n duration: BACKGROUND_ANIMATION_DURATION,\n useNativeDriver: true,\n easing: Easing.in(Easing.quad),\n }),\n Animated.timing(this.state.panY, {\n toValue: 0,\n duration: SLIDE_ANIMATION_DURATION,\n useNativeDriver: true,\n easing: Easing.in(Easing.quad),\n })\n ]).start(() => {\n logger.info('FeedbackWidgetProvider componentDidUpdate');\n });\n } else if (prevState.isVisible && !this.state.isVisible) {\n this.state.backgroundOpacity.setValue(0);\n }\n }\n\n /**\n * Renders the feedback form modal.\n */\n public render(): React.ReactNode {\n if (!isModalSupported()) {\n logger.error('FeedbackWidget Modal is not supported in React Native < 0.71 with Fabric renderer.');\n return <>{this.props.children}</>;\n }\n\n const { isVisible, backgroundOpacity } = this.state;\n\n const backgroundColor = backgroundOpacity.interpolate({\n inputRange: [0, 1],\n outputRange: ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 0.9)'],\n });\n\n // Wrapping the `Modal` component in a `View` component is necessary to avoid\n // issues like https://github.com/software-mansion/react-native-reanimated/issues/6035\n return (\n <>\n {this.props.children}\n {isVisible &&\n <Animated.View style={[modalWrapper, { backgroundColor }]} >\n <Modal visible={isVisible} transparent animationType=\"none\" onRequestClose={this._handleClose} testID=\"feedback-form-modal\">\n <View style={topSpacer}/>\n <Animated.View\n style={[modalSheetContainer, { transform: [{ translateY: this.state.panY }] }]}\n {...this._panResponder.panHandlers}>\n <ScrollView\n bounces={false}\n keyboardShouldPersistTaps=\"handled\"\n automaticallyAdjustKeyboardInsets={Platform.OS === 'ios'}\n onScroll={this._handleScroll}>\n <FeedbackWidget {...getFeedbackOptions()}\n onFormClose={this._handleClose}\n onFormSubmitted={this._handleClose}\n />\n </ScrollView>\n </Animated.View>\n </Modal>\n </Animated.View>\n }\n </>\n );\n }\n\n private _handleScroll = (event: NativeSyntheticEvent<NativeScrollEvent>): void => {\n this.setState({ isScrollAtTop: event.nativeEvent.contentOffset.y <= 0 });\n };\n\n private _setVisibilityFunction = (visible: boolean): void => {\n const updateState = (): void => {\n this.setState({ isVisible: visible });\n };\n if (!visible) {\n Animated.parallel([\n Animated.timing(this.state.panY, {\n toValue: Dimensions.get('screen').height,\n duration: SLIDE_ANIMATION_DURATION,\n useNativeDriver: true,\n easing: Easing.out(Easing.quad),\n }),\n Animated.timing(this.state.backgroundOpacity, {\n toValue: 0,\n duration: BACKGROUND_ANIMATION_DURATION,\n useNativeDriver: true,\n easing: Easing.out(Easing.quad),\n })\n ]).start(() => {\n // Change of the state unmount the component\n // which would cancel the animation\n updateState();\n });\n } else {\n updateState();\n }\n };\n\n private _handleClose = (): void => {\n FeedbackWidgetManager.hide();\n };\n}\n\nconst showFeedbackWidget = (): void => {\n lazyLoadAutoInjectFeedbackIntegration();\n FeedbackWidgetManager.show();\n};\n\nconst resetFeedbackWidgetManager = (): void => {\n FeedbackWidgetManager.reset();\n};\n\nexport { showFeedbackWidget, FeedbackWidgetProvider, resetFeedbackWidgetManager };\n"]}
1
+ {"version":3,"file":"FeedbackWidgetManager.js","sourceRoot":"","sources":["../../../src/js/feedback/FeedbackWidgetManager.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE7G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AC,IAC1E,IAAI,CAAC,aAAa,CAAC,WAAW;4BAClC,oBAAC,UAAU,IACT,OAAO,EAAE,KAAK,EACd,yBAAyB,EAAC,SAAS,EACnC,iCAAiC,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,EACxD,QAAQ,EAAE,IAAI,CAAC,aAAa;gCAC5B,oBAAC,cAAc,oBAAK,kBAAkB,EAAE,IACtC,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,eAAe,EAAE,IAAI,CAAC,YAAY,IAClC,CACS,CACC,CACV,CACM,CAEjB,CACJ,CAAC;IACJ,CAAC;CAqCF;AAED,MAAM,kBAAkB,GAAG,GAAS,EAAE;IACpC,qCAAqC,EAAE,CAAC;IACxC,qBAAqB,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,GAAS,EAAE;IAC5C,qBAAqB,CAAC,KAAK,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,CAAC","sourcesContent":["import { logger } from '@sentry/core';\nimport * as React from 'react';\nimport type { NativeScrollEvent, NativeSyntheticEvent} from 'react-native';\nimport { Animated, Dimensions, Easing, Modal, PanResponder, Platform, ScrollView, View } from 'react-native';\n\nimport { notWeb } from '../utils/environment';\nimport { FeedbackWidget } from './FeedbackWidget';\nimport { modalSheetContainer, modalWrapper, topSpacer } from './FeedbackWidget.styles';\nimport type { FeedbackWidgetStyles } from './FeedbackWidget.types';\nimport { getFeedbackOptions } from './integration';\nimport { lazyLoadAutoInjectFeedbackIntegration } from './lazy';\nimport { isModalSupported, isNativeDriverSupportedForColorAnimations } from './utils';\n\nconst PULL_DOWN_CLOSE_THRESHOLD = 200;\nconst SLIDE_ANIMATION_DURATION = 200;\nconst BACKGROUND_ANIMATION_DURATION = 200;\n\nconst useNativeDriverForColorAnimations = isNativeDriverSupportedForColorAnimations();\n\nclass FeedbackWidgetManager {\n private static _isVisible = false;\n private static _setVisibility: (visible: boolean) => void;\n\n public static initialize(setVisibility: (visible: boolean) => void): void {\n this._setVisibility = setVisibility;\n }\n\n /**\n * For testing purposes only.\n */\n public static reset(): void {\n this._isVisible = false;\n this._setVisibility = undefined;\n }\n\n public static show(): void {\n if (this._setVisibility) {\n this._isVisible = true;\n this._setVisibility(true);\n } else {\n // This message should be always shown otherwise it's not possible to use the widget.\n // eslint-disable-next-line no-console\n console.warn('[Sentry] FeedbackWidget requires `Sentry.wrap(RootComponent)` to be called before `showFeedbackWidget()`.');\n }\n }\n\n public static hide(): void {\n if (this._setVisibility) {\n this._isVisible = false;\n this._setVisibility(false);\n } else {\n // This message should be always shown otherwise it's not possible to use the widget.\n // eslint-disable-next-line no-console\n console.warn('[Sentry] FeedbackWidget requires `Sentry.wrap(RootComponent)` before interacting with the widget.');\n }\n }\n\n public static isFormVisible(): boolean {\n return this._isVisible;\n }\n}\n\ninterface FeedbackWidgetProviderProps {\n children: React.ReactNode;\n styles?: FeedbackWidgetStyles;\n}\n\ninterface FeedbackWidgetProviderState {\n isVisible: boolean;\n backgroundOpacity: Animated.Value;\n panY: Animated.Value;\n isScrollAtTop: boolean;\n}\n\nclass FeedbackWidgetProvider extends React.Component<FeedbackWidgetProviderProps> {\n public state: FeedbackWidgetProviderState = {\n isVisible: false,\n backgroundOpacity: new Animated.Value(0),\n panY: new Animated.Value(Dimensions.get('screen').height),\n isScrollAtTop: true,\n };\n\n private _panResponder = PanResponder.create({\n onStartShouldSetPanResponder: (_, gestureState) => {\n return notWeb() && this.state.isScrollAtTop && gestureState.dy > 0;\n },\n onMoveShouldSetPanResponder: (_, gestureState) => {\n return notWeb() && this.state.isScrollAtTop && gestureState.dy > 0;\n },\n onPanResponderMove: (_, gestureState) => {\n if (gestureState.dy > 0) {\n this.state.panY.setValue(gestureState.dy);\n }\n },\n onPanResponderRelease: (_, gestureState) => {\n if (gestureState.dy > PULL_DOWN_CLOSE_THRESHOLD) {\n // Close on swipe below a certain threshold\n Animated.timing(this.state.panY, {\n toValue: Dimensions.get('screen').height,\n duration: SLIDE_ANIMATION_DURATION,\n useNativeDriver: true,\n }).start(() => {\n this._handleClose();\n });\n } else {\n // Animate it back to the original position\n Animated.spring(this.state.panY, {\n toValue: 0,\n useNativeDriver: true,\n }).start();\n }\n },\n });\n\n public constructor(props: FeedbackWidgetProviderProps) {\n super(props);\n FeedbackWidgetManager.initialize(this._setVisibilityFunction);\n }\n\n /**\n * Animates the background opacity when the modal is shown.\n */\n public componentDidUpdate(_prevProps: any, prevState: FeedbackWidgetProviderState): void {\n if (!prevState.isVisible && this.state.isVisible) {\n Animated.parallel([\n Animated.timing(this.state.backgroundOpacity, {\n toValue: 1,\n duration: BACKGROUND_ANIMATION_DURATION,\n useNativeDriver: useNativeDriverForColorAnimations,\n easing: Easing.in(Easing.quad),\n }),\n Animated.timing(this.state.panY, {\n toValue: 0,\n duration: SLIDE_ANIMATION_DURATION,\n useNativeDriver: true,\n easing: Easing.in(Easing.quad),\n })\n ]).start(() => {\n logger.info('FeedbackWidgetProvider componentDidUpdate');\n });\n } else if (prevState.isVisible && !this.state.isVisible) {\n this.state.backgroundOpacity.setValue(0);\n }\n }\n\n /**\n * Renders the feedback form modal.\n */\n public render(): React.ReactNode {\n if (!isModalSupported()) {\n logger.error('FeedbackWidget Modal is not supported in React Native < 0.71 with Fabric renderer.');\n return <>{this.props.children}</>;\n }\n\n const { isVisible, backgroundOpacity } = this.state;\n\n const backgroundColor = backgroundOpacity.interpolate({\n inputRange: [0, 1],\n outputRange: ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 0.9)'],\n });\n\n // Wrapping the `Modal` component in a `View` component is necessary to avoid\n // issues like https://github.com/software-mansion/react-native-reanimated/issues/6035\n return (\n <>\n {this.props.children}\n {isVisible &&\n <Animated.View style={[modalWrapper, { backgroundColor }]} >\n <Modal visible={isVisible} transparent animationType=\"none\" onRequestClose={this._handleClose} testID=\"feedback-form-modal\">\n <View style={topSpacer}/>\n <Animated.View\n style={[modalSheetContainer, { transform: [{ translateY: this.state.panY }] }]}\n {...this._panResponder.panHandlers}>\n <ScrollView\n bounces={false}\n keyboardShouldPersistTaps=\"handled\"\n automaticallyAdjustKeyboardInsets={Platform.OS === 'ios'}\n onScroll={this._handleScroll}>\n <FeedbackWidget {...getFeedbackOptions()}\n onFormClose={this._handleClose}\n onFormSubmitted={this._handleClose}\n />\n </ScrollView>\n </Animated.View>\n </Modal>\n </Animated.View>\n }\n </>\n );\n }\n\n private _handleScroll = (event: NativeSyntheticEvent<NativeScrollEvent>): void => {\n this.setState({ isScrollAtTop: event.nativeEvent.contentOffset.y <= 0 });\n };\n\n private _setVisibilityFunction = (visible: boolean): void => {\n const updateState = (): void => {\n this.setState({ isVisible: visible });\n };\n if (!visible) {\n Animated.parallel([\n Animated.timing(this.state.panY, {\n toValue: Dimensions.get('screen').height,\n duration: SLIDE_ANIMATION_DURATION,\n useNativeDriver: true,\n easing: Easing.out(Easing.quad),\n }),\n Animated.timing(this.state.backgroundOpacity, {\n toValue: 0,\n duration: BACKGROUND_ANIMATION_DURATION,\n useNativeDriver: useNativeDriverForColorAnimations,\n easing: Easing.out(Easing.quad),\n })\n ]).start(() => {\n // Change of the state unmount the component\n // which would cancel the animation\n updateState();\n });\n } else {\n updateState();\n }\n };\n\n private _handleClose = (): void => {\n FeedbackWidgetManager.hide();\n };\n}\n\nconst showFeedbackWidget = (): void => {\n lazyLoadAutoInjectFeedbackIntegration();\n FeedbackWidgetManager.show();\n};\n\nconst resetFeedbackWidgetManager = (): void => {\n FeedbackWidgetManager.reset();\n};\n\nexport { showFeedbackWidget, FeedbackWidgetProvider, resetFeedbackWidgetManager };\n"]}
@@ -6,6 +6,11 @@ declare global {
6
6
  * ref: https://github.com/facebook/react-native/issues/33652
7
7
  */
8
8
  export declare function isModalSupported(): boolean;
9
+ /**
10
+ * The native driver supports color animations since React Native 0.69.
11
+ * ref: https://github.com/facebook/react-native/commit/201f355479cafbcece3d9eb40a52bae003da3e5c
12
+ */
13
+ export declare function isNativeDriverSupportedForColorAnimations(): boolean;
9
14
  export declare const isValidEmail: (email: string) => boolean;
10
15
  /**
11
16
  * Converts base64 string to Uint8Array on the web
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/feedback/utils.ts"],"names":[],"mappings":"AAMA,OAAO,CAAC,MAAM,CAAC;IAEb,SAAS,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C;AAED,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,OAG5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,MAAM,KAAG,UAOnD,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAAW,MAAM,WAAW,MAAM,KAAG,IAMpE,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/feedback/utils.ts"],"names":[],"mappings":"AAMA,OAAO,CAAC,MAAM,CAAC;IAEb,SAAS,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C;AAED;;;GAGG;AACH,wBAAgB,yCAAyC,IAAI,OAAO,CAGnE;AAED,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,OAG5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,MAAM,KAAG,UAOnD,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAAW,MAAM,WAAW,MAAM,KAAG,IAMpE,CAAC"}
@@ -11,6 +11,15 @@ export function isModalSupported() {
11
11
  const { major, minor } = ((_a = ReactNativeLibraries.ReactNativeVersion) === null || _a === void 0 ? void 0 : _a.version) || {};
12
12
  return !(isFabricEnabled() && major === 0 && minor < 71);
13
13
  }
14
+ /**
15
+ * The native driver supports color animations since React Native 0.69.
16
+ * ref: https://github.com/facebook/react-native/commit/201f355479cafbcece3d9eb40a52bae003da3e5c
17
+ */
18
+ export function isNativeDriverSupportedForColorAnimations() {
19
+ var _a;
20
+ const { major, minor } = ((_a = ReactNativeLibraries.ReactNativeVersion) === null || _a === void 0 ? void 0 : _a.version) || {};
21
+ return major > 0 || minor >= 69;
22
+ }
14
23
  export const isValidEmail = (email) => {
15
24
  const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
16
25
  return emailRegex.test(email);
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/feedback/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAO9D;;;GAGG;AACH,MAAM,UAAU,gBAAgB;;IAC9B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAA,MAAA,oBAAoB,CAAC,kBAAkB,0CAAE,OAAO,KAAI,EAAE,CAAC;IAChF,OAAO,CAAC,CAAC,eAAe,EAAE,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAW,EAAE;IACrD,MAAM,UAAU,GAAG,kDAAkD,CAAC;IACtE,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAc,EAAE;IAC/D,IAAI,OAAO,IAAI,KAAK,UAAU,IAAI,CAAC,KAAK,EAAE,EAAE;QAC1C,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;KAC/D;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,OAAe,EAAQ,EAAE;IAC1E,IAAI,KAAK,EAAE,IAAI,OAAO,aAAa,CAAC,KAAK,KAAK,WAAW,EAAE;QACzD,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC,CAAC;KAC7C;SAAM;QACL,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;KAC7B;AACH,CAAC,CAAC","sourcesContent":["import { Alert } from 'react-native';\n\nimport { isFabricEnabled, isWeb } from '../utils/environment';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { ReactNativeLibraries } from './../utils/rnlibraries';\n\ndeclare global {\n // Declaring atob function to be used in web environment\n function atob(encodedString: string): string;\n}\n\n/**\n * Modal is not supported in React Native < 0.71 with Fabric renderer.\n * ref: https://github.com/facebook/react-native/issues/33652\n */\nexport function isModalSupported(): boolean {\n const { major, minor } = ReactNativeLibraries.ReactNativeVersion?.version || {};\n return !(isFabricEnabled() && major === 0 && minor < 71);\n}\n\nexport const isValidEmail = (email: string): boolean => {\n const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return emailRegex.test(email);\n};\n\n/**\n * Converts base64 string to Uint8Array on the web\n * @param base64 base64 string\n * @returns Uint8Array data\n */\nexport const base64ToUint8Array = (base64: string): Uint8Array => {\n if (typeof atob !== 'function' || !isWeb()) {\n throw new Error('atob is not available in this environment.');\n }\n\n const binaryString = atob(base64);\n return new Uint8Array([...binaryString].map(char => char.charCodeAt(0)));\n};\n\nexport const feedbackAlertDialog = (title: string, message: string): void => {\n if (isWeb() && typeof RN_GLOBAL_OBJ.alert !== 'undefined') {\n RN_GLOBAL_OBJ.alert(`${title}\\n${message}`);\n } else {\n Alert.alert(title, message);\n }\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/feedback/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAO9D;;;GAGG;AACH,MAAM,UAAU,gBAAgB;;IAC9B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAA,MAAA,oBAAoB,CAAC,kBAAkB,0CAAE,OAAO,KAAI,EAAE,CAAC;IAChF,OAAO,CAAC,CAAC,eAAe,EAAE,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yCAAyC;;IACvD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAA,MAAA,oBAAoB,CAAC,kBAAkB,0CAAE,OAAO,KAAI,EAAE,CAAC;IAChF,OAAO,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAW,EAAE;IACrD,MAAM,UAAU,GAAG,kDAAkD,CAAC;IACtE,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAc,EAAE;IAC/D,IAAI,OAAO,IAAI,KAAK,UAAU,IAAI,CAAC,KAAK,EAAE,EAAE;QAC1C,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;KAC/D;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,OAAe,EAAQ,EAAE;IAC1E,IAAI,KAAK,EAAE,IAAI,OAAO,aAAa,CAAC,KAAK,KAAK,WAAW,EAAE;QACzD,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC,CAAC;KAC7C;SAAM;QACL,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;KAC7B;AACH,CAAC,CAAC","sourcesContent":["import { Alert } from 'react-native';\n\nimport { isFabricEnabled, isWeb } from '../utils/environment';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { ReactNativeLibraries } from './../utils/rnlibraries';\n\ndeclare global {\n // Declaring atob function to be used in web environment\n function atob(encodedString: string): string;\n}\n\n/**\n * Modal is not supported in React Native < 0.71 with Fabric renderer.\n * ref: https://github.com/facebook/react-native/issues/33652\n */\nexport function isModalSupported(): boolean {\n const { major, minor } = ReactNativeLibraries.ReactNativeVersion?.version || {};\n return !(isFabricEnabled() && major === 0 && minor < 71);\n}\n\n/**\n * The native driver supports color animations since React Native 0.69.\n * ref: https://github.com/facebook/react-native/commit/201f355479cafbcece3d9eb40a52bae003da3e5c\n */\nexport function isNativeDriverSupportedForColorAnimations(): boolean {\n const { major, minor } = ReactNativeLibraries.ReactNativeVersion?.version || {};\n return major > 0 || minor >= 69;\n}\n\nexport const isValidEmail = (email: string): boolean => {\n const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return emailRegex.test(email);\n};\n\n/**\n * Converts base64 string to Uint8Array on the web\n * @param base64 base64 string\n * @returns Uint8Array data\n */\nexport const base64ToUint8Array = (base64: string): Uint8Array => {\n if (typeof atob !== 'function' || !isWeb()) {\n throw new Error('atob is not available in this environment.');\n }\n\n const binaryString = atob(base64);\n return new Uint8Array([...binaryString].map(char => char.charCodeAt(0)));\n};\n\nexport const feedbackAlertDialog = (title: string, message: string): void => {\n if (isWeb() && typeof RN_GLOBAL_OBJ.alert !== 'undefined') {\n RN_GLOBAL_OBJ.alert(`${title}\\n${message}`);\n } else {\n Alert.alert(title, message);\n }\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"rnlibraries.d.ts","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAwC5E,eAAO,MAAM,oBAAoB,EAAE,6BAAqE,CAAC"}
1
+ {"version":3,"file":"rnlibraries.d.ts","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAsE5E,eAAO,MAAM,oBAAoB,EAAE,6BAAqE,CAAC"}
@@ -5,14 +5,38 @@ const InternalReactNativeLibrariesInterface = {
5
5
  Devtools: {
6
6
  parseErrorStack: (errorStack) => {
7
7
  const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');
8
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
9
+ if (parseErrorStack.default && typeof parseErrorStack.default === 'function') {
10
+ // Starting with react-native 0.79, the parseErrorStack is a default export
11
+ // https://github.com/facebook/react-native/commit/e5818d92a867dbfa5f60d176b847b1f2131cb6da
12
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
13
+ return parseErrorStack.default(errorStack);
14
+ }
15
+ // react-native 0.78 and below
8
16
  return parseErrorStack(errorStack);
9
17
  },
10
18
  symbolicateStackTrace: (stack, extraData) => {
11
19
  const symbolicateStackTrace = require('react-native/Libraries/Core/Devtools/symbolicateStackTrace');
20
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
21
+ if (symbolicateStackTrace.default && typeof symbolicateStackTrace.default === 'function') {
22
+ // Starting with react-native 0.79, the symbolicateStackTrace is a default export
23
+ // https://github.com/facebook/react-native/commit/e5818d92a867dbfa5f60d176b847b1f2131cb6da
24
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
25
+ return symbolicateStackTrace.default(stack, extraData);
26
+ }
27
+ // react-native 0.78 and below
12
28
  return symbolicateStackTrace(stack, extraData);
13
29
  },
14
30
  getDevServer: () => {
15
31
  const getDevServer = require('react-native/Libraries/Core/Devtools/getDevServer');
32
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
33
+ if (getDevServer.default && typeof getDevServer.default === 'function') {
34
+ // Starting with react-native 0.79, the getDevServer is a default export
35
+ // https://github.com/facebook/react-native/commit/e5818d92a867dbfa5f60d176b847b1f2131cb6da
36
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
37
+ return getDevServer.default();
38
+ }
39
+ // react-native 0.78 and below
16
40
  return getDevServer();
17
41
  },
18
42
  },
@@ -1 +1 @@
1
- {"version":3,"file":"rnlibraries.js","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAK1E,MAAM,qCAAqC,GAA4C;IACrF,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,UAAkB,EAAiC,EAAE;YACrE,MAAM,eAAe,GAAG,OAAO,CAAC,sDAAsD,CAAC,CAAC;YACxF,OAAO,eAAe,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;QACD,qBAAqB,EAAE,CACrB,KAAoC,EACpC,SAAmC,EACU,EAAE;YAC/C,MAAM,qBAAqB,GAAG,OAAO,CAAC,4DAA4D,CAAC,CAAC;YACpG,OAAO,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACjD,CAAC;QACD,YAAY,EAAE,GAA8B,EAAE;YAC5C,MAAM,YAAY,GAAG,OAAO,CAAC,mDAAmD,CAAC,CAAC;YAClF,OAAO,YAAY,EAAE,CAAC;QACxB,CAAC;KACF;IACD,OAAO,EAAE,OAAO,CAAC,gCAAgC,CAAC;IAClD,SAAS,EAAE;QACT,cAAc,EAAE,CAAI,IAAY,EAAE,QAAiB,EAAQ,EAAE;YAC3D,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,oDAAoD,CAAC,CAAC;YACzF,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjC,CAAC;KACF;IACD,kBAAkB,EAAE;QAClB,OAAO,EAAE,MAAA,QAAQ,CAAC,SAAS,0CAAE,kBAAkB;KAChD;IACD,mBAAmB;IACnB,WAAW;IACX,WAAW,EAAE;QACX,sBAAsB,EAAE,CAAI,QAAgB,EAAgC,EAAE;YAC5E,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;YAC3D,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAkC,qCAAqC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\nimport { AppRegistry, Platform, TurboModuleRegistry } from 'react-native';\n\nimport type * as ReactNative from '../vendor/react-native';\nimport type { ReactNativeLibrariesInterface } from './rnlibrariesinterface';\n\nconst InternalReactNativeLibrariesInterface: Required<ReactNativeLibrariesInterface> = {\n Devtools: {\n parseErrorStack: (errorStack: string): Array<ReactNative.StackFrame> => {\n const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');\n return parseErrorStack(errorStack);\n },\n symbolicateStackTrace: (\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n ): Promise<ReactNative.SymbolicatedStackTrace> => {\n const symbolicateStackTrace = require('react-native/Libraries/Core/Devtools/symbolicateStackTrace');\n return symbolicateStackTrace(stack, extraData);\n },\n getDevServer: (): ReactNative.DevServerInfo => {\n const getDevServer = require('react-native/Libraries/Core/Devtools/getDevServer');\n return getDevServer();\n },\n },\n Promise: require('react-native/Libraries/Promise'),\n Utilities: {\n polyfillGlobal: <T>(name: string, getValue: () => T): void => {\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n polyfillGlobal(name, getValue);\n },\n },\n ReactNativeVersion: {\n version: Platform.constants?.reactNativeVersion,\n },\n TurboModuleRegistry,\n AppRegistry,\n ReactNative: {\n requireNativeComponent: <T>(viewName: string): ReactNative.HostComponent<T> => {\n const { requireNativeComponent } = require('react-native');\n return requireNativeComponent(viewName);\n },\n },\n};\n\nexport const ReactNativeLibraries: ReactNativeLibrariesInterface = InternalReactNativeLibrariesInterface;\n"]}
1
+ {"version":3,"file":"rnlibraries.js","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAK1E,MAAM,qCAAqC,GAA4C;IACrF,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,UAAkB,EAAiC,EAAE;YACrE,MAAM,eAAe,GAAG,OAAO,CAAC,sDAAsD,CAAC,CAAC;YAExF,sEAAsE;YACtE,IAAI,eAAe,CAAC,OAAO,IAAI,OAAO,eAAe,CAAC,OAAO,KAAK,UAAU,EAAE;gBAC5E,2EAA2E;gBAC3E,2FAA2F;gBAC3F,sEAAsE;gB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,mBAAmB;IACnB,WAAW;IACX,WAAW,EAAE;QACX,sBAAsB,EAAE,CAAI,QAAgB,EAAgC,EAAE;YAC5E,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;YAC3D,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAkC,qCAAqC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\nimport { AppRegistry, Platform, TurboModuleRegistry } from 'react-native';\n\nimport type * as ReactNative from '../vendor/react-native';\nimport type { ReactNativeLibrariesInterface } from './rnlibrariesinterface';\n\nconst InternalReactNativeLibrariesInterface: Required<ReactNativeLibrariesInterface> = {\n Devtools: {\n parseErrorStack: (errorStack: string): Array<ReactNative.StackFrame> => {\n const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (parseErrorStack.default && typeof parseErrorStack.default === 'function') {\n // Starting with react-native 0.79, the parseErrorStack is a default export\n // https://github.com/facebook/react-native/commit/e5818d92a867dbfa5f60d176b847b1f2131cb6da\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return parseErrorStack.default(errorStack);\n }\n\n // react-native 0.78 and below\n return parseErrorStack(errorStack);\n },\n symbolicateStackTrace: (\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n ): Promise<ReactNative.SymbolicatedStackTrace> => {\n const symbolicateStackTrace = require('react-native/Libraries/Core/Devtools/symbolicateStackTrace');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (symbolicateStackTrace.default && typeof symbolicateStackTrace.default === 'function') {\n // Starting with react-native 0.79, the symbolicateStackTrace is a default export\n // https://github.com/facebook/react-native/commit/e5818d92a867dbfa5f60d176b847b1f2131cb6da\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return symbolicateStackTrace.default(stack, extraData);\n }\n\n // react-native 0.78 and below\n return symbolicateStackTrace(stack, extraData);\n },\n getDevServer: (): ReactNative.DevServerInfo => {\n const getDevServer = require('react-native/Libraries/Core/Devtools/getDevServer');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (getDevServer.default && typeof getDevServer.default === 'function') {\n // Starting with react-native 0.79, the getDevServer is a default export\n // https://github.com/facebook/react-native/commit/e5818d92a867dbfa5f60d176b847b1f2131cb6da\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return getDevServer.default();\n }\n\n // react-native 0.78 and below\n return getDevServer();\n },\n },\n Promise: require('react-native/Libraries/Promise'),\n Utilities: {\n polyfillGlobal: <T>(name: string, getValue: () => T): void => {\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n polyfillGlobal(name, getValue);\n },\n },\n ReactNativeVersion: {\n version: Platform.constants?.reactNativeVersion,\n },\n TurboModuleRegistry,\n AppRegistry,\n ReactNative: {\n requireNativeComponent: <T>(viewName: string): ReactNative.HostComponent<T> => {\n const { requireNativeComponent } = require('react-native');\n return requireNativeComponent(viewName);\n },\n },\n};\n\nexport const ReactNativeLibraries: ReactNativeLibrariesInterface = InternalReactNativeLibrariesInterface;\n"]}
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "6.12.0";
3
+ export declare const SDK_VERSION = "6.13.1";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
2
2
  export const SDK_NAME = 'sentry.javascript.react-native';
3
- export const SDK_VERSION = '6.12.0';
3
+ export const SDK_VERSION = '6.13.1';
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '6.12.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '6.13.1';\n"]}
@@ -3,4 +3,4 @@
3
3
  NSString *const NATIVE_SDK_NAME = @"sentry.cocoa.react-native";
4
4
  NSString *const REACT_NATIVE_SDK_NAME = @"sentry.javascript.react-native";
5
5
  NSString *const REACT_NATIVE_SDK_PACKAGE_NAME = @"npm:@sentry/react-native";
6
- NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"6.12.0";
6
+ NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"6.13.1";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sentry/react-native",
3
3
  "homepage": "https://github.com/getsentry/sentry-react-native",
4
4
  "repository": "https://github.com/getsentry/sentry-react-native",
5
- "version": "6.12.0",
5
+ "version": "6.13.1",
6
6
  "description": "Official Sentry SDK for react-native",
7
7
  "typings": "dist/js/index.d.ts",
8
8
  "types": "dist/js/index.d.ts",
@@ -5,7 +5,10 @@
5
5
  # print commands before executing them
6
6
  set -x
7
7
 
8
- [ -z "$WITH_ENVIRONMENT" ] && WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
8
+ # REACT_NATIVE_PATH first used in RN 0.74.0 Template https://github.com/facebook/react-native/commit/289e78388a87408e215a25108cb02511a05f5c80
9
+ LOCAL_REACT_NATIVE_PATH="${REACT_NATIVE_PATH:-"../node_modules/react-native"}"
10
+
11
+ [ -z "$WITH_ENVIRONMENT" ] && WITH_ENVIRONMENT="${LOCAL_REACT_NATIVE_PATH}/scripts/xcode/with-environment.sh"
9
12
 
10
13
  if [ -f "$WITH_ENVIRONMENT" ]; then
11
14
  # load envs if loader file exists (since rn 0.68)
@@ -6,6 +6,11 @@ declare global {
6
6
  * ref: https://github.com/facebook/react-native/issues/33652
7
7
  */
8
8
  export declare function isModalSupported(): boolean;
9
+ /**
10
+ * The native driver supports color animations since React Native 0.69.
11
+ * ref: https://github.com/facebook/react-native/commit/201f355479cafbcece3d9eb40a52bae003da3e5c
12
+ */
13
+ export declare function isNativeDriverSupportedForColorAnimations(): boolean;
9
14
  export declare const isValidEmail: (email: string) => boolean;
10
15
  /**
11
16
  * Converts base64 string to Uint8Array on the web
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "6.12.0";
3
+ export declare const SDK_VERSION = "6.13.1";
4
4
  //# sourceMappingURL=version.d.ts.map