react-native-pdf 6.6.2 → 6.7.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 (25) hide show
  1. package/README.md +13 -41
  2. package/android/build.gradle +71 -13
  3. package/android/src/main/java/org/wonday/pdf/{RCTPdfManager.java → PdfManager.java} +57 -21
  4. package/android/src/main/java/org/wonday/pdf/PdfView.java +25 -0
  5. package/android/src/main/java/org/wonday/pdf/{RCTPdfView.java → RNPDFPackage.java} +2 -3
  6. package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java +86 -0
  7. package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java +33 -0
  8. package/fabric/RNPDFPdfNativeComponent.js +46 -0
  9. package/index.d.ts +2 -0
  10. package/index.js +25 -27
  11. package/index.js.flow +2 -0
  12. package/ios/{RCTPdf/PdfManager.m → RNPDFPdf/PdfManager.mm} +1 -1
  13. package/ios/{RCTPdf/RCTPdfPageView.h → RNPDFPdf/RNPDFPdfPageView.h} +1 -1
  14. package/ios/{RCTPdf/RCTPdfPageView.m → RNPDFPdf/RNPDFPdfPageView.mm} +5 -5
  15. package/ios/{RCTPdf/RCTPdfPageViewManager.h → RNPDFPdf/RNPDFPdfPageViewManager.h} +1 -1
  16. package/ios/{RCTPdf/RCTPdfPageViewManager.m → RNPDFPdf/RNPDFPdfPageViewManager.mm} +4 -4
  17. package/ios/{RCTPdf/RCTPdfView.h → RNPDFPdf/RNPDFPdfView.h} +15 -5
  18. package/ios/{RCTPdf/RCTPdfView.m → RNPDFPdf/RNPDFPdfView.mm} +321 -54
  19. package/ios/{RCTPdf/RCTPdfViewManager.h → RNPDFPdf/RNPDFPdfViewManager.h} +1 -1
  20. package/ios/{RCTPdf/RCTPdfViewManager.m → RNPDFPdf/RNPDFPdfViewManager.mm} +7 -5
  21. package/ios/{RCTPdf.xcodeproj → RNPDFPdf.xcodeproj}/project.pbxproj +38 -38
  22. package/package.json +19 -3
  23. package/react-native-pdf.podspec +28 -3
  24. package/windows/RCTPdf/pch.h +2 -0
  25. /package/ios/{RCTPdf → RNPDFPdf}/PdfManager.h +0 -0
@@ -7,12 +7,12 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
- 5267DA06210F0EDE00D20C59 /* RCTPdfView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA03210F0EDD00D20C59 /* RCTPdfView.m */; };
11
- 5267DA07210F0EDE00D20C59 /* RCTPdfViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA05210F0EDE00D20C59 /* RCTPdfViewManager.m */; };
10
+ 5267DA06210F0EDE00D20C59 /* RNPDFPdfView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.m */; };
11
+ 5267DA07210F0EDE00D20C59 /* RNPDFPdfViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.m */; };
12
12
  5267DA0A210F0F0800D20C59 /* PDFKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5267DA09210F0F0800D20C59 /* PDFKit.framework */; };
13
- 526B80401EABD92200259970 /* RCTPdfPageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 526B803F1EABD92200259970 /* RCTPdfPageViewManager.m */; };
13
+ 526B80401EABD92200259970 /* RNPDFPdfPageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.m */; };
14
14
  52A324EA1FD3C3FB000B0B18 /* PdfManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 52A324E91FD3C3FB000B0B18 /* PdfManager.m */; };
15
- 52F79DB71EB2DA4F00CAD00C /* RCTPdfPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 52F79DB41EB2DA4F00CAD00C /* RCTPdfPageView.m */; };
15
+ 52F79DB71EB2DA4F00CAD00C /* RNPDFPdfPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.m */; };
16
16
  /* End PBXBuildFile section */
17
17
 
18
18
  /* Begin PBXCopyFilesBuildPhase section */
@@ -28,18 +28,18 @@
28
28
  /* End PBXCopyFilesBuildPhase section */
29
29
 
30
30
  /* Begin PBXFileReference section */
