react-native-pdf 6.7.0 → 6.7.2

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,15 @@ react-native run-ios
169
169
  <details>
170
170
  <summary>ChangeLog details</summary>
171
171
 
172
+ v6.7.2
173
+ 1. Fixed: fix iOS double tap zoom scrolling
174
+ 2. Fixed: fix RN 73 compatibility
175
+ 3. Fixed: bump crypto-js to avoid critical vulnerability
176
+
177
+ v6.7.1
178
+ 1. Fixed: fix ios project setting
179
+ 2. Fixed: fix typo in RNPDFPdfViewManagerInterface interface causing android build error
180
+
172
181
  v6.7.0
173
182
  1. Fixed: fix(iOS): center page at tap point after double tap to zoom
174
183
  2. Fixed: add PDFKit to podspec to make ios compile
@@ -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 "com.wonday.rnpdf"
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>
@@ -41,11 +41,11 @@ public class RNPDFPdfViewManagerDelegate<T extends View, U extends BaseViewManag
41
41
  mViewManager.setHorizontal(view, value == null ? false : (boolean) value);
42
42
  break;
43
43
  case "showsHorizontalScrollIndicator":
44
- // mViewManager.setShowsHorizontalScrollIndicator(view, value == null ? false : (boolean) value);
44
+ mViewManager.setShowsHorizontalScrollIndicator(view, value == null ? false : (boolean) value);
45
45
  break;
46
46
  case "showsVerticalScrollIndicator":
47
- // mViewManager.setShowsVerticalScrollIndicator(view, value == null ? false : (boolean) value);
48
- break;
47
+ mViewManager.setShowsVerticalScrollIndicator(view, value == null ? false : (boolean) value);
48
+ break;
49
49
  case "enablePaging":
50
50
  mViewManager.setEnablePaging(view, value == null ? false : (boolean) value);
51
51
  break;
@@ -19,8 +19,8 @@ public interface RNPDFPdfViewManagerInterface<T extends View> {
19
19
  void setMinScale(T view, float value);
20
20
  void setMaxScale(T view, float value);
21
21
  void setHorizontal(T view, boolean value);
22
- void showsHorizontalScrollIndicator(T view, boolean value);
23
- void showsVerticalScrollIndicator(T view, boolean value);
22
+ void setShowsHorizontalScrollIndicator(T view, boolean value);
23
+ void setShowsVerticalScrollIndicator(T view, boolean value);
24
24
  void setEnablePaging(T view, boolean value);
25
25
  void setEnableRTL(T view, boolean value);
26
26
  void setEnableAnnotationRendering(T view, boolean value);
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
@@ -7,12 +7,12 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
- 5267DA06210F0EDE00D20C59 /* RNPDFPdfView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.m */; };
11
- 5267DA07210F0EDE00D20C59 /* RNPDFPdfViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.m */; };
10
+ 5267DA06210F0EDE00D20C59 /* RNPDFPdfView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.mm */; };
11
+ 5267DA07210F0EDE00D20C59 /* RNPDFPdfViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.mm */; };
12
12
  5267DA0A210F0F0800D20C59 /* PDFKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5267DA09210F0F0800D20C59 /* PDFKit.framework */; };
13
- 526B80401EABD92200259970 /* RNPDFPdfPageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.m */; };
14
- 52A324EA1FD3C3FB000B0B18 /* PdfManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 52A324E91FD3C3FB000B0B18 /* PdfManager.m */; };
15
- 52F79DB71EB2DA4F00CAD00C /* RNPDFPdfPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.m */; };
13
+ 526B80401EABD92200259970 /* RNPDFPdfPageViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.mm */; };
14
+ 52A324EA1FD3C3FB000B0B18 /* PdfManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52A324E91FD3C3FB000B0B18 /* PdfManager.mm */; };
15
+ 52F79DB71EB2DA4F00CAD00C /* RNPDFPdfPageView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.mm */; };
16
16
  /* End PBXBuildFile section */
17
17
 
18
18
  /* Begin PBXCopyFilesBuildPhase section */
@@ -30,16 +30,16 @@
30
30
  /* Begin PBXFileReference section */
