react-native-pdf-sdk 0.0.0-stage → 0.1.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/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/PdfSdk.podspec +32 -0
- package/README.md +265 -2
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +132 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/cpp/cpp-adapter.cpp +9 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfDocument.kt +72 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfSdk.kt +17 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfView.kt +194 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfDocumentLayout.kt +109 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfFailure.kt +36 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfPageSource.kt +141 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSdkPackage.kt +35 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSourceLoader.kt +117 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSurface.kt +839 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfTileStore.kt +210 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfViewport.kt +255 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/TileGrid.kt +276 -0
- package/ios/HybridPdfDocument.swift +71 -0
- package/ios/HybridPdfSdk.swift +10 -0
- package/ios/HybridPdfView.swift +202 -0
- package/ios/PdfDocumentLayout.swift +174 -0
- package/ios/PdfFailure.swift +46 -0
- package/ios/PdfImageCache.swift +83 -0
- package/ios/PdfPageSource.swift +221 -0
- package/ios/PdfScrollPlan.swift +108 -0
- package/ios/PdfSourceLoader.swift +120 -0
- package/ios/PdfSurface.swift +711 -0
- package/ios/PdfTileCanvas.swift +148 -0
- package/ios/PdfTileGrid.swift +518 -0
- package/ios/PdfTileStore.swift +346 -0
- package/ios/PdfViewport.swift +200 -0
- package/lib/commonjs/PdfView.js +149 -0
- package/lib/commonjs/PdfView.js.map +1 -0
- package/lib/commonjs/document.js +38 -0
- package/lib/commonjs/document.js.map +1 -0
- package/lib/commonjs/index.js +26 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/PdfSdk.nitro.js +6 -0
- package/lib/commonjs/specs/PdfSdk.nitro.js.map +1 -0
- package/lib/commonjs/specs/PdfView.nitro.js +6 -0
- package/lib/commonjs/specs/PdfView.nitro.js.map +1 -0
- package/lib/module/PdfView.js +143 -0
- package/lib/module/PdfView.js.map +1 -0
- package/lib/module/document.js +34 -0
- package/lib/module/document.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/PdfSdk.nitro.js +4 -0
- package/lib/module/specs/PdfSdk.nitro.js.map +1 -0
- package/lib/module/specs/PdfView.nitro.js +4 -0
- package/lib/module/specs/PdfView.nitro.js.map +1 -0
- package/lib/typescript/src/PdfView.d.ts +65 -0
- package/lib/typescript/src/PdfView.d.ts.map +1 -0
- package/lib/typescript/src/document.d.ts +22 -0
- package/lib/typescript/src/document.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/PdfSdk.nitro.d.ts +60 -0
- package/lib/typescript/src/specs/PdfSdk.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/PdfView.nitro.d.ts +131 -0
- package/lib/typescript/src/specs/PdfView.nitro.d.ts.map +1 -0
- package/nitro.json +40 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/PdfSdk+autolinking.cmake +87 -0
- package/nitrogen/generated/android/PdfSdk+autolinking.gradle +27 -0
- package/nitrogen/generated/android/PdfSdkOnLoad.cpp +84 -0
- package/nitrogen/generated/android/PdfSdkOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfErrorEvent.hpp +80 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfLoadEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfPageEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfTapEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfZoomEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JHybridNativePdfViewSpec.cpp +266 -0
- package/nitrogen/generated/android/c++/JHybridNativePdfViewSpec.hpp +92 -0
- package/nitrogen/generated/android/c++/JHybridPdfDocumentSpec.cpp +87 -0
- package/nitrogen/generated/android/c++/JHybridPdfDocumentSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridPdfSdkSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridPdfSdkSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JPdfErrorCode.hpp +67 -0
- package/nitrogen/generated/android/c++/JPdfErrorEvent.hpp +63 -0
- package/nitrogen/generated/android/c++/JPdfFit.hpp +64 -0
- package/nitrogen/generated/android/c++/JPdfLoadEvent.hpp +65 -0
- package/nitrogen/generated/android/c++/JPdfPageEvent.hpp +61 -0
- package/nitrogen/generated/android/c++/JPdfPageSize.hpp +61 -0
- package/nitrogen/generated/android/c++/JPdfRenderRequest.hpp +86 -0
- package/nitrogen/generated/android/c++/JPdfTapEvent.hpp +65 -0
- package/nitrogen/generated/android/c++/JPdfViewSource.hpp +84 -0
- package/nitrogen/generated/android/c++/JPdfZoomEvent.hpp +61 -0
- package/nitrogen/generated/android/c++/views/JHybridNativePdfViewStateUpdater.cpp +108 -0
- package/nitrogen/generated/android/c++/views/JHybridNativePdfViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfErrorEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfLoadEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfPageEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfTapEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfZoomEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridNativePdfViewSpec.kt +185 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridPdfDocumentSpec.kt +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridPdfSdkSpec.kt +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfErrorCode.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfErrorEvent.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfFit.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfLoadEvent.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfPageEvent.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfPageSize.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfRenderRequest.kt +86 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfSdkOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfTapEvent.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfViewSource.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfZoomEvent.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/views/HybridNativePdfViewManager.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/views/HybridNativePdfViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/PdfSdk+autolinking.rb +62 -0
- package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Bridge.cpp +123 -0
- package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Bridge.hpp +474 -0
- package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Umbrella.hpp +88 -0
- package/nitrogen/generated/ios/PdfSdkAutolinking.mm +41 -0
- package/nitrogen/generated/ios/PdfSdkAutolinking.swift +38 -0
- package/nitrogen/generated/ios/c++/HybridNativePdfViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativePdfViewSpecSwift.hpp +209 -0
- package/nitrogen/generated/ios/c++/HybridPdfDocumentSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridPdfDocumentSpecSwift.hpp +105 -0
- package/nitrogen/generated/ios/c++/HybridPdfSdkSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridPdfSdkSpecSwift.hpp +86 -0
- package/nitrogen/generated/ios/c++/views/HybridNativePdfViewComponent.mm +187 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfErrorEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfLoadEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfPageEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfTapEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfZoomEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridNativePdfViewSpec.swift +70 -0
- package/nitrogen/generated/ios/swift/HybridNativePdfViewSpec_cxx.swift +438 -0
- package/nitrogen/generated/ios/swift/HybridPdfDocumentSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridPdfDocumentSpec_cxx.swift +173 -0
- package/nitrogen/generated/ios/swift/HybridPdfSdkSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridPdfSdkSpec_cxx.swift +148 -0
- package/nitrogen/generated/ios/swift/PdfErrorCode.swift +52 -0
- package/nitrogen/generated/ios/swift/PdfErrorEvent.swift +34 -0
- package/nitrogen/generated/ios/swift/PdfFit.swift +48 -0
- package/nitrogen/generated/ios/swift/PdfLoadEvent.swift +39 -0
- package/nitrogen/generated/ios/swift/PdfPageEvent.swift +34 -0
- package/nitrogen/generated/ios/swift/PdfPageSize.swift +34 -0
- package/nitrogen/generated/ios/swift/PdfRenderRequest.swift +129 -0
- package/nitrogen/generated/ios/swift/PdfTapEvent.swift +39 -0
- package/nitrogen/generated/ios/swift/PdfViewSource.swift +97 -0
- package/nitrogen/generated/ios/swift/PdfZoomEvent.swift +34 -0
- package/nitrogen/generated/shared/c++/HybridNativePdfViewSpec.cpp +51 -0
- package/nitrogen/generated/shared/c++/HybridNativePdfViewSpec.hpp +112 -0
- package/nitrogen/generated/shared/c++/HybridPdfDocumentSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridPdfDocumentSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridPdfSdkSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridPdfSdkSpec.hpp +66 -0
- package/nitrogen/generated/shared/c++/PdfErrorCode.hpp +88 -0
- package/nitrogen/generated/shared/c++/PdfErrorEvent.hpp +89 -0
- package/nitrogen/generated/shared/c++/PdfFit.hpp +84 -0
- package/nitrogen/generated/shared/c++/PdfLoadEvent.hpp +91 -0
- package/nitrogen/generated/shared/c++/PdfPageEvent.hpp +87 -0
- package/nitrogen/generated/shared/c++/PdfPageSize.hpp +87 -0
- package/nitrogen/generated/shared/c++/PdfRenderRequest.hpp +112 -0
- package/nitrogen/generated/shared/c++/PdfTapEvent.hpp +91 -0
- package/nitrogen/generated/shared/c++/PdfViewSource.hpp +97 -0
- package/nitrogen/generated/shared/c++/PdfZoomEvent.hpp +87 -0
- package/nitrogen/generated/shared/c++/views/HybridNativePdfViewComponent.cpp +226 -0
- package/nitrogen/generated/shared/c++/views/HybridNativePdfViewComponent.hpp +130 -0
- package/nitrogen/generated/shared/json/NativePdfViewConfig.json +23 -0
- package/package.json +80 -4
- package/react-native.config.js +10 -0
- package/src/PdfView.tsx +221 -0
- package/src/document.ts +34 -0
- package/src/index.ts +16 -0
- package/src/specs/PdfSdk.nitro.ts +60 -0
- package/src/specs/PdfView.nitro.ts +149 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfZoomEvent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::pdfsdk {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (PdfZoomEvent).
|
|
39
|
+
*/
|
|
40
|
+
struct PdfZoomEvent final {
|
|
41
|
+
public:
|
|
42
|
+
double zoom SWIFT_PRIVATE;
|
|
43
|
+
double scale SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
PdfZoomEvent() = default;
|
|
47
|
+
explicit PdfZoomEvent(double zoom, double scale): zoom(zoom), scale(scale) {}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
friend bool operator==(const PdfZoomEvent& lhs, const PdfZoomEvent& rhs) = default;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
} // namespace margelo::nitro::pdfsdk
|
|
54
|
+
|
|
55
|
+
namespace margelo::nitro {
|
|
56
|
+
|
|
57
|
+
// C++ PdfZoomEvent <> JS PdfZoomEvent (object)
|
|
58
|
+
template <>
|
|
59
|
+
struct JSIConverter<margelo::nitro::pdfsdk::PdfZoomEvent> final {
|
|
60
|
+
static inline margelo::nitro::pdfsdk::PdfZoomEvent fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
61
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
62
|
+
return margelo::nitro::pdfsdk::PdfZoomEvent(
|
|
63
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "zoom"))),
|
|
64
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "scale")))
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::pdfsdk::PdfZoomEvent& arg) {
|
|
68
|
+
jsi::Object obj(runtime);
|
|
69
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "zoom"), JSIConverter<double>::toJSI(runtime, arg.zoom));
|
|
70
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "scale"), JSIConverter<double>::toJSI(runtime, arg.scale));
|
|
71
|
+
return obj;
|
|
72
|
+
}
|
|
73
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
74
|
+
if (!value.isObject()) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
jsi::Object obj = value.getObject(runtime);
|
|
78
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "zoom")))) return false;
|
|
82
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "scale")))) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNativePdfViewComponent.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridNativePdfViewComponent.hpp"
|
|
9
|
+
|
|
10
|
+
#include <string>
|
|
11
|
+
#include <exception>
|
|
12
|
+
#include <utility>
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
15
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
16
|
+
#include <react/renderer/core/RawValue.h>
|
|
17
|
+
#include <react/renderer/core/ShadowNode.h>
|
|
18
|
+
#include <react/renderer/core/ComponentDescriptor.h>
|
|
19
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::pdfsdk::views {
|
|
22
|
+
|
|
23
|
+
extern const char HybridNativePdfViewComponentName[] = "NativePdfView";
|
|
24
|
+
|
|
25
|
+
HybridNativePdfViewProps::HybridNativePdfViewProps(const react::PropsParserContext& context,
|
|
26
|
+
const HybridNativePdfViewProps& sourceProps,
|
|
27
|
+
const react::RawProps& rawProps):
|
|
28
|
+
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
29
|
+
source([&]() -> CachedProp<PdfViewSource> {
|
|
30
|
+
try {
|
|
31
|
+
const react::RawValue* rawValue = rawProps.at("source", nullptr, nullptr);
|
|
32
|
+
if (rawValue == nullptr) return sourceProps.source;
|
|
33
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
34
|
+
return CachedProp<PdfViewSource>::fromRawValue(*runtime, value, sourceProps.source);
|
|
35
|
+
} catch (const std::exception& exc) {
|
|
36
|
+
throw std::runtime_error(std::string("NativePdfView.source: ") + exc.what());
|
|
37
|
+
}
|
|
38
|
+
}()),
|
|
39
|
+
page([&]() -> CachedProp<double> {
|
|
40
|
+
try {
|
|
41
|
+
const react::RawValue* rawValue = rawProps.at("page", nullptr, nullptr);
|
|
42
|
+
if (rawValue == nullptr) return sourceProps.page;
|
|
43
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
44
|
+
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.page);
|
|
45
|
+
} catch (const std::exception& exc) {
|
|
46
|
+
throw std::runtime_error(std::string("NativePdfView.page: ") + exc.what());
|
|
47
|
+
}
|
|
48
|
+
}()),
|
|
49
|
+
fit([&]() -> CachedProp<PdfFit> {
|
|
50
|
+
try {
|
|
51
|
+
const react::RawValue* rawValue = rawProps.at("fit", nullptr, nullptr);
|
|
52
|
+
if (rawValue == nullptr) return sourceProps.fit;
|
|
53
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
54
|
+
return CachedProp<PdfFit>::fromRawValue(*runtime, value, sourceProps.fit);
|
|
55
|
+
} catch (const std::exception& exc) {
|
|
56
|
+
throw std::runtime_error(std::string("NativePdfView.fit: ") + exc.what());
|
|
57
|
+
}
|
|
58
|
+
}()),
|
|
59
|
+
minZoom([&]() -> CachedProp<double> {
|
|
60
|
+
try {
|
|
61
|
+
const react::RawValue* rawValue = rawProps.at("minZoom", nullptr, nullptr);
|
|
62
|
+
if (rawValue == nullptr) return sourceProps.minZoom;
|
|
63
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
64
|
+
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.minZoom);
|
|
65
|
+
} catch (const std::exception& exc) {
|
|
66
|
+
throw std::runtime_error(std::string("NativePdfView.minZoom: ") + exc.what());
|
|
67
|
+
}
|
|
68
|
+
}()),
|
|
69
|
+
maxZoom([&]() -> CachedProp<double> {
|
|
70
|
+
try {
|
|
71
|
+
const react::RawValue* rawValue = rawProps.at("maxZoom", nullptr, nullptr);
|
|
72
|
+
if (rawValue == nullptr) return sourceProps.maxZoom;
|
|
73
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
74
|
+
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.maxZoom);
|
|
75
|
+
} catch (const std::exception& exc) {
|
|
76
|
+
throw std::runtime_error(std::string("NativePdfView.maxZoom: ") + exc.what());
|
|
77
|
+
}
|
|
78
|
+
}()),
|
|
79
|
+
doubleTapZoom([&]() -> CachedProp<double> {
|
|
80
|
+
try {
|
|
81
|
+
const react::RawValue* rawValue = rawProps.at("doubleTapZoom", nullptr, nullptr);
|
|
82
|
+
if (rawValue == nullptr) return sourceProps.doubleTapZoom;
|
|
83
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
84
|
+
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.doubleTapZoom);
|
|
85
|
+
} catch (const std::exception& exc) {
|
|
86
|
+
throw std::runtime_error(std::string("NativePdfView.doubleTapZoom: ") + exc.what());
|
|
87
|
+
}
|
|
88
|
+
}()),
|
|
89
|
+
pageGap([&]() -> CachedProp<double> {
|
|
90
|
+
try {
|
|
91
|
+
const react::RawValue* rawValue = rawProps.at("pageGap", nullptr, nullptr);
|
|
92
|
+
if (rawValue == nullptr) return sourceProps.pageGap;
|
|
93
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
94
|
+
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.pageGap);
|
|
95
|
+
} catch (const std::exception& exc) {
|
|
96
|
+
throw std::runtime_error(std::string("NativePdfView.pageGap: ") + exc.what());
|
|
97
|
+
}
|
|
98
|
+
}()),
|
|
99
|
+
backdropColor([&]() -> CachedProp<double> {
|
|
100
|
+
try {
|
|
101
|
+
const react::RawValue* rawValue = rawProps.at("backdropColor", nullptr, nullptr);
|
|
102
|
+
if (rawValue == nullptr) return sourceProps.backdropColor;
|
|
103
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
104
|
+
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.backdropColor);
|
|
105
|
+
} catch (const std::exception& exc) {
|
|
106
|
+
throw std::runtime_error(std::string("NativePdfView.backdropColor: ") + exc.what());
|
|
107
|
+
}
|
|
108
|
+
}()),
|
|
109
|
+
scrollIndicators([&]() -> CachedProp<bool> {
|
|
110
|
+
try {
|
|
111
|
+
const react::RawValue* rawValue = rawProps.at("scrollIndicators", nullptr, nullptr);
|
|
112
|
+
if (rawValue == nullptr) return sourceProps.scrollIndicators;
|
|
113
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
114
|
+
return CachedProp<bool>::fromRawValue(*runtime, value, sourceProps.scrollIndicators);
|
|
115
|
+
} catch (const std::exception& exc) {
|
|
116
|
+
throw std::runtime_error(std::string("NativePdfView.scrollIndicators: ") + exc.what());
|
|
117
|
+
}
|
|
118
|
+
}()),
|
|
119
|
+
onLoad([&]() -> CachedProp<std::optional<std::function<void(const PdfLoadEvent& /* event */)>>> {
|
|
120
|
+
try {
|
|
121
|
+
const react::RawValue* rawValue = rawProps.at("onLoad", nullptr, nullptr);
|
|
122
|
+
if (rawValue == nullptr) return sourceProps.onLoad;
|
|
123
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
124
|
+
return CachedProp<std::optional<std::function<void(const PdfLoadEvent& /* event */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onLoad);
|
|
125
|
+
} catch (const std::exception& exc) {
|
|
126
|
+
throw std::runtime_error(std::string("NativePdfView.onLoad: ") + exc.what());
|
|
127
|
+
}
|
|
128
|
+
}()),
|
|
129
|
+
onPageChange([&]() -> CachedProp<std::optional<std::function<void(const PdfPageEvent& /* event */)>>> {
|
|
130
|
+
try {
|
|
131
|
+
const react::RawValue* rawValue = rawProps.at("onPageChange", nullptr, nullptr);
|
|
132
|
+
if (rawValue == nullptr) return sourceProps.onPageChange;
|
|
133
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
134
|
+
return CachedProp<std::optional<std::function<void(const PdfPageEvent& /* event */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onPageChange);
|
|
135
|
+
} catch (const std::exception& exc) {
|
|
136
|
+
throw std::runtime_error(std::string("NativePdfView.onPageChange: ") + exc.what());
|
|
137
|
+
}
|
|
138
|
+
}()),
|
|
139
|
+
onZoom([&]() -> CachedProp<std::optional<std::function<void(const PdfZoomEvent& /* event */)>>> {
|
|
140
|
+
try {
|
|
141
|
+
const react::RawValue* rawValue = rawProps.at("onZoom", nullptr, nullptr);
|
|
142
|
+
if (rawValue == nullptr) return sourceProps.onZoom;
|
|
143
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
144
|
+
return CachedProp<std::optional<std::function<void(const PdfZoomEvent& /* event */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onZoom);
|
|
145
|
+
} catch (const std::exception& exc) {
|
|
146
|
+
throw std::runtime_error(std::string("NativePdfView.onZoom: ") + exc.what());
|
|
147
|
+
}
|
|
148
|
+
}()),
|
|
149
|
+
onError([&]() -> CachedProp<std::optional<std::function<void(const PdfErrorEvent& /* event */)>>> {
|
|
150
|
+
try {
|
|
151
|
+
const react::RawValue* rawValue = rawProps.at("onError", nullptr, nullptr);
|
|
152
|
+
if (rawValue == nullptr) return sourceProps.onError;
|
|
153
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
154
|
+
return CachedProp<std::optional<std::function<void(const PdfErrorEvent& /* event */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onError);
|
|
155
|
+
} catch (const std::exception& exc) {
|
|
156
|
+
throw std::runtime_error(std::string("NativePdfView.onError: ") + exc.what());
|
|
157
|
+
}
|
|
158
|
+
}()),
|
|
159
|
+
onTap([&]() -> CachedProp<std::optional<std::function<void(const PdfTapEvent& /* event */)>>> {
|
|
160
|
+
try {
|
|
161
|
+
const react::RawValue* rawValue = rawProps.at("onTap", nullptr, nullptr);
|
|
162
|
+
if (rawValue == nullptr) return sourceProps.onTap;
|
|
163
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
164
|
+
return CachedProp<std::optional<std::function<void(const PdfTapEvent& /* event */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onTap);
|
|
165
|
+
} catch (const std::exception& exc) {
|
|
166
|
+
throw std::runtime_error(std::string("NativePdfView.onTap: ") + exc.what());
|
|
167
|
+
}
|
|
168
|
+
}()),
|
|
169
|
+
hybridRef([&]() -> CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridNativePdfViewSpec>& /* ref */)>>> {
|
|
170
|
+
try {
|
|
171
|
+
const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
|
|
172
|
+
if (rawValue == nullptr) return sourceProps.hybridRef;
|
|
173
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
174
|
+
return CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridNativePdfViewSpec>& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.hybridRef);
|
|
175
|
+
} catch (const std::exception& exc) {
|
|
176
|
+
throw std::runtime_error(std::string("NativePdfView.hybridRef: ") + exc.what());
|
|
177
|
+
}
|
|
178
|
+
}()) { }
|
|
179
|
+
|
|
180
|
+
bool HybridNativePdfViewProps::filterObjectKeys(const std::string& propName) {
|
|
181
|
+
switch (hashString(propName)) {
|
|
182
|
+
case hashString("source"): return true;
|
|
183
|
+
case hashString("page"): return true;
|
|
184
|
+
case hashString("fit"): return true;
|
|
185
|
+
case hashString("minZoom"): return true;
|
|
186
|
+
case hashString("maxZoom"): return true;
|
|
187
|
+
case hashString("doubleTapZoom"): return true;
|
|
188
|
+
case hashString("pageGap"): return true;
|
|
189
|
+
case hashString("backdropColor"): return true;
|
|
190
|
+
case hashString("scrollIndicators"): return true;
|
|
191
|
+
case hashString("onLoad"): return true;
|
|
192
|
+
case hashString("onPageChange"): return true;
|
|
193
|
+
case hashString("onZoom"): return true;
|
|
194
|
+
case hashString("onError"): return true;
|
|
195
|
+
case hashString("onTap"): return true;
|
|
196
|
+
case hashString("hybridRef"): return true;
|
|
197
|
+
default: return false;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
HybridNativePdfViewComponentDescriptor::HybridNativePdfViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters)
|
|
202
|
+
: ConcreteComponentDescriptor(parameters,
|
|
203
|
+
react::RawPropsParser(/* enableJsiParser */ true)) {}
|
|
204
|
+
|
|
205
|
+
std::shared_ptr<const react::Props> HybridNativePdfViewComponentDescriptor::cloneProps(const react::PropsParserContext& context,
|
|
206
|
+
const std::shared_ptr<const react::Props>& props,
|
|
207
|
+
react::RawProps rawProps) const {
|
|
208
|
+
// 1. Prepare raw props parser
|
|
209
|
+
rawProps.parse(rawPropsParser_);
|
|
210
|
+
// 2. Copy props with Nitro's cached copy constructor
|
|
211
|
+
return HybridNativePdfViewShadowNode::Props(context, /* & */ rawProps, props);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
#ifdef ANDROID
|
|
215
|
+
void HybridNativePdfViewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
|
|
216
|
+
// This is called immediately after `ShadowNode` is created, cloned or in progress.
|
|
217
|
+
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
218
|
+
auto& concreteShadowNode = static_cast<HybridNativePdfViewShadowNode&>(shadowNode);
|
|
219
|
+
const std::shared_ptr<const HybridNativePdfViewProps>& constProps = concreteShadowNode.getConcreteSharedProps();
|
|
220
|
+
const std::shared_ptr<HybridNativePdfViewProps>& props = std::const_pointer_cast<HybridNativePdfViewProps>(constProps);
|
|
221
|
+
HybridNativePdfViewState state{props};
|
|
222
|
+
concreteShadowNode.setStateData(std::move(state));
|
|
223
|
+
}
|
|
224
|
+
#endif
|
|
225
|
+
|
|
226
|
+
} // namespace margelo::nitro::pdfsdk::views
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNativePdfViewComponent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <optional>
|
|
11
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
12
|
+
#include <NitroModules/NitroHash.hpp>
|
|
13
|
+
#include <NitroModules/CachedProp.hpp>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
18
|
+
|
|
19
|
+
#include "PdfViewSource.hpp"
|
|
20
|
+
#include "PdfFit.hpp"
|
|
21
|
+
#include "PdfLoadEvent.hpp"
|
|
22
|
+
#include <functional>
|
|
23
|
+
#include <optional>
|
|
24
|
+
#include "PdfPageEvent.hpp"
|
|
25
|
+
#include "PdfZoomEvent.hpp"
|
|
26
|
+
#include "PdfErrorEvent.hpp"
|
|
27
|
+
#include "PdfTapEvent.hpp"
|
|
28
|
+
#include <memory>
|
|
29
|
+
#include "HybridNativePdfViewSpec.hpp"
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::pdfsdk::views {
|
|
32
|
+
|
|
33
|
+
using namespace facebook;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The name of the actual native View.
|
|
37
|
+
*/
|
|
38
|
+
extern const char HybridNativePdfViewComponentName[];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Props for the "NativePdfView" View.
|
|
42
|
+
*/
|
|
43
|
+
class HybridNativePdfViewProps final: public react::ViewProps {
|
|
44
|
+
public:
|
|
45
|
+
HybridNativePdfViewProps() = default;
|
|
46
|
+
HybridNativePdfViewProps(const react::PropsParserContext& context,
|
|
47
|
+
const HybridNativePdfViewProps& sourceProps,
|
|
48
|
+
const react::RawProps& rawProps);
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
CachedProp<PdfViewSource> source;
|
|
52
|
+
CachedProp<double> page;
|
|
53
|
+
CachedProp<PdfFit> fit;
|
|
54
|
+
CachedProp<double> minZoom;
|
|
55
|
+
CachedProp<double> maxZoom;
|
|
56
|
+
CachedProp<double> doubleTapZoom;
|
|
57
|
+
CachedProp<double> pageGap;
|
|
58
|
+
CachedProp<double> backdropColor;
|
|
59
|
+
CachedProp<bool> scrollIndicators;
|
|
60
|
+
CachedProp<std::optional<std::function<void(const PdfLoadEvent& /* event */)>>> onLoad;
|
|
61
|
+
CachedProp<std::optional<std::function<void(const PdfPageEvent& /* event */)>>> onPageChange;
|
|
62
|
+
CachedProp<std::optional<std::function<void(const PdfZoomEvent& /* event */)>>> onZoom;
|
|
63
|
+
CachedProp<std::optional<std::function<void(const PdfErrorEvent& /* event */)>>> onError;
|
|
64
|
+
CachedProp<std::optional<std::function<void(const PdfTapEvent& /* event */)>>> onTap;
|
|
65
|
+
CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridNativePdfViewSpec>& /* ref */)>>> hybridRef;
|
|
66
|
+
|
|
67
|
+
private:
|
|
68
|
+
static bool filterObjectKeys(const std::string& propName);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* State for the "NativePdfView" View.
|
|
73
|
+
*/
|
|
74
|
+
class HybridNativePdfViewState final {
|
|
75
|
+
public:
|
|
76
|
+
HybridNativePdfViewState() = default;
|
|
77
|
+
explicit HybridNativePdfViewState(const std::shared_ptr<HybridNativePdfViewProps>& props):
|
|
78
|
+
_props(props) {}
|
|
79
|
+
|
|
80
|
+
public:
|
|
81
|
+
[[nodiscard]]
|
|
82
|
+
const std::shared_ptr<HybridNativePdfViewProps>& getProps() const {
|
|
83
|
+
return _props;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public:
|
|
87
|
+
#ifdef ANDROID
|
|
88
|
+
HybridNativePdfViewState(const HybridNativePdfViewState& /* previousState */, folly::dynamic /* data */) {}
|
|
89
|
+
folly::dynamic getDynamic() const {
|
|
90
|
+
throw std::runtime_error("HybridNativePdfViewState does not support folly!");
|
|
91
|
+
}
|
|
92
|
+
react::MapBuffer getMapBuffer() const {
|
|
93
|
+
throw std::runtime_error("HybridNativePdfViewState does not support MapBuffer!");
|
|
94
|
+
};
|
|
95
|
+
#endif
|
|
96
|
+
|
|
97
|
+
private:
|
|
98
|
+
std::shared_ptr<HybridNativePdfViewProps> _props;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The Shadow Node for the "NativePdfView" View.
|
|
103
|
+
*/
|
|
104
|
+
using HybridNativePdfViewShadowNode = react::ConcreteViewShadowNode<HybridNativePdfViewComponentName /* "HybridNativePdfView" */,
|
|
105
|
+
HybridNativePdfViewProps /* custom props */,
|
|
106
|
+
react::ViewEventEmitter /* default */,
|
|
107
|
+
HybridNativePdfViewState /* custom state */>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The Component Descriptor for the "NativePdfView" View.
|
|
111
|
+
*/
|
|
112
|
+
class HybridNativePdfViewComponentDescriptor final: public react::ConcreteComponentDescriptor<HybridNativePdfViewShadowNode> {
|
|
113
|
+
public:
|
|
114
|
+
explicit HybridNativePdfViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
115
|
+
|
|
116
|
+
public:
|
|
117
|
+
/**
|
|
118
|
+
* A faster path for cloning props - reuses the caching logic from `HybridNativePdfViewProps`.
|
|
119
|
+
*/
|
|
120
|
+
std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
|
|
121
|
+
const std::shared_ptr<const react::Props>& props,
|
|
122
|
+
react::RawProps rawProps) const override;
|
|
123
|
+
#ifdef ANDROID
|
|
124
|
+
void adopt(react::ShadowNode& shadowNode) const override;
|
|
125
|
+
#endif
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/* The actual view for "NativePdfView" needs to be implemented in platform-specific code. */
|
|
129
|
+
|
|
130
|
+
} // namespace margelo::nitro::pdfsdk::views
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uiViewClassName": "NativePdfView",
|
|
3
|
+
"supportsRawText": false,
|
|
4
|
+
"bubblingEventTypes": {},
|
|
5
|
+
"directEventTypes": {},
|
|
6
|
+
"validAttributes": {
|
|
7
|
+
"source": true,
|
|
8
|
+
"page": true,
|
|
9
|
+
"fit": true,
|
|
10
|
+
"minZoom": true,
|
|
11
|
+
"maxZoom": true,
|
|
12
|
+
"doubleTapZoom": true,
|
|
13
|
+
"pageGap": true,
|
|
14
|
+
"backdropColor": true,
|
|
15
|
+
"scrollIndicators": true,
|
|
16
|
+
"onLoad": true,
|
|
17
|
+
"onPageChange": true,
|
|
18
|
+
"onZoom": true,
|
|
19
|
+
"onError": true,
|
|
20
|
+
"onTap": true,
|
|
21
|
+
"hybridRef": true
|
|
22
|
+
}
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,82 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-pdf-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A PDF SDK for React Native: a viewer that draws in tiles with the platform's own renderer, built for drawings metres wide.",
|
|
5
|
+
"main": "lib/commonjs/index",
|
|
6
|
+
"module": "lib/module/index",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"author": "Halil \u0130brahim Aky\u00fcz",
|
|
12
|
+
"homepage": "https://github.com/Halilibrahimakyz/react-native-pdf-sdk#readme",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/Halilibrahimakyz/react-native-pdf-sdk.git"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/Halilibrahimakyz/react-native-pdf-sdk/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"react-native",
|
|
22
|
+
"pdf",
|
|
23
|
+
"viewer",
|
|
24
|
+
"tiled",
|
|
25
|
+
"zoom",
|
|
26
|
+
"cad",
|
|
27
|
+
"drawings",
|
|
28
|
+
"nitro",
|
|
29
|
+
"ios",
|
|
30
|
+
"android"
|
|
31
|
+
],
|
|
32
|
+
"files": [
|
|
33
|
+
"src",
|
|
34
|
+
"lib",
|
|
35
|
+
"nitrogen",
|
|
36
|
+
"nitro.json",
|
|
37
|
+
"android/src/main",
|
|
38
|
+
"android/build.gradle",
|
|
39
|
+
"android/gradle.properties",
|
|
40
|
+
"android/CMakeLists.txt",
|
|
41
|
+
"ios/*.swift",
|
|
42
|
+
"PdfSdk.podspec",
|
|
43
|
+
"react-native.config.js",
|
|
44
|
+
"README.md",
|
|
45
|
+
"CHANGELOG.md",
|
|
46
|
+
"LICENSE"
|
|
47
|
+
],
|
|
48
|
+
"scripts": {
|
|
49
|
+
"specs": "npm run typecheck && nitrogen",
|
|
50
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
51
|
+
"pdfs": "cd example/pdfs && swift make.swift .",
|
|
52
|
+
"test:ios": "sh ios/tests/run.sh",
|
|
53
|
+
"test:android": "cd ../../android && ./gradlew :react-native-pdf-sdk:testDebugUnitTest",
|
|
54
|
+
"verify": "npm run typecheck && npm run test:ios && npm run test:android",
|
|
55
|
+
"build": "bob build",
|
|
56
|
+
"prepublishOnly": "npm run verify && npm run build"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"nitrogen": "0.35.5",
|
|
60
|
+
"react-native-builder-bob": "^0.40.0",
|
|
61
|
+
"typescript": "^5.6.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"react": "*",
|
|
65
|
+
"react-native": "*",
|
|
66
|
+
"react-native-nitro-modules": "*"
|
|
67
|
+
},
|
|
68
|
+
"react-native-builder-bob": {
|
|
69
|
+
"source": "src",
|
|
70
|
+
"output": "lib",
|
|
71
|
+
"targets": [
|
|
72
|
+
"commonjs",
|
|
73
|
+
"module",
|
|
74
|
+
[
|
|
75
|
+
"typescript",
|
|
76
|
+
{
|
|
77
|
+
"project": "tsconfig.build.json"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|