31
- 20D8E03F1C8E946C00039823 /* libRCTPdf.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTPdf.a; sourceTree = BUILT_PRODUCTS_DIR; };
32
- 5267DA02210F0EDD00D20C59 /* RCTPdfView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPdfView.h; sourceTree = "<group>"; };
33
- 5267DA03210F0EDD00D20C59 /* RCTPdfView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPdfView.m; sourceTree = "<group>"; };
34
- 5267DA04210F0EDD00D20C59 /* RCTPdfViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPdfViewManager.h; sourceTree = "<group>"; };
35
- 5267DA05210F0EDE00D20C59 /* RCTPdfViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPdfViewManager.m; sourceTree = "<group>"; };
31
+ 20D8E03F1C8E946C00039823 /* libRNPDFPdf.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNPDFPdf.a; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
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>"; };
36
36
  5267DA09210F0F0800D20C59 /* PDFKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PDFKit.framework; path = System/Library/Frameworks/PDFKit.framework; sourceTree = SDKROOT; };
37
- 526B803E1EABD92200259970 /* RCTPdfPageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPdfPageViewManager.h; sourceTree = "<group>"; };
38
- 526B803F1EABD92200259970 /* RCTPdfPageViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPdfPageViewManager.m; sourceTree = "<group>"; };
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>"; };
39
39
  52A324E81FD3C3FB000B0B18 /* PdfManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PdfManager.h; sourceTree = "<group>"; };
40
40
  52A324E91FD3C3FB000B0B18 /* PdfManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PdfManager.m; sourceTree = "<group>"; };
41
- 52F79DB31EB2DA4F00CAD00C /* RCTPdfPageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPdfPageView.h; sourceTree = "<group>"; };
42
- 52F79DB41EB2DA4F00CAD00C /* RCTPdfPageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPdfPageView.m; sourceTree = "<group>"; };
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>"; };
43
43
  /* End PBXFileReference section */
44
44
 
45
45
  /* Begin PBXFrameworksBuildPhase section */
