@papyrus-sdk/engine-native 0.1.0 → 0.1.2
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/android/build.gradle +40 -40
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/java/com/papyrus/engine/PapyrusEngineStore.java +71 -71
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.java +529 -529
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.kt +540 -0
- package/android/src/main/java/com/papyrus/engine/PapyrusOutline.java +20 -20
- 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 +86 -86
- package/android/src/main/java/com/papyrus/engine/PapyrusPageViewManager.java +16 -16
- package/android/src/main/java/com/papyrus/engine/PapyrusPageViewModule.kt +12 -0
- 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/dist/index.d.mts +95 -7
- package/dist/index.d.ts +95 -7
- package/dist/index.js +683 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +684 -13
- package/dist/index.mjs.map +1 -1
- package/ios/PapyrusNativeEngine.m +447 -372
- package/ios/PapyrusNativeEngine.podspec +15 -15
- package/ios/PapyrusPageView.h +19 -16
- package/ios/PapyrusPageView.m +63 -54
- package/ios/PapyrusPageViewManager.m +19 -19
- package/package.json +11 -7
- package/react-native.config.js +10 -10
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.cmake/api/v1/reply/cache-v2-55a2e41fcdfef7f23046.json +0 -1323
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-ce719ceafe10fdc060d9.json +0 -184
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-ba59984c0779dea51592.json +0 -60
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json +0 -14
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.cmake/api/v1/reply/index-2025-12-22T13-33-34-0909.json +0 -92
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.cmake/api/v1/reply/target-papyrus_text-Debug-29cd4996bc13fe24a65c.json +0 -168
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.ninja_deps +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/.ninja_log +0 -20
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeCache.txt +0 -400
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake +0 -72
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake +0 -83
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake +0 -15
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c +0 -803
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -791
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/CMakeOutput.log +0 -264
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/TargetDirectories.txt +0 -3
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/cmake.check_cache +0 -1
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/papyrus_text.dir/papyrus_outline.cpp.o +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/papyrus_text.dir/papyrus_text_search.cpp.o +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/CMakeFiles/rules.ninja +0 -64
- package/android/.cxx/Debug/6t29645j/arm64-v8a/additional_project_files.txt +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/android_gradle_build.json +0 -38
- package/android/.cxx/Debug/6t29645j/arm64-v8a/android_gradle_build_mini.json +0 -27
- package/android/.cxx/Debug/6t29645j/arm64-v8a/build.ninja +0 -158
- package/android/.cxx/Debug/6t29645j/arm64-v8a/build_file_index.txt +0 -1
- package/android/.cxx/Debug/6t29645j/arm64-v8a/cmake_install.cmake +0 -54
- package/android/.cxx/Debug/6t29645j/arm64-v8a/compile_commands.json +0 -12
- package/android/.cxx/Debug/6t29645j/arm64-v8a/compile_commands.json.bin +0 -0
- package/android/.cxx/Debug/6t29645j/arm64-v8a/configure_fingerprint.bin +0 -28
- package/android/.cxx/Debug/6t29645j/arm64-v8a/metadata_generation_command.txt +0 -19
- package/android/.cxx/Debug/6t29645j/arm64-v8a/prefab_config.json +0 -4
- package/android/.cxx/Debug/6t29645j/arm64-v8a/symbol_folder_index.txt +0 -1
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.cmake/api/v1/reply/cache-v2-7f933b968e76d6ce336c.json +0 -1323
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.cmake/api/v1/reply/cmakeFiles-v1-439d2bc9e04bf2a43452.json +0 -184
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.cmake/api/v1/reply/codemodel-v2-efc4cfee3dc3a5ec05be.json +0 -60
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json +0 -14
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.cmake/api/v1/reply/index-2025-12-22T13-33-36-0881.json +0 -92
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.cmake/api/v1/reply/target-papyrus_text-Debug-e3f83458cbaf3644c279.json +0 -168
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.ninja_deps +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/.ninja_log +0 -20
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeCache.txt +0 -400
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake +0 -72
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake +0 -83
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake +0 -15
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c +0 -803
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -791
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/CMakeOutput.log +0 -268
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/TargetDirectories.txt +0 -3
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/cmake.check_cache +0 -1
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/papyrus_text.dir/papyrus_outline.cpp.o +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/papyrus_text.dir/papyrus_text_search.cpp.o +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/CMakeFiles/rules.ninja +0 -64
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/additional_project_files.txt +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/android_gradle_build.json +0 -38
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/android_gradle_build_mini.json +0 -27
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/build.ninja +0 -158
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/build_file_index.txt +0 -1
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/cmake_install.cmake +0 -54
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/compile_commands.json +0 -12
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/compile_commands.json.bin +0 -0
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/configure_fingerprint.bin +0 -28
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/metadata_generation_command.txt +0 -19
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/prefab_config.json +0 -4
- package/android/.cxx/Debug/6t29645j/armeabi-v7a/symbol_folder_index.txt +0 -1
- package/android/.cxx/Debug/6t29645j/hash_key.txt +0 -26
- package/android/.cxx/Debug/6t29645j/x86/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
- package/android/.cxx/Debug/6t29645j/x86/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
- package/android/.cxx/Debug/6t29645j/x86/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
- package/android/.cxx/Debug/6t29645j/x86/.cmake/api/v1/reply/cache-v2-921e99e188641cccb611.json +0 -1323
- package/android/.cxx/Debug/6t29645j/x86/.cmake/api/v1/reply/cmakeFiles-v1-842a746390c683135141.json +0 -184
- package/android/.cxx/Debug/6t29645j/x86/.cmake/api/v1/reply/codemodel-v2-5a1f9507fc5ae29259c9.json +0 -60
- package/android/.cxx/Debug/6t29645j/x86/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json +0 -14
- package/android/.cxx/Debug/6t29645j/x86/.cmake/api/v1/reply/index-2025-12-22T13-33-37-0961.json +0 -92
- package/android/.cxx/Debug/6t29645j/x86/.cmake/api/v1/reply/target-papyrus_text-Debug-3cc07532ad82ada3b95c.json +0 -168
- package/android/.cxx/Debug/6t29645j/x86/.ninja_deps +0 -0
- package/android/.cxx/Debug/6t29645j/x86/.ninja_log +0 -20
- package/android/.cxx/Debug/6t29645j/x86/CMakeCache.txt +0 -400
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake +0 -72
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake +0 -83
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin +0 -0
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake +0 -15
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c +0 -803
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o +0 -0
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -791
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/CMakeOutput.log +0 -258
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/TargetDirectories.txt +0 -3
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/cmake.check_cache +0 -1
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/papyrus_text.dir/papyrus_outline.cpp.o +0 -0
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/papyrus_text.dir/papyrus_text_search.cpp.o +0 -0
- package/android/.cxx/Debug/6t29645j/x86/CMakeFiles/rules.ninja +0 -64
- package/android/.cxx/Debug/6t29645j/x86/additional_project_files.txt +0 -0
- package/android/.cxx/Debug/6t29645j/x86/android_gradle_build.json +0 -38
- package/android/.cxx/Debug/6t29645j/x86/android_gradle_build_mini.json +0 -27
- package/android/.cxx/Debug/6t29645j/x86/build.ninja +0 -158
- package/android/.cxx/Debug/6t29645j/x86/build_file_index.txt +0 -1
- package/android/.cxx/Debug/6t29645j/x86/cmake_install.cmake +0 -54
- package/android/.cxx/Debug/6t29645j/x86/compile_commands.json +0 -12
- package/android/.cxx/Debug/6t29645j/x86/compile_commands.json.bin +0 -0
- package/android/.cxx/Debug/6t29645j/x86/configure_fingerprint.bin +0 -28
- package/android/.cxx/Debug/6t29645j/x86/metadata_generation_command.txt +0 -19
- package/android/.cxx/Debug/6t29645j/x86/prefab_config.json +0 -4
- package/android/.cxx/Debug/6t29645j/x86/symbol_folder_index.txt +0 -1
- package/android/.cxx/Debug/6t29645j/x86_64/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/.cmake/api/v1/reply/cache-v2-de693df49d051882903b.json +0 -1323
- package/android/.cxx/Debug/6t29645j/x86_64/.cmake/api/v1/reply/cmakeFiles-v1-8206847cf10ce80b1459.json +0 -184
- package/android/.cxx/Debug/6t29645j/x86_64/.cmake/api/v1/reply/codemodel-v2-ad9301b1a16c83f532c2.json +0 -60
- package/android/.cxx/Debug/6t29645j/x86_64/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json +0 -14
- package/android/.cxx/Debug/6t29645j/x86_64/.cmake/api/v1/reply/index-2025-12-22T13-33-39-0005.json +0 -92
- package/android/.cxx/Debug/6t29645j/x86_64/.cmake/api/v1/reply/target-papyrus_text-Debug-e1bb1d27c41dc820b379.json +0 -168
- package/android/.cxx/Debug/6t29645j/x86_64/.ninja_deps +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/.ninja_log +0 -20
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeCache.txt +0 -400
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake +0 -72
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake +0 -83
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake +0 -15
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c +0 -803
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -791
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/CMakeOutput.log +0 -258
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/TargetDirectories.txt +0 -3
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/cmake.check_cache +0 -1
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/papyrus_text.dir/papyrus_outline.cpp.o +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/papyrus_text.dir/papyrus_text_search.cpp.o +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/CMakeFiles/rules.ninja +0 -64
- package/android/.cxx/Debug/6t29645j/x86_64/additional_project_files.txt +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/android_gradle_build.json +0 -38
- package/android/.cxx/Debug/6t29645j/x86_64/android_gradle_build_mini.json +0 -27
- package/android/.cxx/Debug/6t29645j/x86_64/build.ninja +0 -158
- package/android/.cxx/Debug/6t29645j/x86_64/build_file_index.txt +0 -1
- package/android/.cxx/Debug/6t29645j/x86_64/cmake_install.cmake +0 -54
- package/android/.cxx/Debug/6t29645j/x86_64/compile_commands.json +0 -12
- package/android/.cxx/Debug/6t29645j/x86_64/compile_commands.json.bin +0 -0
- package/android/.cxx/Debug/6t29645j/x86_64/configure_fingerprint.bin +0 -28
- package/android/.cxx/Debug/6t29645j/x86_64/metadata_generation_command.txt +0 -19
- package/android/.cxx/Debug/6t29645j/x86_64/prefab_config.json +0 -4
- package/android/.cxx/Debug/6t29645j/x86_64/symbol_folder_index.txt +0 -1
- package/android/.cxx/tools/debug/arm64-v8a/compile_commands.json +0 -12
- package/android/.cxx/tools/debug/armeabi-v7a/compile_commands.json +0 -12
- package/android/.cxx/tools/debug/x86/compile_commands.json +0 -12
- package/android/.cxx/tools/debug/x86_64/compile_commands.json +0 -12
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/results.bin +0 -1
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/android/support/v4/util/ArrayMap.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/BuildConfig.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusEngineStore$EngineState.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusEngineStore.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusNativeEngineModule$1.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusNativeEngineModule.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusOutline.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusOutlineItem.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusPackage.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusPageView.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusPageViewManager.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusTextHit.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusTextSearch.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusTextSelect.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/papyrus/engine/PapyrusTextSelection.dex +0 -0
- package/android/build/.transforms/2a70e7e4bf5a7ddacb39b95e5520ae88/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/b336bac6032a9c6be0544a913e5a030c/results.bin +0 -1
- package/android/build/.transforms/b336bac6032a9c6be0544a913e5a030c/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/papyrus/engine/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/build_command_papyrus_text.bat +0 -5
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/build_model.json +0 -186
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/build_stderr_papyrus_text.txt +0 -0
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/build_stdout_papyrus_text.txt +0 -2
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/generate_cxx_metadata_157_timing.txt +0 -8
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/generate_cxx_metadata_167_timing.txt +0 -8
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/generate_cxx_metadata_168_timing.txt +0 -14
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/generate_cxx_metadata_172_timing.txt +0 -8
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/generate_cxx_metadata_2919_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/generate_cxx_metadata_3311_timing.txt +0 -3
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/generate_cxx_metadata_450_timing.txt +0 -3
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/arm64-v8a/metadata_generation_record.json +0 -41
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/build_command_papyrus_text.bat +0 -5
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/build_model.json +0 -186
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/build_stderr_papyrus_text.txt +0 -0
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/build_stdout_papyrus_text.txt +0 -2
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/generate_cxx_metadata_158_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/generate_cxx_metadata_160_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/generate_cxx_metadata_164_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/generate_cxx_metadata_168_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/generate_cxx_metadata_2922_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/generate_cxx_metadata_3311_timing.txt +0 -3
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/generate_cxx_metadata_450_timing.txt +0 -3
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/armeabi-v7a/metadata_generation_record.json +0 -41
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/build_command_papyrus_text.bat +0 -5
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/build_model.json +0 -186
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/build_stderr_papyrus_text.txt +0 -0
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/build_stdout_papyrus_text.txt +0 -2
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/generate_cxx_metadata_160_timing.txt +0 -5
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/generate_cxx_metadata_164_timing.txt +0 -3
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/generate_cxx_metadata_168_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/generate_cxx_metadata_170_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/generate_cxx_metadata_2907_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/generate_cxx_metadata_3311_timing.txt +0 -3
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/generate_cxx_metadata_450_timing.txt +0 -3
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86/metadata_generation_record.json +0 -41
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/build_command_papyrus_text.bat +0 -5
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/build_model.json +0 -186
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/build_stderr_papyrus_text.txt +0 -0
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/build_stdout_papyrus_text.txt +0 -2
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/generate_cxx_metadata_155_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/generate_cxx_metadata_160_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/generate_cxx_metadata_164_timing.txt +0 -3
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/generate_cxx_metadata_168_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/generate_cxx_metadata_2916_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/generate_cxx_metadata_3311_timing.txt +0 -5
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/generate_cxx_metadata_450_timing.txt +0 -6
- package/android/build/intermediates/cxx/Debug/6t29645j/logs/x86_64/metadata_generation_record.json +0 -41
- package/android/build/intermediates/cxx/Debug/6t29645j/obj/arm64-v8a/libpapyrus_text.so +0 -0
- package/android/build/intermediates/cxx/Debug/6t29645j/obj/armeabi-v7a/libpapyrus_text.so +0 -0
- package/android/build/intermediates/cxx/Debug/6t29645j/obj/x86/libpapyrus_text.so +0 -0
- package/android/build/intermediates/cxx/Debug/6t29645j/obj/x86_64/libpapyrus_text.so +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/android/support/v4/util/ArrayMap.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusEngineStore$EngineState.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusEngineStore.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusNativeEngineModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusNativeEngineModule.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusOutline.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusOutlineItem.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusPackage.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusPageView.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusPageViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusTextHit.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusTextSearch.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusTextSelect.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/papyrus/engine/PapyrusTextSelection.class +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libpapyrus_text.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libpapyrus_text.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libpapyrus_text.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libpapyrus_text.so +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libpapyrus_text.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libpapyrus_text.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libpapyrus_text.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libpapyrus_text.so +0 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/android/support/v4/util/ArrayMap.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusEngineStore$EngineState.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusEngineStore.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusNativeEngineModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusNativeEngineModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusOutline.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusOutlineItem.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusPageView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusPageViewManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusTextHit.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusTextSearch.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusTextSelect.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/papyrus/engine/PapyrusTextSelection.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PapyrusNativeEngineModule$1.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PapyrusNativeEngineModule.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/PapyrusPackage.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
package/dist/index.js
CHANGED
|
@@ -19,14 +19,276 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// index.ts
|
|
20
20
|
var index_exports = {};
|
|
21
21
|
__export(index_exports, {
|
|
22
|
+
MobileDocumentEngine: () => MobileDocumentEngine,
|
|
22
23
|
NativeDocumentEngine: () => NativeDocumentEngine,
|
|
23
|
-
PapyrusPageView: () => PapyrusPageView
|
|
24
|
+
PapyrusPageView: () => PapyrusPageView,
|
|
25
|
+
WebViewDocumentEngine: () => WebViewDocumentEngine
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
var import_react_native3 = require("react-native");
|
|
29
|
+
|
|
30
|
+
// ../../node_modules/expo-modules-core/src/ensureNativeModulesAreInstalled.ts
|
|
26
31
|
var import_react_native = require("react-native");
|
|
32
|
+
|
|
33
|
+
// ../../node_modules/expo-modules-core/src/web/index.ts
|
|
34
|
+
function registerWebGlobals() {
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// ../../node_modules/expo-modules-core/src/ensureNativeModulesAreInstalled.ts
|
|
38
|
+
function ensureNativeModulesAreInstalled() {
|
|
39
|
+
if (globalThis.expo) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
if (import_react_native.Platform.OS === "web") {
|
|
44
|
+
registerWebGlobals();
|
|
45
|
+
} else {
|
|
46
|
+
import_react_native.NativeModules.ExpoModulesCore?.installModules();
|
|
47
|
+
}
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error(`Unable to install Expo modules: ${error}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ../../node_modules/expo-modules-core/src/NativeModulesProxy.ts
|
|
54
|
+
var NativeModulesProxy_default = {};
|
|
55
|
+
|
|
56
|
+
// ../../node_modules/expo-modules-core/src/errors/CodedError.ts
|
|
57
|
+
var CodedError = class extends Error {
|
|
58
|
+
constructor(code, message) {
|
|
59
|
+
super(message);
|
|
60
|
+
this.code = code;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// ../../node_modules/expo-modules-core/src/Platform.ts
|
|
65
|
+
var import_react_native2 = require("react-native");
|
|
66
|
+
|
|
67
|
+
// ../../node_modules/expo-modules-core/src/environment/browser.ts
|
|
68
|
+
var isDOMAvailable = false;
|
|
69
|
+
var canUseEventListeners = false;
|
|
70
|
+
var canUseViewport = false;
|
|
71
|
+
var isAsyncDebugging = false;
|
|
72
|
+
if (__DEV__) {
|
|
73
|
+
isAsyncDebugging = !global.nativeExtensions && !global.nativeCallSyncHook && !global.RN$Bridgeless;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ../../node_modules/expo-modules-core/src/Platform.ts
|
|
77
|
+
if (__DEV__ && typeof process.env.EXPO_OS === "undefined") {
|
|
78
|
+
console.warn(
|
|
79
|
+
`The global process.env.EXPO_OS is not defined. This should be inlined by babel-preset-expo during transformation.`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
var nativeSelect = typeof window !== "undefined" ? import_react_native2.Platform.select : (
|
|
83
|
+
// process.env.EXPO_OS is injected by `babel-preset-expo` and available in both client and `react-server` environments.
|
|
84
|
+
// Opt to use the env var when possible, and fallback to the React Native Platform module when it's not (arbitrary bundlers and transformers).
|
|
85
|
+
function select(specifics) {
|
|
86
|
+
if (!process.env.EXPO_OS) return void 0;
|
|
87
|
+
if (specifics.hasOwnProperty(process.env.EXPO_OS)) {
|
|
88
|
+
return specifics[process.env.EXPO_OS];
|
|
89
|
+
} else if (process.env.EXPO_OS !== "web" && specifics.hasOwnProperty("native")) {
|
|
90
|
+
return specifics.native;
|
|
91
|
+
} else if (specifics.hasOwnProperty("default")) {
|
|
92
|
+
return specifics.default;
|
|
93
|
+
}
|
|
94
|
+
return void 0;
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
var Platform2 = {
|
|
98
|
+
/**
|
|
99
|
+
* Denotes the currently running platform.
|
|
100
|
+
* Can be one of ios, android, web.
|
|
101
|
+
*/
|
|
102
|
+
OS: process.env.EXPO_OS || import_react_native2.Platform.OS,
|
|
103
|
+
/**
|
|
104
|
+
* Returns the value with the matching platform.
|
|
105
|
+
* Object keys can be any of ios, android, native, web, default.
|
|
106
|
+
*
|
|
107
|
+
* @ios ios, native, default
|
|
108
|
+
* @android android, native, default
|
|
109
|
+
* @web web, default
|
|
110
|
+
*/
|
|
111
|
+
select: nativeSelect,
|
|
112
|
+
/**
|
|
113
|
+
* Denotes if the DOM API is available in the current environment.
|
|
114
|
+
* The DOM is not available in native React runtimes and Node.js.
|
|
115
|
+
*/
|
|
116
|
+
isDOMAvailable,
|
|
117
|
+
/**
|
|
118
|
+
* Denotes if the current environment can attach event listeners
|
|
119
|
+
* to the window. This will return false in native React
|
|
120
|
+
* runtimes and Node.js.
|
|
121
|
+
*/
|
|
122
|
+
canUseEventListeners,
|
|
123
|
+
/**
|
|
124
|
+
* Denotes if the current environment can inspect properties of the
|
|
125
|
+
* screen on which the current window is being rendered. This will
|
|
126
|
+
* return false in native React runtimes and Node.js.
|
|
127
|
+
*/
|
|
128
|
+
canUseViewport,
|
|
129
|
+
/**
|
|
130
|
+
* If the JavaScript is being executed in a remote JavaScript environment.
|
|
131
|
+
* When `true`, synchronous native invocations cannot be executed.
|
|
132
|
+
*/
|
|
133
|
+
isAsyncDebugging
|
|
134
|
+
};
|
|
135
|
+
var Platform_default = Platform2;
|
|
136
|
+
|
|
137
|
+
// ../../node_modules/expo-modules-core/src/errors/UnavailabilityError.ts
|
|
138
|
+
var UnavailabilityError = class extends CodedError {
|
|
139
|
+
constructor(moduleName, propertyName) {
|
|
140
|
+
super(
|
|
141
|
+
"ERR_UNAVAILABLE",
|
|
142
|
+
`The method or property ${moduleName}.${propertyName} is not available on ${Platform_default.OS}, are you sure you've linked all the native dependencies properly?`
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// ../../node_modules/expo-modules-core/src/NativeViewManagerAdapter.tsx
|
|
148
|
+
function requireNativeViewManager(viewName) {
|
|
149
|
+
throw new UnavailabilityError("expo-modules-core", "requireNativeViewManager");
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ../../node_modules/expo-modules-core/src/sweet/NativeErrorManager.ts
|
|
153
|
+
var NativeErrorManager_default = NativeModulesProxy_default.ExpoModulesCoreErrorManager;
|
|
154
|
+
|
|
155
|
+
// ../../node_modules/expo-modules-core/src/sweet/setUpErrorManager.fx.ts
|
|
156
|
+
if (__DEV__ && Platform_default.OS === "android" && NativeErrorManager_default) {
|
|
157
|
+
const onNewException = "ExpoModulesCoreErrorManager.onNewException";
|
|
158
|
+
const onNewWarning = "ExpoModulesCoreErrorManager.onNewWarning";
|
|
159
|
+
NativeErrorManager_default.addListener(onNewException, ({ message }) => {
|
|
160
|
+
console.error(message);
|
|
161
|
+
});
|
|
162
|
+
NativeErrorManager_default.addListener(onNewWarning, ({ message }) => {
|
|
163
|
+
console.warn(message);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
globalThis.ExpoModulesCore_CodedError = CodedError;
|
|
167
|
+
|
|
168
|
+
// ../../node_modules/expo-modules-core/src/requireNativeModule.ts
|
|
169
|
+
function requireOptionalNativeModule(moduleName) {
|
|
170
|
+
ensureNativeModulesAreInstalled();
|
|
171
|
+
return globalThis.expo?.modules?.[moduleName] ?? NativeModulesProxy_default[moduleName] ?? null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// index.ts
|
|
27
175
|
var import_core = require("@papyrus-sdk/core");
|
|
176
|
+
var import_types = require("@papyrus-sdk/types");
|
|
28
177
|
var MODULE_NAME = "PapyrusNativeEngine";
|
|
29
|
-
var
|
|
178
|
+
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
179
|
+
var BASE64_LOOKUP = (() => {
|
|
180
|
+
const table = new Uint8Array(256);
|
|
181
|
+
table.fill(255);
|
|
182
|
+
for (let i = 0; i < BASE64_CHARS.length; i += 1) {
|
|
183
|
+
table[BASE64_CHARS.charCodeAt(i)] = i;
|
|
184
|
+
}
|
|
185
|
+
return table;
|
|
186
|
+
})();
|
|
187
|
+
var parseDataUri = (value) => {
|
|
188
|
+
const match = /^data:([^;,]+)?(;base64)?,(.*)$/.exec(value);
|
|
189
|
+
if (!match) return null;
|
|
190
|
+
return {
|
|
191
|
+
mime: match[1] ?? "",
|
|
192
|
+
isBase64: Boolean(match[2]),
|
|
193
|
+
data: match[3] ?? ""
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
var looksLikeUri = (value) => value.startsWith("http://") || value.startsWith("https://") || value.startsWith("/") || value.startsWith("./") || value.startsWith("../") || value.startsWith("file://");
|
|
197
|
+
var isLikelyBase64 = (value) => {
|
|
198
|
+
if (looksLikeUri(value)) return false;
|
|
199
|
+
if (value.includes(".")) return false;
|
|
200
|
+
if (value.length < 16) return false;
|
|
201
|
+
return /^[A-Za-z0-9+/=]+$/.test(value);
|
|
202
|
+
};
|
|
203
|
+
var isHttpUri = (value) => value.startsWith("http://") || value.startsWith("https://");
|
|
204
|
+
var decodeBase64 = (value) => {
|
|
205
|
+
const clean = value.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
206
|
+
const padding = clean.endsWith("==") ? 2 : clean.endsWith("=") ? 1 : 0;
|
|
207
|
+
const outputLength = Math.max(0, clean.length * 3 / 4 - padding);
|
|
208
|
+
const output = new Uint8Array(outputLength);
|
|
209
|
+
let buffer = 0;
|
|
210
|
+
let bits = 0;
|
|
211
|
+
let index = 0;
|
|
212
|
+
for (let i = 0; i < clean.length; i += 1) {
|
|
213
|
+
const charCode = clean.charCodeAt(i);
|
|
214
|
+
if (charCode === 61) break;
|
|
215
|
+
const valueIndex = BASE64_LOOKUP[charCode];
|
|
216
|
+
if (valueIndex === 255) continue;
|
|
217
|
+
buffer = buffer << 6 | valueIndex;
|
|
218
|
+
bits += 6;
|
|
219
|
+
if (bits >= 8) {
|
|
220
|
+
bits -= 8;
|
|
221
|
+
output[index++] = buffer >> bits & 255;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return output;
|
|
225
|
+
};
|
|
226
|
+
var encodeBase64 = (bytes) => {
|
|
227
|
+
let output = "";
|
|
228
|
+
let buffer = 0;
|
|
229
|
+
let bits = 0;
|
|
230
|
+
for (let i = 0; i < bytes.length; i += 1) {
|
|
231
|
+
buffer = buffer << 8 | bytes[i];
|
|
232
|
+
bits += 8;
|
|
233
|
+
while (bits >= 6) {
|
|
234
|
+
bits -= 6;
|
|
235
|
+
output += BASE64_CHARS[buffer >> bits & 63];
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (bits > 0) {
|
|
239
|
+
output += BASE64_CHARS[buffer << 6 - bits & 63];
|
|
240
|
+
}
|
|
241
|
+
const remainder = bytes.length % 3;
|
|
242
|
+
if (remainder === 1) return `${output}==`;
|
|
243
|
+
if (remainder === 2) return `${output}=`;
|
|
244
|
+
return output;
|
|
245
|
+
};
|
|
246
|
+
var isLoadRequest = (input) => typeof input === "object" && input !== null && "source" in input && "type" in input;
|
|
247
|
+
var normalizeLoadInput = (input) => isLoadRequest(input) ? { source: input.source, type: input.type } : { source: input };
|
|
248
|
+
var inferDocumentType = (source) => {
|
|
249
|
+
if (typeof source === "string") {
|
|
250
|
+
const dataUri = parseDataUri(source);
|
|
251
|
+
if (dataUri?.mime) {
|
|
252
|
+
const mime = dataUri.mime.toLowerCase();
|
|
253
|
+
if (mime.includes("epub")) return "epub";
|
|
254
|
+
if (mime.includes("text")) return "text";
|
|
255
|
+
if (mime.includes("pdf")) return "pdf";
|
|
256
|
+
}
|
|
257
|
+
const clean = source.split("?")[0].split("#")[0];
|
|
258
|
+
const ext = clean.includes(".") ? clean.split(".").pop()?.toLowerCase() : void 0;
|
|
259
|
+
if (ext === "epub") return "epub";
|
|
260
|
+
if (ext === "txt") return "text";
|
|
261
|
+
if (ext === "pdf") return "pdf";
|
|
262
|
+
return "pdf";
|
|
263
|
+
}
|
|
264
|
+
if (typeof source === "object" && source !== null && "uri" in source) {
|
|
265
|
+
const uri = source.uri;
|
|
266
|
+
const clean = uri.split("?")[0].split("#")[0];
|
|
267
|
+
const ext = clean.includes(".") ? clean.split(".").pop()?.toLowerCase() : void 0;
|
|
268
|
+
if (ext === "epub") return "epub";
|
|
269
|
+
if (ext === "txt") return "text";
|
|
270
|
+
if (ext === "pdf") return "pdf";
|
|
271
|
+
}
|
|
272
|
+
return "pdf";
|
|
273
|
+
};
|
|
274
|
+
var normalizeNativeDestination = (dest) => {
|
|
275
|
+
if (!dest) return null;
|
|
276
|
+
if (typeof dest === "string") {
|
|
277
|
+
return { kind: "named", value: dest };
|
|
278
|
+
}
|
|
279
|
+
if (dest.kind === "pageIndex" || dest.kind === "pageNumber" || dest.kind === "named") {
|
|
280
|
+
return { kind: dest.kind, value: dest.value };
|
|
281
|
+
}
|
|
282
|
+
return null;
|
|
283
|
+
};
|
|
284
|
+
var resolvePapyrusPageView = () => {
|
|
285
|
+
try {
|
|
286
|
+
return requireNativeViewManager("PapyrusPageView");
|
|
287
|
+
} catch {
|
|
288
|
+
return import_react_native3.View;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
var PapyrusPageView = resolvePapyrusPageView();
|
|
30
292
|
var NativeDocumentEngine = class extends import_core.BaseDocumentEngine {
|
|
31
293
|
constructor() {
|
|
32
294
|
super();
|
|
@@ -36,10 +298,14 @@ var NativeDocumentEngine = class extends import_core.BaseDocumentEngine {
|
|
|
36
298
|
this.currentPage = 1;
|
|
37
299
|
this.zoom = 1;
|
|
38
300
|
this.rotation = 0;
|
|
39
|
-
this.nativeModule =
|
|
301
|
+
this.nativeModule = requireOptionalNativeModule(MODULE_NAME);
|
|
40
302
|
this.engineId = this.nativeModule?.createEngine ? this.nativeModule.createEngine() : "default";
|
|
41
303
|
}
|
|
42
|
-
async load(
|
|
304
|
+
async load(input) {
|
|
305
|
+
const { source, type } = normalizeLoadInput(input);
|
|
306
|
+
if (type && type !== "pdf") {
|
|
307
|
+
throw new Error(`[NativeDocumentEngine] Tipo de documento n\xE3o suportado: ${type}`);
|
|
308
|
+
}
|
|
43
309
|
const native = this.assertNativeModule();
|
|
44
310
|
const normalized = await this.normalizeSource(source);
|
|
45
311
|
const result = native.load ? await native.load(this.engineId, normalized) : void 0;
|
|
@@ -120,26 +386,50 @@ var NativeDocumentEngine = class extends import_core.BaseDocumentEngine {
|
|
|
120
386
|
return native.searchText(this.engineId, query);
|
|
121
387
|
}
|
|
122
388
|
async getPageIndex(dest) {
|
|
389
|
+
if (!dest) return null;
|
|
390
|
+
if (typeof dest !== "string") {
|
|
391
|
+
if (dest.kind === "pageIndex") return dest.value;
|
|
392
|
+
if (dest.kind === "pageNumber") return Math.max(0, dest.value - 1);
|
|
393
|
+
}
|
|
123
394
|
const native = this.assertNativeModule();
|
|
124
395
|
if (!native.getPageIndex) return null;
|
|
125
|
-
|
|
396
|
+
const normalized = normalizeNativeDestination(dest);
|
|
397
|
+
if (!normalized || normalized.kind !== "named") return null;
|
|
398
|
+
return native.getPageIndex(this.engineId, normalized);
|
|
126
399
|
}
|
|
127
400
|
destroy() {
|
|
128
401
|
this.nativeModule?.destroyEngine?.(this.engineId);
|
|
129
402
|
}
|
|
130
403
|
assertNativeModule() {
|
|
131
404
|
if (!this.nativeModule) {
|
|
132
|
-
throw new Error(
|
|
405
|
+
throw new Error(
|
|
406
|
+
`[Papyrus] Native module "${MODULE_NAME}" not found. Use a dev client or a native build (Expo Go is not supported).`
|
|
407
|
+
);
|
|
133
408
|
}
|
|
134
409
|
return this.nativeModule;
|
|
135
410
|
}
|
|
136
411
|
async normalizeSource(source) {
|
|
137
|
-
if (typeof source === "string")
|
|
412
|
+
if (typeof source === "string") {
|
|
413
|
+
const dataUri = parseDataUri(source);
|
|
414
|
+
if (dataUri?.isBase64) {
|
|
415
|
+
return { data: decodeBase64(dataUri.data) };
|
|
416
|
+
}
|
|
417
|
+
if (looksLikeUri(source)) return { uri: source };
|
|
418
|
+
if (isLikelyBase64(source)) return { data: decodeBase64(source) };
|
|
419
|
+
return { uri: source };
|
|
420
|
+
}
|
|
138
421
|
if (this.isUriSource(source)) return { uri: source.uri };
|
|
139
|
-
if (this.isDataSource(source))
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
422
|
+
if (this.isDataSource(source)) {
|
|
423
|
+
const data = source.data instanceof Uint8Array ? source.data : new Uint8Array(source.data);
|
|
424
|
+
return { data };
|
|
425
|
+
}
|
|
426
|
+
if (this.isFileLike(source)) {
|
|
427
|
+
const buffer = await source.arrayBuffer();
|
|
428
|
+
return { data: new Uint8Array(buffer) };
|
|
429
|
+
}
|
|
430
|
+
if (source instanceof ArrayBuffer) return { data: new Uint8Array(source) };
|
|
431
|
+
if (source instanceof Uint8Array) return { data: source };
|
|
432
|
+
return { data: new Uint8Array(source) };
|
|
143
433
|
}
|
|
144
434
|
isUriSource(source) {
|
|
145
435
|
return typeof source === "object" && source !== null && "uri" in source;
|
|
@@ -156,9 +446,390 @@ var NativeDocumentEngine = class extends import_core.BaseDocumentEngine {
|
|
|
156
446
|
return null;
|
|
157
447
|
}
|
|
158
448
|
};
|
|
449
|
+
var WebViewDocumentEngine = class extends import_core.BaseDocumentEngine {
|
|
450
|
+
constructor() {
|
|
451
|
+
super(...arguments);
|
|
452
|
+
this.bridge = null;
|
|
453
|
+
this.ready = false;
|
|
454
|
+
this.requestId = 0;
|
|
455
|
+
this.pending = /* @__PURE__ */ new Map();
|
|
456
|
+
this.bridgeResolvers = [];
|
|
457
|
+
this.readyResolvers = [];
|
|
458
|
+
this.pageCount = 0;
|
|
459
|
+
this.currentPage = 1;
|
|
460
|
+
this.zoom = 1;
|
|
461
|
+
this.rotation = 0;
|
|
462
|
+
this.outline = [];
|
|
463
|
+
}
|
|
464
|
+
getRenderTargetType() {
|
|
465
|
+
return "webview";
|
|
466
|
+
}
|
|
467
|
+
attachBridge(bridge) {
|
|
468
|
+
this.bridge = bridge;
|
|
469
|
+
this.bridgeResolvers.forEach((resolve) => resolve(bridge));
|
|
470
|
+
this.bridgeResolvers = [];
|
|
471
|
+
}
|
|
472
|
+
handleMessage(raw) {
|
|
473
|
+
let message = null;
|
|
474
|
+
try {
|
|
475
|
+
message = JSON.parse(raw);
|
|
476
|
+
} catch {
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
if (!message) return;
|
|
480
|
+
if (message.type === "ready") {
|
|
481
|
+
this.ready = true;
|
|
482
|
+
this.readyResolvers.forEach((resolve) => resolve());
|
|
483
|
+
this.readyResolvers = [];
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
if (message.type === "response") {
|
|
487
|
+
const pending = this.pending.get(message.id);
|
|
488
|
+
if (!pending) return;
|
|
489
|
+
this.pending.delete(message.id);
|
|
490
|
+
if (message.ok) {
|
|
491
|
+
pending.resolve(message.data);
|
|
492
|
+
} else {
|
|
493
|
+
pending.reject(new Error(message.error ?? "[Papyrus] WebView runtime error"));
|
|
494
|
+
}
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
if (message.type === "state") {
|
|
498
|
+
if (typeof message.payload.pageCount === "number") this.pageCount = message.payload.pageCount;
|
|
499
|
+
if (typeof message.payload.currentPage === "number") this.currentPage = message.payload.currentPage;
|
|
500
|
+
if (typeof message.payload.zoom === "number") this.zoom = message.payload.zoom;
|
|
501
|
+
if (Array.isArray(message.payload.outline)) this.outline = message.payload.outline;
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
if (message.type === "event") {
|
|
505
|
+
const payload = message.payload ?? {};
|
|
506
|
+
if (message.name === "RUNTIME_LOG") {
|
|
507
|
+
if (__DEV__) {
|
|
508
|
+
const text = typeof payload?.message === "string" ? payload.message : JSON.stringify(payload);
|
|
509
|
+
console.log("[Papyrus WebView runtime]", text);
|
|
510
|
+
}
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
if (message.name === "RUNTIME_ERROR") {
|
|
514
|
+
const errorMessage = typeof payload?.message === "string" ? payload.message : "";
|
|
515
|
+
if (errorMessage.includes("ResizeObserver loop")) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
if (__DEV__) {
|
|
519
|
+
console.warn("[Papyrus WebView runtime]", payload);
|
|
520
|
+
}
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
if (message.name === import_types.PapyrusEventType.TEXT_SELECTED) {
|
|
524
|
+
import_core.papyrusEvents.emit(import_types.PapyrusEventType.TEXT_SELECTED, payload);
|
|
525
|
+
} else if (message.name === import_types.PapyrusEventType.SEARCH_TRIGGERED) {
|
|
526
|
+
import_core.papyrusEvents.emit(import_types.PapyrusEventType.SEARCH_TRIGGERED, payload);
|
|
527
|
+
} else if (message.name === import_types.PapyrusEventType.DOCUMENT_LOADED) {
|
|
528
|
+
if (typeof payload.pageCount === "number") {
|
|
529
|
+
this.pageCount = payload.pageCount;
|
|
530
|
+
}
|
|
531
|
+
import_core.papyrusEvents.emit(import_types.PapyrusEventType.DOCUMENT_LOADED, payload);
|
|
532
|
+
}
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
if (__DEV__) {
|
|
536
|
+
console.warn("[Papyrus WebView] Unknown message", message);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
async load(input) {
|
|
540
|
+
const { source, type } = normalizeLoadInput(input);
|
|
541
|
+
const resolvedType = type ?? inferDocumentType(source);
|
|
542
|
+
if (resolvedType === "pdf") {
|
|
543
|
+
throw new Error("[WebViewDocumentEngine] Use o NativeDocumentEngine para PDFs no mobile.");
|
|
544
|
+
}
|
|
545
|
+
const payloadSource = await this.normalizeRuntimeSource(resolvedType, source);
|
|
546
|
+
const response = await this.request("load", {
|
|
547
|
+
type: resolvedType,
|
|
548
|
+
source: payloadSource
|
|
549
|
+
});
|
|
550
|
+
if (typeof response?.pageCount === "number") this.pageCount = response.pageCount;
|
|
551
|
+
if (Array.isArray(response?.outline)) this.outline = response.outline;
|
|
552
|
+
this.currentPage = 1;
|
|
553
|
+
}
|
|
554
|
+
getPageCount() {
|
|
555
|
+
return this.pageCount;
|
|
556
|
+
}
|
|
557
|
+
getCurrentPage() {
|
|
558
|
+
return this.currentPage;
|
|
559
|
+
}
|
|
560
|
+
goToPage(page) {
|
|
561
|
+
if (page < 1) return;
|
|
562
|
+
this.currentPage = page;
|
|
563
|
+
void this.request("go-to-page", { page });
|
|
564
|
+
}
|
|
565
|
+
setZoom(zoom) {
|
|
566
|
+
this.zoom = Math.max(0.5, Math.min(4, zoom));
|
|
567
|
+
void this.request("set-zoom", { zoom: this.zoom });
|
|
568
|
+
}
|
|
569
|
+
getZoom() {
|
|
570
|
+
return this.zoom;
|
|
571
|
+
}
|
|
572
|
+
rotate(direction) {
|
|
573
|
+
if (direction === "clockwise") {
|
|
574
|
+
this.rotation = (this.rotation + 90) % 360;
|
|
575
|
+
} else {
|
|
576
|
+
this.rotation = (this.rotation - 90) % 360;
|
|
577
|
+
if (this.rotation < 0) this.rotation += 360;
|
|
578
|
+
}
|
|
579
|
+
void this.request("set-rotation", { rotation: this.rotation });
|
|
580
|
+
}
|
|
581
|
+
getRotation() {
|
|
582
|
+
return this.rotation;
|
|
583
|
+
}
|
|
584
|
+
async renderPage(pageIndex, target, scale) {
|
|
585
|
+
void pageIndex;
|
|
586
|
+
void target;
|
|
587
|
+
void scale;
|
|
588
|
+
}
|
|
589
|
+
async renderTextLayer(pageIndex, container, scale) {
|
|
590
|
+
void pageIndex;
|
|
591
|
+
void container;
|
|
592
|
+
void scale;
|
|
593
|
+
}
|
|
594
|
+
async getTextContent(pageIndex) {
|
|
595
|
+
return await this.request("get-text-content", { pageIndex });
|
|
596
|
+
}
|
|
597
|
+
async getPageDimensions(pageIndex) {
|
|
598
|
+
return await this.request("get-page-dimensions", { pageIndex });
|
|
599
|
+
}
|
|
600
|
+
async searchText(query) {
|
|
601
|
+
return await this.request("search-text", { query });
|
|
602
|
+
}
|
|
603
|
+
async selectText(pageIndex, rect) {
|
|
604
|
+
return await this.request("select-text", { pageIndex, rect });
|
|
605
|
+
}
|
|
606
|
+
async getOutline() {
|
|
607
|
+
if (this.outline.length > 0) return this.outline;
|
|
608
|
+
return await this.request("get-outline");
|
|
609
|
+
}
|
|
610
|
+
async getPageIndex(dest) {
|
|
611
|
+
if (!dest) return null;
|
|
612
|
+
if (typeof dest !== "string") {
|
|
613
|
+
if (dest.kind === "pageIndex") return dest.value;
|
|
614
|
+
if (dest.kind === "pageNumber") return Math.max(0, dest.value - 1);
|
|
615
|
+
if (dest.kind === "href") {
|
|
616
|
+
return await this.request("get-page-index", { dest: dest.value });
|
|
617
|
+
}
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
return await this.request("get-page-index", { dest });
|
|
621
|
+
}
|
|
622
|
+
destroy() {
|
|
623
|
+
this.pending.forEach(({ reject }) => reject(new Error("[Papyrus] WebView engine destroyed")));
|
|
624
|
+
this.pending.clear();
|
|
625
|
+
this.bridge = null;
|
|
626
|
+
this.ready = false;
|
|
627
|
+
}
|
|
628
|
+
async ensureBridge() {
|
|
629
|
+
if (this.bridge) return this.bridge;
|
|
630
|
+
return new Promise((resolve) => {
|
|
631
|
+
this.bridgeResolvers.push(resolve);
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
async ensureReady() {
|
|
635
|
+
if (this.ready) return;
|
|
636
|
+
return new Promise((resolve) => {
|
|
637
|
+
this.readyResolvers.push(resolve);
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
async request(kind, payload) {
|
|
641
|
+
const bridge = await this.ensureBridge();
|
|
642
|
+
await this.ensureReady();
|
|
643
|
+
const id = `${Date.now()}-${this.requestId++}`;
|
|
644
|
+
return new Promise((resolve, reject) => {
|
|
645
|
+
const timeoutMs = kind === "load" ? 3e4 : 8e3;
|
|
646
|
+
const timeoutId = setTimeout(() => {
|
|
647
|
+
this.pending.delete(id);
|
|
648
|
+
reject(new Error(`[Papyrus] WebView response timeout: ${kind}`));
|
|
649
|
+
}, timeoutMs);
|
|
650
|
+
this.pending.set(id, {
|
|
651
|
+
resolve: (data) => {
|
|
652
|
+
clearTimeout(timeoutId);
|
|
653
|
+
resolve(data);
|
|
654
|
+
},
|
|
655
|
+
reject: (error) => {
|
|
656
|
+
clearTimeout(timeoutId);
|
|
657
|
+
reject(error);
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
bridge.postMessage(JSON.stringify({ id, kind, payload }));
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
async normalizeRuntimeSource(type, source) {
|
|
664
|
+
if (typeof source === "string") {
|
|
665
|
+
const dataUri = parseDataUri(source);
|
|
666
|
+
if (dataUri) {
|
|
667
|
+
if (dataUri.isBase64) {
|
|
668
|
+
return { kind: "base64", data: dataUri.data, mime: dataUri.mime || void 0 };
|
|
669
|
+
}
|
|
670
|
+
const text = decodeURIComponent(dataUri.data);
|
|
671
|
+
return { kind: "text", text };
|
|
672
|
+
}
|
|
673
|
+
if (looksLikeUri(source)) {
|
|
674
|
+
if (isHttpUri(source)) {
|
|
675
|
+
const fetched = await this.fetchRemoteSource(type, source);
|
|
676
|
+
if (fetched) return fetched;
|
|
677
|
+
}
|
|
678
|
+
return { kind: "uri", uri: source };
|
|
679
|
+
}
|
|
680
|
+
if (isLikelyBase64(source)) {
|
|
681
|
+
return { kind: "base64", data: source };
|
|
682
|
+
}
|
|
683
|
+
if (type === "text") {
|
|
684
|
+
return { kind: "text", text: source };
|
|
685
|
+
}
|
|
686
|
+
return { kind: "uri", uri: source };
|
|
687
|
+
}
|
|
688
|
+
if (this.isUriSource(source)) {
|
|
689
|
+
const uri = source.uri;
|
|
690
|
+
if (isHttpUri(uri)) {
|
|
691
|
+
const fetched = await this.fetchRemoteSource(type, uri);
|
|
692
|
+
if (fetched) return fetched;
|
|
693
|
+
}
|
|
694
|
+
return { kind: "uri", uri };
|
|
695
|
+
}
|
|
696
|
+
if (this.isDataSource(source)) {
|
|
697
|
+
const bytes = source.data instanceof Uint8Array ? source.data : new Uint8Array(source.data);
|
|
698
|
+
return { kind: "base64", data: encodeBase64(bytes) };
|
|
699
|
+
}
|
|
700
|
+
if (this.isFileLike(source)) {
|
|
701
|
+
const buffer = await source.arrayBuffer();
|
|
702
|
+
return { kind: "base64", data: encodeBase64(new Uint8Array(buffer)) };
|
|
703
|
+
}
|
|
704
|
+
if (source instanceof ArrayBuffer || source instanceof Uint8Array) {
|
|
705
|
+
const bytes = source instanceof Uint8Array ? source : new Uint8Array(source);
|
|
706
|
+
return { kind: "base64", data: encodeBase64(bytes) };
|
|
707
|
+
}
|
|
708
|
+
return { kind: "base64", data: encodeBase64(new Uint8Array(source)) };
|
|
709
|
+
}
|
|
710
|
+
async fetchRemoteSource(type, uri) {
|
|
711
|
+
try {
|
|
712
|
+
const response = await fetch(uri);
|
|
713
|
+
if (!response.ok) return null;
|
|
714
|
+
if (type === "text") {
|
|
715
|
+
const text = await response.text();
|
|
716
|
+
return { kind: "text", text };
|
|
717
|
+
}
|
|
718
|
+
if (type === "epub") {
|
|
719
|
+
const buffer = await this.readResponseBuffer(response);
|
|
720
|
+
return { kind: "base64", data: encodeBase64(new Uint8Array(buffer)) };
|
|
721
|
+
}
|
|
722
|
+
return null;
|
|
723
|
+
} catch {
|
|
724
|
+
return null;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
async readResponseBuffer(response) {
|
|
728
|
+
try {
|
|
729
|
+
return await response.arrayBuffer();
|
|
730
|
+
} catch {
|
|
731
|
+
const blob = await response.blob();
|
|
732
|
+
return await new Promise((resolve, reject) => {
|
|
733
|
+
const reader = new FileReader();
|
|
734
|
+
reader.onerror = () => reject(new Error("[Papyrus] Failed to read response blob"));
|
|
735
|
+
reader.onload = () => resolve(reader.result);
|
|
736
|
+
reader.readAsArrayBuffer(blob);
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
isUriSource(source) {
|
|
741
|
+
return typeof source === "object" && source !== null && "uri" in source;
|
|
742
|
+
}
|
|
743
|
+
isDataSource(source) {
|
|
744
|
+
return typeof source === "object" && source !== null && "data" in source;
|
|
745
|
+
}
|
|
746
|
+
isFileLike(source) {
|
|
747
|
+
return typeof source === "object" && source !== null && typeof source.arrayBuffer === "function";
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
var MobileDocumentEngine = class extends import_core.BaseDocumentEngine {
|
|
751
|
+
constructor() {
|
|
752
|
+
super();
|
|
753
|
+
this.pdfEngine = new NativeDocumentEngine();
|
|
754
|
+
this.webEngine = new WebViewDocumentEngine();
|
|
755
|
+
this.activeEngine = this.pdfEngine;
|
|
756
|
+
}
|
|
757
|
+
getRenderTargetType() {
|
|
758
|
+
return this.activeEngine.getRenderTargetType?.() ?? "canvas";
|
|
759
|
+
}
|
|
760
|
+
attachWebView(bridge) {
|
|
761
|
+
this.webEngine.attachBridge(bridge);
|
|
762
|
+
}
|
|
763
|
+
handleWebViewMessage(data) {
|
|
764
|
+
this.webEngine.handleMessage(data);
|
|
765
|
+
}
|
|
766
|
+
async load(input) {
|
|
767
|
+
const { source, type } = normalizeLoadInput(input);
|
|
768
|
+
const resolvedType = type ?? inferDocumentType(source);
|
|
769
|
+
this.activeEngine = resolvedType === "pdf" ? this.pdfEngine : this.webEngine;
|
|
770
|
+
await this.activeEngine.load({ type: resolvedType, source });
|
|
771
|
+
}
|
|
772
|
+
getPageCount() {
|
|
773
|
+
return this.activeEngine.getPageCount();
|
|
774
|
+
}
|
|
775
|
+
getCurrentPage() {
|
|
776
|
+
return this.activeEngine.getCurrentPage();
|
|
777
|
+
}
|
|
778
|
+
goToPage(page) {
|
|
779
|
+
this.activeEngine.goToPage(page);
|
|
780
|
+
}
|
|
781
|
+
setZoom(zoom) {
|
|
782
|
+
this.activeEngine.setZoom(zoom);
|
|
783
|
+
}
|
|
784
|
+
getZoom() {
|
|
785
|
+
return this.activeEngine.getZoom();
|
|
786
|
+
}
|
|
787
|
+
rotate(direction) {
|
|
788
|
+
this.activeEngine.rotate(direction);
|
|
789
|
+
}
|
|
790
|
+
getRotation() {
|
|
791
|
+
return this.activeEngine.getRotation();
|
|
792
|
+
}
|
|
793
|
+
async renderPage(pageIndex, target, scale) {
|
|
794
|
+
await this.activeEngine.renderPage(pageIndex, target, scale);
|
|
795
|
+
}
|
|
796
|
+
async renderTextLayer(pageIndex, container, scale) {
|
|
797
|
+
await this.activeEngine.renderTextLayer(pageIndex, container, scale);
|
|
798
|
+
}
|
|
799
|
+
async getTextContent(pageIndex) {
|
|
800
|
+
return await this.activeEngine.getTextContent(pageIndex);
|
|
801
|
+
}
|
|
802
|
+
async getPageDimensions(pageIndex) {
|
|
803
|
+
return await this.activeEngine.getPageDimensions(pageIndex);
|
|
804
|
+
}
|
|
805
|
+
async searchText(query) {
|
|
806
|
+
if (typeof this.activeEngine.searchText === "function") {
|
|
807
|
+
return await this.activeEngine.searchText(query);
|
|
808
|
+
}
|
|
809
|
+
return [];
|
|
810
|
+
}
|
|
811
|
+
async selectText(pageIndex, rect) {
|
|
812
|
+
if (typeof this.activeEngine.selectText === "function") {
|
|
813
|
+
return await this.activeEngine.selectText(pageIndex, rect);
|
|
814
|
+
}
|
|
815
|
+
return null;
|
|
816
|
+
}
|
|
817
|
+
async getOutline() {
|
|
818
|
+
return await this.activeEngine.getOutline();
|
|
819
|
+
}
|
|
820
|
+
async getPageIndex(dest) {
|
|
821
|
+
return await this.activeEngine.getPageIndex(dest);
|
|
822
|
+
}
|
|
823
|
+
destroy() {
|
|
824
|
+
this.pdfEngine.destroy();
|
|
825
|
+
this.webEngine.destroy();
|
|
826
|
+
}
|
|
827
|
+
};
|
|
159
828
|
// Annotate the CommonJS export names for ESM import in node:
|
|
160
829
|
0 && (module.exports = {
|
|
830
|
+
MobileDocumentEngine,
|
|
161
831
|
NativeDocumentEngine,
|
|
162
|
-
PapyrusPageView
|
|
832
|
+
PapyrusPageView,
|
|
833
|
+
WebViewDocumentEngine
|
|
163
834
|
});
|
|
164
835
|
//# sourceMappingURL=index.js.map
|