@papyrus-sdk/engine-native 0.2.22-beta.5 → 0.2.22-beta.6
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/{ios/PapyrusNativeEngine.podspec → PapyrusNativeEngine.podspec} +11 -7
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.java +1 -1
- package/ios/PapyrusNativeEngine.m +9 -6
- package/package.json +2 -2
- package/react-native.config.js +1 -1
- package/vendor/libarchive/README.papyrus.md +1 -1
- package/vendor/libarchive/config/PapyrusArchiveConfig.h +6 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
3
|
+
|
|
1
4
|
Pod::Spec.new do |s|
|
|
2
5
|
s.name = 'PapyrusNativeEngine'
|
|
3
|
-
s.version = '
|
|
6
|
+
s.version = package['version']
|
|
4
7
|
s.summary = 'Papyrus Native Engine (PDFKit)'
|
|
5
8
|
s.homepage = 'https://solrachix.github.io/Papyrus/'
|
|
6
9
|
s.license = { :type => 'MIT' }
|
|
@@ -23,17 +26,18 @@ Pod::Spec.new do |s|
|
|
|
23
26
|
archive_version_details.c archive_virtual.c
|
|
24
27
|
]
|
|
25
28
|
s.source_files = [
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
] + archive_sources.map { |file| "
|
|
29
|
+
'ios/**/*.{h,m,mm,swift}',
|
|
30
|
+
'vendor/libarchive/PapyrusComicArchive.{h,cpp}',
|
|
31
|
+
'vendor/libarchive/config/PapyrusArchiveConfig.h',
|
|
32
|
+
'vendor/libarchive/libarchive/*.h',
|
|
33
|
+
] + archive_sources.map { |file| "vendor/libarchive/libarchive/#{file}" }
|
|
31
34
|
s.frameworks = 'PDFKit', 'PencilKit'
|
|
32
35
|
s.libraries = 'z'
|
|
33
36
|
s.requires_arc = true
|
|
34
37
|
s.swift_version = '5.0'
|
|
35
38
|
s.pod_target_xcconfig = {
|
|
36
|
-
'
|
|
39
|
+
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
|
|
40
|
+
'HEADER_SEARCH_PATHS' => '$(inherited) "$(PODS_TARGET_SRCROOT)/vendor/libarchive" "$(PODS_TARGET_SRCROOT)/vendor/libarchive/libarchive" "$(PODS_TARGET_SRCROOT)/vendor/libarchive/config"',
|
|
37
41
|
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) PLATFORM_CONFIG_H=\\"PapyrusArchiveConfig.h\\"',
|
|
38
42
|
}
|
|
39
43
|
|
|
@@ -568,7 +568,7 @@ public class PapyrusNativeEngineModule extends ReactContextBaseJavaModule {
|
|
|
568
568
|
}
|
|
569
569
|
|
|
570
570
|
@ReactMethod
|
|
571
|
-
public void getPageIndex(String engineId,
|
|
571
|
+
public void getPageIndex(String engineId, ReadableMap dest, Promise promise) {
|
|
572
572
|
promise.resolve(null);
|
|
573
573
|
}
|
|
574
574
|
|
|
@@ -35,10 +35,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
35
35
|
|
|
36
36
|
NS_ASSUME_NONNULL_END
|
|
37
37
|
|
|
38
|
-
@implementation PapyrusNativeEngine
|
|
39
|
-
|
|
40
|
-
RCT_EXPORT_MODULE(PapyrusNativeEngine)
|
|
41
|
-
|
|
42
38
|
static NSMutableDictionary<NSString *, NSNumber *> *PapyrusPageViewTags;
|
|
43
39
|
|
|
44
40
|
static NSString *PapyrusViewKeyFor(NSString *engineId, NSInteger pageIndex) {
|
|
@@ -284,6 +280,10 @@ static NSArray<NSDictionary *> *PapyrusBuildOutlineItems(PDFOutline *outline, PD
|
|
|
284
280
|
return items;
|
|
285
281
|
}
|
|
286
282
|
|
|
283
|
+
@implementation PapyrusNativeEngine
|
|
284
|
+
|
|
285
|
+
RCT_EXPORT_MODULE(PapyrusNativeEngine)
|
|
286
|
+
|
|
287
287
|
+ (BOOL)requiresMainQueueSetup {
|
|
288
288
|
return YES;
|
|
289
289
|
}
|
|
@@ -411,9 +411,9 @@ RCT_EXPORT_METHOD(loadComic:(NSString *)engineId
|
|
|
411
411
|
BOOL opened = papyrus_comic_open(engineId.UTF8String, (int)generation, path.UTF8String, cache.UTF8String, &count, message, sizeof(message));
|
|
412
412
|
if (opened && ownsPath) PapyrusRememberComicSource(path, engineId, generation);
|
|
413
413
|
else if (!opened && ownsPath) [[NSFileManager defaultManager] removeItemAtPath:path error:nil];
|
|
414
|
+
NSString *reason = message[0] ? [NSString stringWithUTF8String:message] : @"Unable to open comic archive";
|
|
414
415
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
415
416
|
if (!opened) {
|
|
416
|
-
NSString *reason = message[0] ? [NSString stringWithUTF8String:message] : @"Unable to open comic archive";
|
|
417
417
|
reject(@"papyrus_comic_load_failed", reason, nil);
|
|
418
418
|
} else {
|
|
419
419
|
resolve(@{@"pageCount": @(count)});
|
|
@@ -876,7 +876,10 @@ RCT_EXPORT_METHOD(renderPage:(NSString *)engineId
|
|
|
876
876
|
target:(nonnull NSNumber *)target
|
|
877
877
|
scale:(CGFloat)scale
|
|
878
878
|
zoom:(CGFloat)zoom
|
|
879
|
-
rotation:(NSInteger)rotation
|
|
879
|
+
rotation:(NSInteger)rotation
|
|
880
|
+
requestId:(NSString *)requestId
|
|
881
|
+
telemetryContext:(NSDictionary *)telemetryContext) {
|
|
882
|
+
#pragma unused(requestId, telemetryContext)
|
|
880
883
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
881
884
|
PDFDocument *document = [[PapyrusEngineStore shared] documentForEngine:engineId];
|
|
882
885
|
UIView *view = [self.bridge.uiManager viewForReactTag:target];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papyrus-sdk/engine-native",
|
|
3
|
-
"version": "0.2.22-beta.
|
|
3
|
+
"version": "0.2.22-beta.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"papyrus",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"android/consumer-rules.pro",
|
|
33
33
|
"ios/*.h",
|
|
34
34
|
"ios/*.m",
|
|
35
|
-
"
|
|
35
|
+
"*.podspec",
|
|
36
36
|
"vendor/libarchive",
|
|
37
37
|
"third_party_licenses",
|
|
38
38
|
"react-native.config.js"
|
package/react-native.config.js
CHANGED
|
@@ -5,7 +5,7 @@ This source snapshot is libarchive **v3.8.9**, pinned to upstream commit
|
|
|
5
5
|
`https://github.com/libarchive/libarchive`.
|
|
6
6
|
|
|
7
7
|
Papyrus compiles only the read-side source subset listed in both
|
|
8
|
-
`android/src/main/cpp/CMakeLists.txt` and `
|
|
8
|
+
`android/src/main/cpp/CMakeLists.txt` and `PapyrusNativeEngine.podspec`.
|
|
9
9
|
The public C++ adapter in this directory filters comic archive entries,
|
|
10
10
|
orders them naturally, and extracts one selected image at a time to a bounded
|
|
11
11
|
cache. It does not write or modify archives.
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
#define PAPYRUS_ARCHIVE_CONFIG_H
|
|
3
3
|
#define __LIBARCHIVE_CONFIG_H_INCLUDED 1
|
|
4
4
|
|
|
5
|
+
/* Import permission macros directly rather than relying on transitive headers. */
|
|
6
|
+
#if defined(__APPLE__)
|
|
7
|
+
#include <sys/types.h>
|
|
8
|
+
#include <sys/stat.h>
|
|
9
|
+
#endif
|
|
10
|
+
|
|
5
11
|
/* Minimal POSIX configuration for the libarchive reader subset used by Papyrus. */
|
|
6
12
|
#define HAVE_INTTYPES_H 1
|
|
7
13
|
#define HAVE_STDINT_H 1
|