@@ -57,7 +57,7 @@
57
57
  20D8E0361C8E946C00039823 = {
58
58
  isa = PBXGroup;
59
59
  children = (
60
- 20D8E0411C8E946C00039823 /* RCTPdf */,
60
+ 20D8E0411C8E946C00039823 /* RNPDFPdf */,
61
61
  20D8E0401C8E946C00039823 /* Products */,
62
62
  5267DA08210F0F0800D20C59 /* Frameworks */,
63
63
  );
@@ -66,26 +66,26 @@
66
66
  20D8E0401C8E946C00039823 /* Products */ = {
67
67
  isa = PBXGroup;
68
68
  children = (
69
- 20D8E03F1C8E946C00039823 /* libRCTPdf.a */,
69
+ 20D8E03F1C8E946C00039823 /* libRNPDFPdf.a */,
70
70
  );
71
71
  name = Products;
72
72
  sourceTree = "<group>";
73
73
  };
74
- 20D8E0411C8E946C00039823 /* RCTPdf */ = {
74
+ 20D8E0411C8E946C00039823 /* RNPDFPdf */ = {
75
75
  isa = PBXGroup;
76
76
  children = (
77
- 5267DA02210F0EDD00D20C59 /* RCTPdfView.h */,
78
- 5267DA03210F0EDD00D20C59 /* RCTPdfView.m */,
79
- 5267DA04210F0EDD00D20C59 /* RCTPdfViewManager.h */,
80
- 5267DA05210F0EDE00D20C59 /* RCTPdfViewManager.m */,
77
+ 5267DA02210F0EDD00D20C59 /* RNPDFPdfView.h */,
78
+ 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.m */,
79
+ 5267DA04210F0EDD00D20C59 /* RNPDFPdfViewManager.h */,
80
+ 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.m */,
81
81
  52A324E81FD3C3FB000B0B18 /* PdfManager.h */,
82
82
  52A324E91FD3C3FB000B0B18 /* PdfManager.m */,
83
- 52F79DB31EB2DA4F00CAD00C /* RCTPdfPageView.h */,
84
- 52F79DB41EB2DA4F00CAD00C /* RCTPdfPageView.m */,
85
- 526B803E1EABD92200259970 /* RCTPdfPageViewManager.h */,
86
- 526B803F1EABD92200259970 /* RCTPdfPageViewManager.m */,
83
+ 52F79DB31EB2DA4F00CAD00C /* RNPDFPdfPageView.h */,
84
+ 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.m */,
85
+ 526B803E1EABD92200259970 /* RNPDFPdfPageViewManager.h */,
86
+ 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.m */,
87
87
  );
88
- path = RCTPdf;
88
+ path = RNPDFPdf;
89
89
  sourceTree = "<group>";
90
90
  };
91
91
  5267DA08210F0F0800D20C59 /* Frameworks */ = {
@@ -99,9 +99,9 @@
99
99
  /* End PBXGroup section */
100
100
 
101
101
  /* Begin PBXNativeTarget section */
102
- 20D8E03E1C8E946C00039823 /* RCTPdf */ = {
102
+ 20D8E03E1C8E946C00039823 /* RNPDFPdf */ = {
103
103
  isa = PBXNativeTarget;
104
- buildConfigurationList = 20D8E0481C8E946C00039823 /* Build configuration list for PBXNativeTarget "RCTPdf" */;
104
+ buildConfigurationList = 20D8E0481C8E946C00039823 /* Build configuration list for PBXNativeTarget "RNPDFPdf" */;
105
105
  buildPhases = (
106
106
  20D8E03B1C8E946C00039823 /* Sources */,
107
107
  20D8E03C1C8E946C00039823 /* Frameworks */,
@@ -111,9 +111,9 @@
111
111
  );
112
112
  dependencies = (
113
113
  );
114
- name = RCTPdf;
115
- productName = RCTPdf;
116
- productReference = 20D8E03F1C8E946C00039823 /* libRCTPdf.a */;
114
+ name = RNPDFPdf;
115
+ productName = RNPDFPdf;
116
+ productReference = 20D8E03F1C8E946C00039823 /* libRNPDFPdf.a */;
117
117
  productType = "com.apple.product-type.library.static";
118
118
  };
119
119
  /* End PBXNativeTarget section */
@@ -131,7 +131,7 @@
131
131
  };
132
132
  };
133
133
  };
134
- buildConfigurationList = 20D8E03A1C8E946C00039823 /* Build configuration list for PBXProject "RCTPdf" */;
134
+ buildConfigurationList = 20D8E03A1C8E946C00039823 /* Build configuration list for PBXProject "RNPDFPdf" */;
135
135
  compatibilityVersion = "Xcode 3.2";
136
136
  developmentRegion = English;
137
137
  hasScannedForEncodings = 0;
@@ -143,7 +143,7 @@
143
143
  projectDirPath = "";
144
144
  projectRoot = "";
145
145
  targets = (
146
- 20D8E03E1C8E946C00039823 /* RCTPdf */,
146
+ 20D8E03E1C8E946C00039823 /* RNPDFPdf */,
147
147
  );
148
148
  };
149
149
  /* End PBXProject section */
@@ -154,10 +154,10 @@
154
154
  buildActionMask = 2147483647;
155
155
  files = (
156
156
  52A324EA1FD3C3FB000B0B18 /* PdfManager.m in Sources */,
157
- 5267DA07210F0EDE00D20C59 /* RCTPdfViewManager.m in Sources */,
158
- 5267DA06210F0EDE00D20C59 /* RCTPdfView.m in Sources */,
159
- 526B80401EABD92200259970 /* RCTPdfPageViewManager.m in Sources */,
160
- 52F79DB71EB2DA4F00CAD00C /* RCTPdfPageView.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 */,
161
161
  );
162
162
  runOnlyForDeploymentPostprocessing = 0;
163
163
  };
@@ -297,7 +297,7 @@
297
297
  /* End XCBuildConfiguration section */
298
298
 
299
299
  /* Begin XCConfigurationList section */
