react-native-pdf 6.7.1 → 6.7.3

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/PdfView.js CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  'use strict';
10
10
  import React, {Component} from 'react';
11
- import {ScrollView, FlatList, View, StyleSheet} from 'react-native';
11
+ import {ScrollView, View, StyleSheet} from 'react-native';
12
12
  import {ViewPropTypes} from 'deprecated-react-native-prop-types';
13
13
  import PropTypes from 'prop-types';
14
14
 
@@ -413,4 +413,4 @@ const styles = StyleSheet.create({
413
413
  container: {
414
414
  flex: 1
415
415
  }
416
- });
416
+ });
@@ -7,7 +7,6 @@
7
7
  */
8
8
 
9
9
  'use strict';
10
- import React, {Component} from 'react';
11
10
  import {
12
11
  FlatList,
13
12
  } from 'react-native';
@@ -28,4 +27,4 @@ export default class PdfViewFlatList extends FlatList {
28
27
  this._listRef._scrollRef.scrollTo({x: x, y: y, animated: false});
29
28
  }
30
29
 
31
- }
30
+ }
package/README.md CHANGED
@@ -169,6 +169,14 @@ react-native run-ios
169
169
  <details>
170
170
  <summary>ChangeLog details</summary>
171
171
 
172
+ v6.7.3
173
+ 1. Fixed: fix android package name
174
+
175
+ v6.7.2
176
+ 1. Fixed: fix iOS double tap zoom scrolling
177
+ 2. Fixed: fix RN 73 compatibility
178
+ 3. Fixed: bump crypto-js to avoid critical vulnerability
179
+
172
180
  v6.7.1
173
181
  1. Fixed: fix ios project setting
174
182
  2. Fixed: fix typo in RNPDFPdfViewManagerInterface interface causing android build error
@@ -79,6 +79,10 @@ if (isNewArchitectureEnabled()) {
79
79
  }
80
80
 
81
81
  android {
82
+ def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
83
+ if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
84
+ namespace "org.wonday.pdf"
85
+ }
82
86
  compileSdkVersion safeExtGet('compileSdkVersion', 31)
83
87
 
84
88
  defaultConfig {
@@ -1,5 +1,4 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="org.wonday.pdf">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
2
 
4
3
 
5
- </manifest>
4
+ </manifest>
package/index.d.ts CHANGED
@@ -27,7 +27,7 @@ export type Source = {
27
27
  method?: string;
28
28
  };
29
29
 
30
- interface Props {
30
+ interface PdfProps {
31
31
  style?: ReactNative.StyleProp<ReactNative.ViewStyle>,
32
32
  source: Source | number,
33
33
  page?: number,
@@ -56,7 +56,7 @@ interface Props {
56
56
  onPressLink?: (url: string) => void,
57
57
  }
58
58
 
59
- declare class Pdf extends React.Component<Props, any> {
59
+ declare class Pdf extends React.Component<PdfProps, any> {
60
60
  setPage: (pageNumber: number) => void;
61
61
  }
62
62
 
package/index.js CHANGED
@@ -14,7 +14,8 @@ import {
14
14
  Platform,
15
15
  StyleSheet,
16
16
  Image,
17
- Text
17
+ Text,
18
+ requireNativeComponent
18
19
  } from 'react-native';
19
20
  import PdfViewNativeComponent, {
20
21
  Commands as PdfViewCommands,
@@ -74,6 +74,7 @@ const float MIN_SCALE = 1.0f;
74
74
  UITapGestureRecognizer *_singleTapRecognizer;
75
75
  UIPinchGestureRecognizer *_pinchRecognizer;
76
76
  UILongPressGestureRecognizer *_longPressRecognizer;
77
+ UITapGestureRecognizer *_doubleTapEmptyRecognizer;
77
78
  }
78
79
 
79
80
  #ifdef RCT_NEW_ARCH_ENABLED
@@ -187,6 +188,7 @@ using namespace facebook::react;
187
188
  [self removeGestureRecognizer:_singleTapRecognizer];
188
189
  [self removeGestureRecognizer:_pinchRecognizer];
189
190
  [self removeGestureRecognizer:_longPressRecognizer];
191
+ [self removeGestureRecognizer:_doubleTapEmptyRecognizer];
190
192
 
191
193
  [self initCommonProps];
192
194
  }
@@ -556,6 +558,7 @@ using namespace facebook::react;
556
558
  _singleTapRecognizer = nil;
557
559
  _pinchRecognizer = nil;
558
560
  _longPressRecognizer = nil;
561
+ _doubleTapEmptyRecognizer = nil;
559
562
  }
560
563
 
561
564
  #pragma mark notification process
@@ -687,6 +690,13 @@ using namespace facebook::react;
687
690
 
688
691
  #pragma mark gesture process
689
692
 
693
+ /**
694
+ * Empty double tap handler
695
+ *
696
+ *
697
+ */
698
+ - (void)handleDoubleTapEmpty:(UITapGestureRecognizer *)recognizer {}
699
+
690
700
  /**
691
701
  * Tap
692
702
  * zoom reset or zoom in
@@ -836,6 +846,12 @@ using namespace facebook::react;
836
846
  [self addGestureRecognizer:longPressRecognizer];
837
847
  _longPressRecognizer = longPressRecognizer;
838
848
 
849
+ // Override the _pdfView double tap gesture recognizer so that it doesn't confilict with custom double tap
850
+ UITapGestureRecognizer *doubleTapEmptyRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
851
+ action:@selector(handleDoubleTapEmpty:)];
852
+ doubleTapEmptyRecognizer.numberOfTapsRequired = 2;
853
+ [_pdfView addGestureRecognizer:doubleTapEmptyRecognizer];
854
+ _doubleTapEmptyRecognizer = doubleTapEmptyRecognizer;
839
855
  }
840
856
 
841
857
  - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-pdf",
3
- "version": "6.7.1",
3
+ "version": "6.7.3",
4
4
  "summary": "A react native PDF view component",
5
5
  "description": "A react native PDF view component, support ios and android platform",
6
6
  "main": "index.js",
@@ -28,7 +28,7 @@
28
28
  "url": "https://github.com/wonday/react-native-pdf/issues"
29
29
  },
30
30
  "dependencies": {
31
- "crypto-js": "^3.2.0",
31
+ "crypto-js": "4.2.0",
32
32
  "deprecated-react-native-prop-types": "^2.3.0"
33
33
  },
34
34
  "devDependencies": {