31
31
  20D8E03F1C8E946C00039823 /* libRNPDFPdf.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNPDFPdf.a; sourceTree = BUILT_PRODUCTS_DIR; };
32
32
  5267DA02210F0EDD00D20C59 /* RNPDFPdfView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPDFPdfView.h; sourceTree = "<group>"; };
33
- 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfView.m; sourceTree = "<group>"; };
33
+ 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfView.mm; sourceTree = "<group>"; };
34
34
  5267DA04210F0EDD00D20C59 /* RNPDFPdfViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPDFPdfViewManager.h; sourceTree = "<group>"; };
35
- 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfViewManager.m; sourceTree = "<group>"; };
35
+ 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfViewManager.mm; sourceTree = "<group>"; };
36
36
  5267DA09210F0F0800D20C59 /* PDFKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PDFKit.framework; path = System/Library/Frameworks/PDFKit.framework; sourceTree = SDKROOT; };
37
37
  526B803E1EABD92200259970 /* RNPDFPdfPageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPDFPdfPageViewManager.h; sourceTree = "<group>"; };
38
- 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfPageViewManager.m; sourceTree = "<group>"; };
38
+ 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfPageViewManager.mm; sourceTree = "<group>"; };
39
39
  52A324E81FD3C3FB000B0B18 /* PdfManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PdfManager.h; sourceTree = "<group>"; };
40
- 52A324E91FD3C3FB000B0B18 /* PdfManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PdfManager.m; sourceTree = "<group>"; };
40
+ 52A324E91FD3C3FB000B0B18 /* PdfManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PdfManager.mm; sourceTree = "<group>"; };
41
41
  52F79DB31EB2DA4F00CAD00C /* RNPDFPdfPageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPDFPdfPageView.h; sourceTree = "<group>"; };
42
- 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfPageView.m; sourceTree = "<group>"; };
42
+ 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfPageView.mm; sourceTree = "<group>"; };
43
43
  /* End PBXFileReference section */
44
44
 
45
45
  /* Begin PBXFrameworksBuildPhase section */
@@ -75,15 +75,15 @@
75
75
  isa = PBXGroup;
76
76
  children = (
77
77
  5267DA02210F0EDD00D20C59 /* RNPDFPdfView.h */,
78
- 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.m */,
78
+ 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.mm */,
79
79
  5267DA04210F0EDD00D20C59 /* RNPDFPdfViewManager.h */,
80
- 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.m */,
80
+ 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.mm */,
81
81
  52A324E81FD3C3FB000B0B18 /* PdfManager.h */,
82
- 52A324E91FD3C3FB000B0B18 /* PdfManager.m */,
82
+ 52A324E91FD3C3FB000B0B18 /* PdfManager.mm */,
83
83
  52F79DB31EB2DA4F00CAD00C /* RNPDFPdfPageView.h */,
84
- 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.m */,
84
+ 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.mm */,
85
85
  526B803E1EABD92200259970 /* RNPDFPdfPageViewManager.h */,
86
- 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.m */,
86
+ 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.mm */,
87
87
  );
88
88
  path = RNPDFPdf;
89
89
  sourceTree = "<group>";
@@ -153,11 +153,11 @@
153
153
  isa = PBXSourcesBuildPhase;
154
154
  buildActionMask = 2147483647;
155
155
  files = (
156
- 52A324EA1FD3C3FB000B0B18 /* PdfManager.m in Sources */,
157
- 5267DA07210F0EDE00D20C59 /* RNPDFPdfViewManager.m in Sources */,
158
- 5267DA06210F0EDE00D20C59 /* RNPDFPdfView.m in Sources */,
159
- 526B80401EABD92200259970 /* RNPDFPdfPageViewManager.m in Sources */,
160
- 52F79DB71EB2DA4F00CAD00C /* RNPDFPdfPageView.m in Sources */,
156
+ 52A324EA1FD3C3FB000B0B18 /* PdfManager.mm in Sources */,
157
+ 5267DA07210F0EDE00D20C59 /* RNPDFPdfViewManager.mm in Sources */,
158
+ 5267DA06210F0EDE00D20C59 /* RNPDFPdfView.mm in Sources */,
159
+ 526B80401EABD92200259970 /* RNPDFPdfPageViewManager.mm in Sources */,
160
+ 52F79DB71EB2DA4F00CAD00C /* RNPDFPdfPageView.mm in Sources */,
161
161
  );
162
162
  runOnlyForDeploymentPostprocessing = 0;
163
163
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-pdf",
3
- "version": "6.7.0",
3
+ "version": "6.7.2",
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": {
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>SchemeUserState</key>
6
- <dict>
7
- <key>RCTPdf.xcscheme_^#shared#^_</key>
8
- <dict>
9
- <key>orderHint</key>
10
- <integer>52</integer>
11
- </dict>
12
- </dict>
13
- </dict>
14
- </plist>