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 +2 -2
- package/PdfViewFlatList.js +1 -2
- package/README.md +9 -0
- package/android/build.gradle +4 -0
- package/android/src/main/AndroidManifest.xml +2 -3
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java +3 -3
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java +2 -2
- package/index.d.ts +2 -2
- package/index.js +2 -1
- package/ios/RNPDFPdf/RNPDFPdfView.mm +16 -0
- package/ios/RNPDFPdf.xcodeproj/project.pbxproj +20 -20
- package/package.json +2 -2
- package/ios/RCTPdf.xcodeproj/xcuserdata/wonday.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
package/PdfView.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
10
10
|
import React, {Component} from 'react';
|
|
11
|
-
import {ScrollView,
|
|
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
|
+
});
|
package/PdfViewFlatList.js
CHANGED
|
@@ -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
|
package/android/build.gradle
CHANGED
|
@@ -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 {
|
package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java
CHANGED
|
@@ -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
|
-
|
|
44
|
+
mViewManager.setShowsHorizontalScrollIndicator(view, value == null ? false : (boolean) value);
|
|
45
45
|
break;
|
|
46
46
|
case "showsVerticalScrollIndicator":
|
|
47
|
-
|
|
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;
|
package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java
CHANGED
|
@@ -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
|
|
23
|
-
void
|
|
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
|
|
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<
|
|
59
|
+
declare class Pdf extends React.Component<PdfProps, any> {
|
|
60
60
|
setPage: (pageNumber: number) => void;
|
|
61
61
|
}
|
|
62
62
|
|
package/index.js
CHANGED
|
@@ -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.
|
|
11
|
-
5267DA07210F0EDE00D20C59 /* RNPDFPdfViewManager.
|
|
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.
|
|
14
|
-
52A324EA1FD3C3FB000B0B18 /* PdfManager.
|
|
15
|
-
52F79DB71EB2DA4F00CAD00C /* RNPDFPdfPageView.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
78
|
+
5267DA03210F0EDD00D20C59 /* RNPDFPdfView.mm */,
|
|
79
79
|
5267DA04210F0EDD00D20C59 /* RNPDFPdfViewManager.h */,
|
|
80
|
-
5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.
|
|
80
|
+
5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.mm */,
|
|
81
81
|
52A324E81FD3C3FB000B0B18 /* PdfManager.h */,
|
|
82
|
-
52A324E91FD3C3FB000B0B18 /* PdfManager.
|
|
82
|
+
52A324E91FD3C3FB000B0B18 /* PdfManager.mm */,
|
|
83
83
|
52F79DB31EB2DA4F00CAD00C /* RNPDFPdfPageView.h */,
|
|
84
|
-
52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.
|
|
84
|
+
52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.mm */,
|
|
85
85
|
526B803E1EABD92200259970 /* RNPDFPdfPageViewManager.h */,
|
|
86
|
-
526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.
|
|
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.
|
|
157
|
-
5267DA07210F0EDE00D20C59 /* RNPDFPdfViewManager.
|
|
158
|
-
5267DA06210F0EDE00D20C59 /* RNPDFPdfView.
|
|
159
|
-
526B80401EABD92200259970 /* RNPDFPdfPageViewManager.
|
|
160
|
-
52F79DB71EB2DA4F00CAD00C /* RNPDFPdfPageView.
|
|
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.
|
|
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": "
|
|
31
|
+
"crypto-js": "4.2.0",
|
|
32
32
|
"deprecated-react-native-prop-types": "^2.3.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
package/ios/RCTPdf.xcodeproj/xcuserdata/wonday.xcuserdatad/xcschemes/xcschememanagement.plist
DELETED
|
@@ -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>
|