300
- 20D8E03A1C8E946C00039823 /* Build configuration list for PBXProject "RCTPdf" */ = {
300
+ 20D8E03A1C8E946C00039823 /* Build configuration list for PBXProject "RNPDFPdf" */ = {
301
301
  isa = XCConfigurationList;
302
302
  buildConfigurations = (
303
303
  20D8E0461C8E946C00039823 /* Debug */,
@@ -306,7 +306,7 @@
306
306
  defaultConfigurationIsVisible = 0;
307
307
  defaultConfigurationName = Release;
308
308
  };
309
- 20D8E0481C8E946C00039823 /* Build configuration list for PBXNativeTarget "RCTPdf" */ = {
309
+ 20D8E0481C8E946C00039823 /* Build configuration list for PBXNativeTarget "RNPDFPdf" */ = {
310
310
  isa = XCConfigurationList;
311
311
  buildConfigurations = (
312
312
  20D8E0491C8E946C00039823 /* Debug */,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-pdf",
3
- "version": "6.6.2",
3
+ "version": "6.7.0",
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",
@@ -32,8 +32,15 @@
32
32
  "deprecated-react-native-prop-types": "^2.3.0"
33
33
  },
34
34
  "devDependencies": {
35
+ "@babel/core": "^7.20.2",
36
+ "@babel/runtime": "^7.20.1",
35
37
  "prop-types": "^15.7.2"
36
38
  },
39
+ "peerDependencies": {
40
+ "react": "*",
41
+ "react-native": "*",
42
+ "react-native-blob-util": ">=0.13.7"
43
+ },
37
44
  "files": [
38
45
  "android/",
39
46
  "ios/",
@@ -47,6 +54,15 @@
47
54
  "PdfView.js",
48
55
  "PdfViewFlatList.js",
49
56
  "PinchZoomView.js",
50
- "react-native-pdf.podspec"
51
- ]
57
+ "react-native-pdf.podspec",
58
+ "fabric/"
59
+ ],
60
+ "codegenConfig": {
61
+ "name": "rnpdf",
62
+ "type": "components",
63
+ "jsSrcsDir": "./fabric",
64
+ "android": {
65
+ "javaPackageName": "org.wonday.pdf"
66
+ }
67
+ }
52
68
  }
@@ -2,6 +2,8 @@ require 'json'
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
4
 
5
+ fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
6
+
5
7
  Pod::Spec.new do |s|
6
8
  s.name = package['name']
7
9
  s.version = package['version']
@@ -12,7 +14,30 @@ Pod::Spec.new do |s|
12
14
  s.homepage = package['homepage']
13
15
  s.source = { :git => 'https://github.com/wonday/react-native-pdf.git', :tag => "v#{s.version}" }
14
16
  s.requires_arc = true
15
- s.platform = :ios, '8.0'
16
- s.source_files = 'ios/**/*.{h,m}'
17
- s.dependency 'React-Core'
17
+ s.framework = "PDFKit"
18
+
19
+ if fabric_enabled
20
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
21
+
22
+ s.pod_target_xcconfig = {
23
+ 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly"',
24
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
25
+ }
26
+ s.platforms = { ios: '11.0', tvos: '11.0' }
27
+ s.compiler_flags = folly_compiler_flags + ' -DRCT_NEW_ARCH_ENABLED'
28
+ s.source_files = 'ios/**/*.{h,m,mm,cpp}'
29
+ s.requires_arc = true
30
+
31
+ s.dependency "React"
32
+ s.dependency "React-RCTFabric"
33
+ s.dependency "React-Codegen"
34
+ s.dependency "RCT-Folly"
35
+ s.dependency "RCTRequired"
36
+ s.dependency "RCTTypeSafety"
37
+ s.dependency "ReactCommon/turbomodule/core"
38
+ else
39
+ s.platform = :ios, '8.0'
40
+ s.source_files = 'ios/**/*.{h,m,mm}'
41
+ s.dependency 'React-Core'
42
+ end
18
43
  end
@@ -26,4 +26,6 @@
26
26
  #include <winrt/Windows.UI.Xaml.Media.h>
27
27
  #include <winrt/Windows.UI.Xaml.Media.Imaging.h>
28
28
  #include <winrt/Windows.UI.Xaml.Navigation.h>
29
+ #include <winrt/Microsoft.UI.Xaml.Controls.h>
30
+ #include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
29
31
  #include <winrt/Microsoft.ReactNative.h>
File without changes