@papyrus-sdk/engine-native 0.2.10 → 0.2.12-beta.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.
- package/README.md +38 -38
- package/android/build.gradle +1 -1
- package/android/consumer-rules.pro +1 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/cpp/CMakeLists.txt +1 -1
- package/android/src/main/cpp/papyrus_outline.cpp +1 -1
- package/android/src/main/cpp/papyrus_outline_loader.cpp +1 -1
- package/android/src/main/cpp/papyrus_outline_loader.h +1 -1
- package/android/src/main/cpp/papyrus_outline_loader_test.cpp +1 -1
- package/android/src/main/cpp/papyrus_text_search.cpp +408 -408
- package/android/src/main/java/android/support/v4/util/ArrayMap.java +18 -18
- package/android/src/main/java/com/papyrus/engine/PapyrusEngineStore.java +71 -71
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.java +557 -553
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.kt +561 -561
- package/android/src/main/java/com/papyrus/engine/PapyrusOutline.java +1 -1
- package/android/src/main/java/com/papyrus/engine/PapyrusOutlineItem.java +13 -13
- package/android/src/main/java/com/papyrus/engine/PapyrusPackage.java +24 -24
- package/android/src/main/java/com/papyrus/engine/PapyrusPageView.java +197 -86
- package/android/src/main/java/com/papyrus/engine/PapyrusPageViewManager.java +22 -16
- package/android/src/main/java/com/papyrus/engine/PapyrusPageViewModule.kt +15 -12
- package/android/src/main/java/com/papyrus/engine/PapyrusTextHit.java +15 -15
- package/android/src/main/java/com/papyrus/engine/PapyrusTextSearch.java +20 -20
- package/android/src/main/java/com/papyrus/engine/PapyrusTextSelect.java +20 -20
- package/android/src/main/java/com/papyrus/engine/PapyrusTextSelection.java +11 -11
- package/android/src/test/java/com/papyrus/engine/PapyrusOutlineTest.java +1 -1
- package/android/src/test/java/com/papyrus/engine/PapyrusPageViewTest.java +30 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +32 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -41
- package/dist/index.mjs.map +1 -1
- package/ios/PapyrusEngineStore.h +16 -16
- package/ios/PapyrusEngineStore.m +48 -48
- package/ios/PapyrusNativeEngine.m +447 -447
- package/ios/PapyrusNativeEngine.podspec +15 -15
- package/ios/PapyrusPageView.h +21 -19
- package/ios/PapyrusPageView.m +194 -63
- package/ios/PapyrusPageViewManager.m +20 -19
- package/package.json +62 -60
- package/react-native.config.js +10 -10
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
Pod::Spec.new do |s|
|
|
2
|
-
s.name = 'PapyrusNativeEngine'
|
|
3
|
-
s.version = '0.1.1'
|
|
4
|
-
s.summary = 'Papyrus Native Engine (PDFKit)'
|
|
5
|
-
s.homepage = 'https://example.com/papyrus'
|
|
6
|
-
s.license = { :type => 'MIT' }
|
|
7
|
-
s.author = { 'Papyrus' => 'dev@papyrus.local' }
|
|
8
|
-
s.platforms = { :ios => '13.0' }
|
|
9
|
-
s.source = { :git => 'https://example.com/papyrus.git', :tag => s.version.to_s }
|
|
10
|
-
s.source_files = '**/*.{h,m,mm,swift}'
|
|
11
|
-
s.requires_arc = true
|
|
12
|
-
s.swift_version = '5.0'
|
|
13
|
-
|
|
14
|
-
s.dependency 'React-Core'
|
|
15
|
-
end
|
|
1
|
+
Pod::Spec.new do |s|
|
|
2
|
+
s.name = 'PapyrusNativeEngine'
|
|
3
|
+
s.version = '0.1.1'
|
|
4
|
+
s.summary = 'Papyrus Native Engine (PDFKit)'
|
|
5
|
+
s.homepage = 'https://example.com/papyrus'
|
|
6
|
+
s.license = { :type => 'MIT' }
|
|
7
|
+
s.author = { 'Papyrus' => 'dev@papyrus.local' }
|
|
8
|
+
s.platforms = { :ios => '13.0' }
|
|
9
|
+
s.source = { :git => 'https://example.com/papyrus.git', :tag => s.version.to_s }
|
|
10
|
+
s.source_files = '**/*.{h,m,mm,swift}'
|
|
11
|
+
s.requires_arc = true
|
|
12
|
+
s.swift_version = '5.0'
|
|
13
|
+
|
|
14
|
+
s.dependency 'React-Core'
|
|
15
|
+
end
|
package/ios/PapyrusPageView.h
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
#import <PDFKit/PDFKit.h>
|
|
3
|
-
|
|
4
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
5
|
-
|
|
6
|
-
@interface PapyrusPageView : UIView
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
#import <PDFKit/PDFKit.h>
|
|
3
|
+
|
|
4
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
5
|
+
|
|
6
|
+
@interface PapyrusPageView : UIView
|
|
7
|
+
|
|
8
|
+
@property (nonatomic, copy) NSString *pageTheme;
|
|
9
|
+
|
|
10
|
+
- (void)renderWithDocument:(PDFDocument *_Nullable)document
|
|
11
|
+
pageIndex:(NSInteger)pageIndex
|
|
12
|
+
scale:(CGFloat)scale
|
|
13
|
+
zoom:(CGFloat)zoom
|
|
14
|
+
rotation:(NSInteger)rotation;
|
|
15
|
+
|
|
16
|
+
- (CGRect)convertRectToPage:(CGRect)rect page:(PDFPage *)page;
|
|
17
|
+
- (CGRect)convertRectFromPage:(CGRect)rect page:(PDFPage *)page;
|
|
18
|
+
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
NS_ASSUME_NONNULL_END
|
package/ios/PapyrusPageView.m
CHANGED
|
@@ -1,63 +1,194 @@
|
|
|
1
|
-
#import "PapyrusPageView.h"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@
|
|
6
|
-
|
|
7
|
-
@
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
[
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
#import "PapyrusPageView.h"
|
|
2
|
+
|
|
3
|
+
#import <CoreImage/CoreImage.h>
|
|
4
|
+
|
|
5
|
+
@interface PapyrusPageView ()
|
|
6
|
+
@property (nonatomic, strong) PDFView *pdfView;
|
|
7
|
+
@property (nonatomic, strong) UIImageView *imageView;
|
|
8
|
+
@property (nonatomic, strong) CIContext *ciContext;
|
|
9
|
+
@property (nonatomic, weak) PDFDocument *currentDocument;
|
|
10
|
+
@property (nonatomic, assign) NSInteger currentPageIndex;
|
|
11
|
+
@property (nonatomic, assign) NSInteger currentRotation;
|
|
12
|
+
@property (nonatomic, assign) CGFloat currentScale;
|
|
13
|
+
@property (nonatomic, assign) CGFloat currentZoom;
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
@implementation PapyrusPageView
|
|
17
|
+
|
|
18
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
19
|
+
self = [super initWithFrame:frame];
|
|
20
|
+
if (self) {
|
|
21
|
+
_pageTheme = @"normal";
|
|
22
|
+
_currentPageIndex = NSNotFound;
|
|
23
|
+
_currentRotation = 0;
|
|
24
|
+
_currentScale = 1.0;
|
|
25
|
+
_currentZoom = 1.0;
|
|
26
|
+
_ciContext = [CIContext contextWithOptions:nil];
|
|
27
|
+
|
|
28
|
+
_pdfView = [[PDFView alloc] initWithFrame:self.bounds];
|
|
29
|
+
_pdfView.displayBox = kPDFDisplayBoxCropBox;
|
|
30
|
+
_pdfView.autoScales = NO;
|
|
31
|
+
_pdfView.displayMode = kPDFDisplaySinglePage;
|
|
32
|
+
_pdfView.displayDirection = kPDFDisplayDirectionVertical;
|
|
33
|
+
_pdfView.displaysPageBreaks = NO;
|
|
34
|
+
_pdfView.userInteractionEnabled = NO;
|
|
35
|
+
_pdfView.hidden = YES;
|
|
36
|
+
[self addSubview:_pdfView];
|
|
37
|
+
|
|
38
|
+
_imageView = [[UIImageView alloc] initWithFrame:self.bounds];
|
|
39
|
+
_imageView.contentMode = UIViewContentModeScaleAspectFit;
|
|
40
|
+
_imageView.clipsToBounds = YES;
|
|
41
|
+
[self addSubview:_imageView];
|
|
42
|
+
}
|
|
43
|
+
return self;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (void)layoutSubviews {
|
|
47
|
+
[super layoutSubviews];
|
|
48
|
+
self.pdfView.frame = self.bounds;
|
|
49
|
+
self.imageView.frame = self.bounds;
|
|
50
|
+
[self rerenderCurrentPageIfNeeded];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
- (void)setPageTheme:(NSString *)pageTheme {
|
|
54
|
+
NSString *normalized = pageTheme.length > 0 ? pageTheme : @"normal";
|
|
55
|
+
if ([_pageTheme isEqualToString:normalized]) return;
|
|
56
|
+
_pageTheme = [normalized copy];
|
|
57
|
+
[self rerenderCurrentPageIfNeeded];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
- (void)renderWithDocument:(PDFDocument *_Nullable)document
|
|
61
|
+
pageIndex:(NSInteger)pageIndex
|
|
62
|
+
scale:(CGFloat)scale
|
|
63
|
+
zoom:(CGFloat)zoom
|
|
64
|
+
rotation:(NSInteger)rotation {
|
|
65
|
+
self.currentDocument = document;
|
|
66
|
+
self.currentPageIndex = pageIndex;
|
|
67
|
+
self.currentRotation = rotation;
|
|
68
|
+
self.currentScale = scale;
|
|
69
|
+
self.currentZoom = zoom;
|
|
70
|
+
|
|
71
|
+
if (!document) {
|
|
72
|
+
self.pdfView.document = nil;
|
|
73
|
+
self.imageView.image = nil;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (self.pdfView.document != document) {
|
|
78
|
+
self.pdfView.document = document;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
PDFPage *page = [document pageAtIndex:pageIndex];
|
|
82
|
+
if (!page) return;
|
|
83
|
+
|
|
84
|
+
page.rotation = (int)rotation;
|
|
85
|
+
[self.pdfView goToPage:page];
|
|
86
|
+
|
|
87
|
+
CGFloat clampedZoom = MAX(0.1, MIN(5.0, zoom));
|
|
88
|
+
CGFloat baseScale = self.pdfView.scaleFactorForSizeToFit;
|
|
89
|
+
CGFloat targetScale = baseScale * MAX(0.1, scale) * clampedZoom;
|
|
90
|
+
self.pdfView.scaleFactor = targetScale;
|
|
91
|
+
|
|
92
|
+
[self rerenderCurrentPageIfNeeded];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
- (CGRect)convertRectToPage:(CGRect)rect page:(PDFPage *)page {
|
|
96
|
+
return [self.pdfView convertRect:rect toPage:page];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
- (CGRect)convertRectFromPage:(CGRect)rect page:(PDFPage *)page {
|
|
100
|
+
return [self.pdfView convertRect:rect fromPage:page];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
- (void)rerenderCurrentPageIfNeeded {
|
|
104
|
+
if (!self.currentDocument) return;
|
|
105
|
+
if (self.currentPageIndex == NSNotFound) return;
|
|
106
|
+
if (CGRectGetWidth(self.bounds) <= 0 || CGRectGetHeight(self.bounds) <= 0) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
PDFPage *page = [self.currentDocument pageAtIndex:self.currentPageIndex];
|
|
111
|
+
if (!page) return;
|
|
112
|
+
|
|
113
|
+
UIImage *baseImage = [self renderImageForPage:page];
|
|
114
|
+
self.imageView.image = [self themedImageFromImage:baseImage];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
- (UIImage *)renderImageForPage:(PDFPage *)page {
|
|
118
|
+
CGSize targetSize = self.bounds.size;
|
|
119
|
+
UIGraphicsImageRendererFormat *format =
|
|
120
|
+
[UIGraphicsImageRendererFormat defaultFormat];
|
|
121
|
+
format.opaque = YES;
|
|
122
|
+
format.scale = UIScreen.mainScreen.scale;
|
|
123
|
+
|
|
124
|
+
UIGraphicsImageRenderer *renderer =
|
|
125
|
+
[[UIGraphicsImageRenderer alloc] initWithSize:targetSize format:format];
|
|
126
|
+
|
|
127
|
+
return [renderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull context) {
|
|
128
|
+
CGContextRef cgContext = context.CGContext;
|
|
129
|
+
CGContextSetFillColorWithColor(cgContext, UIColor.whiteColor.CGColor);
|
|
130
|
+
CGContextFillRect(cgContext, (CGRect){CGPointZero, targetSize});
|
|
131
|
+
|
|
132
|
+
CGRect pageBounds = [page boundsForBox:kPDFDisplayBoxCropBox];
|
|
133
|
+
if (CGRectGetWidth(pageBounds) <= 0 || CGRectGetHeight(pageBounds) <= 0) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
CGFloat scaleX = targetSize.width / CGRectGetWidth(pageBounds);
|
|
138
|
+
CGFloat scaleY = targetSize.height / CGRectGetHeight(pageBounds);
|
|
139
|
+
CGFloat fitScale = MIN(scaleX, scaleY);
|
|
140
|
+
CGFloat drawWidth = CGRectGetWidth(pageBounds) * fitScale;
|
|
141
|
+
CGFloat drawHeight = CGRectGetHeight(pageBounds) * fitScale;
|
|
142
|
+
CGFloat offsetX = (targetSize.width - drawWidth) / 2.0;
|
|
143
|
+
CGFloat offsetY = (targetSize.height - drawHeight) / 2.0;
|
|
144
|
+
|
|
145
|
+
CGContextSaveGState(cgContext);
|
|
146
|
+
CGContextTranslateCTM(cgContext, 0, targetSize.height);
|
|
147
|
+
CGContextScaleCTM(cgContext, 1, -1);
|
|
148
|
+
CGContextTranslateCTM(cgContext, offsetX, offsetY);
|
|
149
|
+
CGContextScaleCTM(cgContext, fitScale, fitScale);
|
|
150
|
+
[page drawWithBox:kPDFDisplayBoxCropBox toContext:cgContext];
|
|
151
|
+
CGContextRestoreGState(cgContext);
|
|
152
|
+
}];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
- (UIImage *)themedImageFromImage:(UIImage *)image {
|
|
156
|
+
if (!image) return nil;
|
|
157
|
+
if ([self.pageTheme isEqualToString:@"normal"]) return image;
|
|
158
|
+
|
|
159
|
+
CIImage *input = [[CIImage alloc] initWithImage:image];
|
|
160
|
+
if (!input) return image;
|
|
161
|
+
|
|
162
|
+
CIImage *output = input;
|
|
163
|
+
|
|
164
|
+
if ([self.pageTheme isEqualToString:@"sepia"]) {
|
|
165
|
+
CIFilter *sepia = [CIFilter filterWithName:@"CISepiaTone"];
|
|
166
|
+
[sepia setValue:output forKey:kCIInputImageKey];
|
|
167
|
+
[sepia setValue:@0.85 forKey:kCIInputIntensityKey];
|
|
168
|
+
output = sepia.outputImage ?: output;
|
|
169
|
+
} else if ([self.pageTheme isEqualToString:@"dark"] ||
|
|
170
|
+
[self.pageTheme isEqualToString:@"high-contrast"]) {
|
|
171
|
+
CIFilter *invert = [CIFilter filterWithName:@"CIColorInvert"];
|
|
172
|
+
[invert setValue:output forKey:kCIInputImageKey];
|
|
173
|
+
output = invert.outputImage ?: output;
|
|
174
|
+
|
|
175
|
+
CIFilter *controls = [CIFilter filterWithName:@"CIColorControls"];
|
|
176
|
+
[controls setValue:output forKey:kCIInputImageKey];
|
|
177
|
+
[controls setValue:@0 forKey:kCIInputSaturationKey];
|
|
178
|
+
[controls setValue:([self.pageTheme isEqualToString:@"high-contrast"] ? @1.25 : @0.9)
|
|
179
|
+
forKey:kCIInputContrastKey];
|
|
180
|
+
[controls setValue:([self.pageTheme isEqualToString:@"high-contrast"] ? @0.02 : @-0.08)
|
|
181
|
+
forKey:kCIInputBrightnessKey];
|
|
182
|
+
output = controls.outputImage ?: output;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
CGImageRef cgImage = [self.ciContext createCGImage:output fromRect:output.extent];
|
|
186
|
+
if (!cgImage) return image;
|
|
187
|
+
UIImage *result = [UIImage imageWithCGImage:cgImage
|
|
188
|
+
scale:image.scale
|
|
189
|
+
orientation:image.imageOrientation];
|
|
190
|
+
CGImageRelease(cgImage);
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@end
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
#import <React/RCTViewManager.h>
|
|
2
|
-
#import "PapyrusPageView.h"
|
|
3
|
-
|
|
4
|
-
@interface PapyrusPageViewManager : RCTViewManager
|
|
5
|
-
@end
|
|
6
|
-
|
|
7
|
-
@implementation PapyrusPageViewManager
|
|
8
|
-
|
|
9
|
-
RCT_EXPORT_MODULE(PapyrusPageView)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
#import <React/RCTViewManager.h>
|
|
2
|
+
#import "PapyrusPageView.h"
|
|
3
|
+
|
|
4
|
+
@interface PapyrusPageViewManager : RCTViewManager
|
|
5
|
+
@end
|
|
6
|
+
|
|
7
|
+
@implementation PapyrusPageViewManager
|
|
8
|
+
|
|
9
|
+
RCT_EXPORT_MODULE(PapyrusPageView)
|
|
10
|
+
RCT_EXPORT_VIEW_PROPERTY(pageTheme, NSString)
|
|
11
|
+
|
|
12
|
+
+ (BOOL)requiresMainQueueSetup {
|
|
13
|
+
return YES;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
- (UIView *)view {
|
|
17
|
+
return [[PapyrusPageView alloc] initWithFrame:CGRectZero];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@end
|
package/package.json
CHANGED
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@papyrus-sdk/engine-native",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"papyrus",
|
|
7
|
-
"react-native",
|
|
8
|
-
"pdf",
|
|
9
|
-
"pdfium",
|
|
10
|
-
"pdfkit",
|
|
11
|
-
"document",
|
|
12
|
-
"sdk",
|
|
13
|
-
"viewer"
|
|
14
|
-
],
|
|
15
|
-
"main": "dist/index.js",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"android/
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"ios/*.
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@papyrus-sdk/engine-native",
|
|
3
|
+
"version": "0.2.12-beta.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"papyrus",
|
|
7
|
+
"react-native",
|
|
8
|
+
"pdf",
|
|
9
|
+
"pdfium",
|
|
10
|
+
"pdfkit",
|
|
11
|
+
"document",
|
|
12
|
+
"sdk",
|
|
13
|
+
"viewer"
|
|
14
|
+
],
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"react-native": "dist/index.js",
|
|
17
|
+
"module": "dist/index.js",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"react-native": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"require": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"android/src",
|
|
30
|
+
"android/build.gradle",
|
|
31
|
+
"android/consumer-rules.pro",
|
|
32
|
+
"ios/*.h",
|
|
33
|
+
"ios/*.m",
|
|
34
|
+
"ios/*.podspec",
|
|
35
|
+
"react-native.config.js"
|
|
36
|
+
],
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/solrachix/Papyrus.git"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://solrachix.github.io/Papyrus/",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/solrachix/Papyrus/issues"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsup index.ts --dts --format cjs,esm --out-dir dist --clean --sourcemap",
|
|
50
|
+
"prepublishOnly": "pnpm build"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"@papyrus-sdk/core": ">=0.2.15-beta.0",
|
|
54
|
+
"@papyrus-sdk/types": ">=0.2.8-beta.0",
|
|
55
|
+
"react-native": ">=0.81.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@papyrus-sdk/core": "0.2.15-beta.0",
|
|
59
|
+
"@papyrus-sdk/types": "0.2.8-beta.0",
|
|
60
|
+
"react-native": "^0.81.0"
|
|
61
|
+
}
|
|
62
|
+
}
|
package/react-native.config.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
project: {
|
|
3
|
-
ios: {
|
|
4
|
-
podspecPath: 'ios/PapyrusNativeEngine.podspec',
|
|
5
|
-
},
|
|
6
|
-
android: {
|
|
7
|
-
sourceDir: 'android',
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
project: {
|
|
3
|
+
ios: {
|
|
4
|
+
podspecPath: 'ios/PapyrusNativeEngine.podspec',
|
|
5
|
+
},
|
|
6
|
+
android: {
|
|
7
|
+
sourceDir: 'android',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
};
|