@amafil/react-native-pdf-toolkit 1.1.2 → 1.1.17
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/README.md +0 -57
- package/android/.gradle/8.5/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/8.5/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.5/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/8.5/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfManager.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$1.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$2.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView$3.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/wonday/pdf/PdfView.dex +0 -0
- package/android/build/.transforms/2892d280277a194daf04e3af971b529e/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/e40f3b884607647e8beb6dabe8165962/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java +0 -30
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java +0 -10
- package/android/build/generated/source/codegen/jni/react/renderer/components/rnpdf/Props.cpp +0 -35
- package/android/build/generated/source/codegen/jni/react/renderer/components/rnpdf/Props.h +0 -7
- package/android/build/generated/source/codegen/schema.json +1 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfManager.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/wonday/pdf/PdfView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/wonday/pdf/PdfView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/src/main/java/org/wonday/pdf/PdfManager.java +6 -63
- package/android/src/main/java/org/wonday/pdf/PdfView.java +4 -1189
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java +0 -30
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java +0 -10
- package/fabric/RNPDFPdfNativeComponent.js +3 -18
- package/index.d.ts +1 -102
- package/index.js +0 -110
- package/index.js.flow +0 -72
- package/ios/RNPDFPdf/RNPDFPdfView.h +0 -11
- package/ios/RNPDFPdf/RNPDFPdfView.mm +0 -1242
- package/ios/RNPDFPdf/RNPDFPdfViewManager.mm +0 -37
- package/package.json +5 -6
- package/annotationDocumentUtils.js +0 -74
|
@@ -46,13 +46,6 @@ RCT_EXPORT_VIEW_PROPERTY(enablePaging, BOOL);
|
|
|
46
46
|
RCT_EXPORT_VIEW_PROPERTY(enableRTL, BOOL);
|
|
47
47
|
RCT_EXPORT_VIEW_PROPERTY(enableAnnotationRendering, BOOL);
|
|
48
48
|
RCT_EXPORT_VIEW_PROPERTY(enableDoubleTapZoom, BOOL);
|
|
49
|
-
RCT_EXPORT_VIEW_PROPERTY(annotations, NSString);
|
|
50
|
-
RCT_EXPORT_VIEW_PROPERTY(annotationMode, BOOL);
|
|
51
|
-
RCT_EXPORT_VIEW_PROPERTY(annotationTool, NSString);
|
|
52
|
-
RCT_EXPORT_VIEW_PROPERTY(annotationEditable, BOOL);
|
|
53
|
-
RCT_EXPORT_VIEW_PROPERTY(annotationIdMode, NSString);
|
|
54
|
-
RCT_EXPORT_VIEW_PROPERTY(annotationInkColor, NSString);
|
|
55
|
-
RCT_EXPORT_VIEW_PROPERTY(annotationInkThickness, float);
|
|
56
49
|
RCT_EXPORT_VIEW_PROPERTY(fitPolicy, int);
|
|
57
50
|
RCT_EXPORT_VIEW_PROPERTY(spacing, int);
|
|
58
51
|
RCT_EXPORT_VIEW_PROPERTY(password, NSString);
|
|
@@ -83,36 +76,6 @@ RCT_EXPORT_METHOD(stopAutoScroll:(nonnull NSNumber *)reactTag)
|
|
|
83
76
|
}];
|
|
84
77
|
}
|
|
85
78
|
|
|
86
|
-
RCT_EXPORT_METHOD(saveAnnotations:(nonnull NSNumber *)reactTag)
|
|
87
|
-
{
|
|
88
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
89
|
-
RNPDFPdfView *view = (RNPDFPdfView *)viewRegistry[reactTag];
|
|
90
|
-
if ([view isKindOfClass:[RNPDFPdfView class]]) {
|
|
91
|
-
[view saveAnnotations];
|
|
92
|
-
}
|
|
93
|
-
}];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
RCT_EXPORT_METHOD(deleteSelectedAnnotation:(nonnull NSNumber *)reactTag)
|
|
97
|
-
{
|
|
98
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
99
|
-
RNPDFPdfView *view = (RNPDFPdfView *)viewRegistry[reactTag];
|
|
100
|
-
if ([view isKindOfClass:[RNPDFPdfView class]]) {
|
|
101
|
-
[view deleteSelectedAnnotation];
|
|
102
|
-
}
|
|
103
|
-
}];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
RCT_EXPORT_METHOD(deleteAllAnnotations:(nonnull NSNumber *)reactTag)
|
|
107
|
-
{
|
|
108
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
109
|
-
RNPDFPdfView *view = (RNPDFPdfView *)viewRegistry[reactTag];
|
|
110
|
-
if ([view isKindOfClass:[RNPDFPdfView class]]) {
|
|
111
|
-
[view deleteAllAnnotations];
|
|
112
|
-
}
|
|
113
|
-
}];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
79
|
RCT_EXPORT_METHOD(supportPDFKit:(RCTResponseSenderBlock)callback)
|
|
117
80
|
{
|
|
118
81
|
if([[[UIDevice currentDevice] systemVersion] compare:@"11.0" options:NSNumericSearch] == NSOrderedDescending
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amafil/react-native-pdf-toolkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.17",
|
|
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,13 +28,13 @@
|
|
|
28
28
|
"url": "https://github.com/amafil/react-native-pdf/issues"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@babel/runtime": "^7.20.1",
|
|
32
31
|
"crypto-js": "4.2.0",
|
|
33
|
-
"deprecated-react-native-prop-types": "^2.3.0"
|
|
34
|
-
"prop-types": "^15.7.2"
|
|
32
|
+
"deprecated-react-native-prop-types": "^2.3.0"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
|
-
"@babel/core": "^7.20.2"
|
|
35
|
+
"@babel/core": "^7.20.2",
|
|
36
|
+
"@babel/runtime": "^7.20.1",
|
|
37
|
+
"prop-types": "^15.7.2"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "*",
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"index.d.ts",
|
|
50
50
|
"index.js",
|
|
51
51
|
"index.js.flow",
|
|
52
|
-
"annotationDocumentUtils.js",
|
|
53
52
|
"PdfManager.js",
|
|
54
53
|
"PdfPageView.js",
|
|
55
54
|
"PdfView.js",
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const LEGACY_MARKUP_TYPES = new Set(['underline', 'strikeout']);
|
|
4
|
-
|
|
5
|
-
export function normalizeAnnotation(annotation) {
|
|
6
|
-
if (!annotation || typeof annotation !== 'object' || Array.isArray(annotation)) {
|
|
7
|
-
return annotation;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (!LEGACY_MARKUP_TYPES.has(annotation.type)) {
|
|
11
|
-
return annotation;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
...annotation,
|
|
16
|
-
type: 'highlight',
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function normalizeAnnotationPayload(payload) {
|
|
21
|
-
if (!payload || typeof payload !== 'object') {
|
|
22
|
-
return payload;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (Array.isArray(payload)) {
|
|
26
|
-
return payload.map(normalizeAnnotation);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (!Array.isArray(payload.annotations)) {
|
|
30
|
-
return payload;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
...payload,
|
|
35
|
-
annotations: payload.annotations.map(normalizeAnnotation),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function joinAnnotationMessagePayload(messageParts, startIndex = 1) {
|
|
40
|
-
if (!Array.isArray(messageParts) || messageParts.length <= startIndex) {
|
|
41
|
-
return '';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return messageParts.slice(startIndex).join('|');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function parseAnnotationMessagePayload(messageParts, startIndex = 1) {
|
|
48
|
-
const payload = joinAnnotationMessagePayload(messageParts, startIndex);
|
|
49
|
-
|
|
50
|
-
if (!payload) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
try {
|
|
55
|
-
return normalizeAnnotationPayload(JSON.parse(payload));
|
|
56
|
-
} catch (error) {
|
|
57
|
-
return payload;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function stringifyAnnotationDocument(document, onError) {
|
|
62
|
-
if (!document) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
return JSON.stringify(normalizeAnnotationPayload(document));
|
|
68
|
-
} catch (error) {
|
|
69
|
-
if (onError) {
|
|
70
|
-
onError(error);
|
|
71
|
-
}
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
}
|