@papyrus-sdk/engine-native 0.2.22-beta.9.epub.1 → 0.2.22-beta.9.epub.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 +0 -1
- package/android/src/main/cpp/CMakeLists.txt +0 -137
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.java +35 -305
- package/android/src/main/java/com/papyrus/engine/PapyrusPackage.java +1 -3
- package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerView.java +5 -195
- package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerViewManager.java +1 -20
- package/dist/index.d.mts +4 -614
- package/dist/index.d.ts +4 -614
- package/dist/index.js +8 -484
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -477
- package/dist/index.mjs.map +1 -1
- package/ios/PapyrusEngineStore.h +0 -3
- package/ios/PapyrusEngineStore.m +6 -32
- package/ios/PapyrusNativeEngine.m +5 -684
- package/ios/PapyrusNativeEngine.podspec +15 -0
- package/ios/PapyrusPageView.m +11 -38
- package/package.json +8 -10
- package/react-native.config.js +1 -1
- package/PapyrusNativeEngine.podspec +0 -45
- package/android/src/main/cpp/PapyrusComicArchiveJni.cpp +0 -68
- package/android/src/main/cpp/PapyrusComicArchiveTest.cpp +0 -55
- package/android/src/main/cpp/papyrus_outline_loader_test.cpp +0 -240
- package/android/src/main/cpp/papyrus_text_word_test.cpp +0 -72
- package/android/src/main/java/com/papyrus/engine/PapyrusComicArchiveNative.java +0 -14
- package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentView.java +0 -491
- package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentViewManager.java +0 -32
- package/android/src/main/java/com/papyrus/engine/PapyrusComicPageLayout.java +0 -38
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeTextModel.java +0 -195
- package/android/src/main/java/com/papyrus/engine/PapyrusSelectionMenuIcon.java +0 -48
- package/android/src/main/java/com/papyrus/engine/PapyrusTextAnnotationModel.java +0 -22
- package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentView.java +0 -661
- package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentViewManager.java +0 -49
- package/android/src/main/java/com/papyrus/engine/PapyrusTextStore.java +0 -43
- package/ios/PapyrusComicDocumentView.h +0 -21
- package/ios/PapyrusComicDocumentView.m +0 -554
- package/ios/PapyrusComicDocumentViewManager.m +0 -23
- package/ios/PapyrusPageRotationRegistry.h +0 -29
- package/ios/PapyrusPageRotationRegistry.m +0 -179
- package/ios/PapyrusPdfDocumentView.h +0 -55
- package/ios/PapyrusPdfDocumentView.m +0 -2339
- package/ios/PapyrusPdfDocumentViewManager.m +0 -61
- package/ios/PapyrusPdfPageTheme.h +0 -15
- package/ios/PapyrusPdfPageTheme.m +0 -218
- package/ios/PapyrusSelectionMenu.h +0 -27
- package/ios/PapyrusTextAnnotationRange.h +0 -2
- package/ios/PapyrusTextAnnotationRange.m +0 -29
- package/ios/PapyrusTextDocumentView.h +0 -32
- package/ios/PapyrusTextDocumentView.m +0 -518
- package/ios/PapyrusTextDocumentViewManager.m +0 -34
- package/ios/PapyrusTextStore.h +0 -13
- package/ios/PapyrusTextStore.m +0 -73
- package/third_party_licenses/BLAKE2-NOTICE.txt +0 -11
- package/third_party_licenses/libarchive-COPYING +0 -65
- package/vendor/libarchive/PapyrusComicArchive.cpp +0 -376
- package/vendor/libarchive/PapyrusComicArchive.h +0 -30
- package/vendor/libarchive/README.papyrus.md +0 -15
- package/vendor/libarchive/android.h +0 -192
- package/vendor/libarchive/config/PapyrusArchiveConfig.h +0 -71
- package/vendor/libarchive/libarchive/CMakeLists.txt +0 -293
- package/vendor/libarchive/libarchive/android_lf.h +0 -36
- package/vendor/libarchive/libarchive/archive.h +0 -1266
- package/vendor/libarchive/libarchive/archive_acl.c +0 -2025
- package/vendor/libarchive/libarchive/archive_acl_private.h +0 -85
- package/vendor/libarchive/libarchive/archive_blake2.h +0 -197
- package/vendor/libarchive/libarchive/archive_blake2_impl.h +0 -161
- package/vendor/libarchive/libarchive/archive_blake2s_ref.c +0 -369
- package/vendor/libarchive/libarchive/archive_blake2sp_ref.c +0 -361
- package/vendor/libarchive/libarchive/archive_check_magic.c +0 -183
- package/vendor/libarchive/libarchive/archive_cmdline.c +0 -211
- package/vendor/libarchive/libarchive/archive_cmdline_private.h +0 -45
- package/vendor/libarchive/libarchive/archive_crc32.h +0 -123
- package/vendor/libarchive/libarchive/archive_cryptor.c +0 -534
- package/vendor/libarchive/libarchive/archive_cryptor_private.h +0 -199
- package/vendor/libarchive/libarchive/archive_digest.c +0 -1584
- package/vendor/libarchive/libarchive/archive_digest_private.h +0 -431
- package/vendor/libarchive/libarchive/archive_disk_acl_darwin.c +0 -558
- package/vendor/libarchive/libarchive/archive_disk_acl_freebsd.c +0 -712
- package/vendor/libarchive/libarchive/archive_disk_acl_linux.c +0 -760
- package/vendor/libarchive/libarchive/archive_disk_acl_sunos.c +0 -824
- package/vendor/libarchive/libarchive/archive_endian.h +0 -234
- package/vendor/libarchive/libarchive/archive_entry.3 +0 -147
- package/vendor/libarchive/libarchive/archive_entry.c +0 -2297
- package/vendor/libarchive/libarchive/archive_entry.h +0 -763
- package/vendor/libarchive/libarchive/archive_entry_acl.3 +0 -458
- package/vendor/libarchive/libarchive/archive_entry_copy_bhfi.c +0 -55
- package/vendor/libarchive/libarchive/archive_entry_copy_stat.c +0 -82
- package/vendor/libarchive/libarchive/archive_entry_link_resolver.c +0 -472
- package/vendor/libarchive/libarchive/archive_entry_linkify.3 +0 -224
- package/vendor/libarchive/libarchive/archive_entry_locale.h +0 -90
- package/vendor/libarchive/libarchive/archive_entry_misc.3 +0 -63
- package/vendor/libarchive/libarchive/archive_entry_paths.3 +0 -153
- package/vendor/libarchive/libarchive/archive_entry_perms.3 +0 -210
- package/vendor/libarchive/libarchive/archive_entry_private.h +0 -205
- package/vendor/libarchive/libarchive/archive_entry_sparse.c +0 -156
- package/vendor/libarchive/libarchive/archive_entry_stat.3 +0 -274
- package/vendor/libarchive/libarchive/archive_entry_stat.c +0 -121
- package/vendor/libarchive/libarchive/archive_entry_strmode.c +0 -69
- package/vendor/libarchive/libarchive/archive_entry_time.3 +0 -127
- package/vendor/libarchive/libarchive/archive_entry_xattr.c +0 -155
- package/vendor/libarchive/libarchive/archive_hmac.c +0 -345
- package/vendor/libarchive/libarchive/archive_hmac_private.h +0 -119
- package/vendor/libarchive/libarchive/archive_integer.h +0 -267
- package/vendor/libarchive/libarchive/archive_match.c +0 -1869
- package/vendor/libarchive/libarchive/archive_openssl_evp_private.h +0 -54
- package/vendor/libarchive/libarchive/archive_openssl_hmac_private.h +0 -54
- package/vendor/libarchive/libarchive/archive_options.c +0 -219
- package/vendor/libarchive/libarchive/archive_options_private.h +0 -49
- package/vendor/libarchive/libarchive/archive_pack_dev.c +0 -330
- package/vendor/libarchive/libarchive/archive_pack_dev.h +0 -49
- package/vendor/libarchive/libarchive/archive_parse_date.c +0 -1173
- package/vendor/libarchive/libarchive/archive_pathmatch.c +0 -480
- package/vendor/libarchive/libarchive/archive_pathmatch.h +0 -50
- package/vendor/libarchive/libarchive/archive_platform.h +0 -213
- package/vendor/libarchive/libarchive/archive_platform_acl.h +0 -53
- package/vendor/libarchive/libarchive/archive_platform_stat.h +0 -45
- package/vendor/libarchive/libarchive/archive_platform_xattr.h +0 -45
- package/vendor/libarchive/libarchive/archive_ppmd7.c +0 -1173
- package/vendor/libarchive/libarchive/archive_ppmd7_private.h +0 -119
- package/vendor/libarchive/libarchive/archive_ppmd8.c +0 -1293
- package/vendor/libarchive/libarchive/archive_ppmd8_private.h +0 -123
- package/vendor/libarchive/libarchive/archive_ppmd_private.h +0 -159
- package/vendor/libarchive/libarchive/archive_private.h +0 -209
- package/vendor/libarchive/libarchive/archive_random.c +0 -274
- package/vendor/libarchive/libarchive/archive_random_private.h +0 -36
- package/vendor/libarchive/libarchive/archive_rb.c +0 -709
- package/vendor/libarchive/libarchive/archive_rb.h +0 -113
- package/vendor/libarchive/libarchive/archive_read.3 +0 -250
- package/vendor/libarchive/libarchive/archive_read.c +0 -1814
- package/vendor/libarchive/libarchive/archive_read_add_passphrase.3 +0 -72
- package/vendor/libarchive/libarchive/archive_read_add_passphrase.c +0 -189
- package/vendor/libarchive/libarchive/archive_read_append_filter.c +0 -209
- package/vendor/libarchive/libarchive/archive_read_data.3 +0 -128
- package/vendor/libarchive/libarchive/archive_read_data_into_fd.c +0 -207
- package/vendor/libarchive/libarchive/archive_read_disk.3 +0 -422
- package/vendor/libarchive/libarchive/archive_read_disk_entry_from_file.c +0 -1086
- package/vendor/libarchive/libarchive/archive_read_disk_posix.c +0 -2639
- package/vendor/libarchive/libarchive/archive_read_disk_private.h +0 -97
- package/vendor/libarchive/libarchive/archive_read_disk_set_standard_lookup.c +0 -315
- package/vendor/libarchive/libarchive/archive_read_disk_windows.c +0 -2603
- package/vendor/libarchive/libarchive/archive_read_extract.3 +0 -135
- package/vendor/libarchive/libarchive/archive_read_extract.c +0 -59
- package/vendor/libarchive/libarchive/archive_read_extract2.c +0 -154
- package/vendor/libarchive/libarchive/archive_read_filter.3 +0 -163
- package/vendor/libarchive/libarchive/archive_read_format.3 +0 -190
- package/vendor/libarchive/libarchive/archive_read_free.3 +0 -91
- package/vendor/libarchive/libarchive/archive_read_header.3 +0 -89
- package/vendor/libarchive/libarchive/archive_read_new.3 +0 -57
- package/vendor/libarchive/libarchive/archive_read_open.3 +0 -247
- package/vendor/libarchive/libarchive/archive_read_open_fd.c +0 -236
- package/vendor/libarchive/libarchive/archive_read_open_file.c +0 -257
- package/vendor/libarchive/libarchive/archive_read_open_filename.c +0 -652
- package/vendor/libarchive/libarchive/archive_read_open_memory.c +0 -188
- package/vendor/libarchive/libarchive/archive_read_private.h +0 -274
- package/vendor/libarchive/libarchive/archive_read_set_format.c +0 -116
- package/vendor/libarchive/libarchive/archive_read_set_options.3 +0 -290
- package/vendor/libarchive/libarchive/archive_read_set_options.c +0 -132
- package/vendor/libarchive/libarchive/archive_read_support_filter_all.c +0 -84
- package/vendor/libarchive/libarchive/archive_read_support_filter_by_code.c +0 -68
- package/vendor/libarchive/libarchive/archive_read_support_filter_bzip2.c +0 -360
- package/vendor/libarchive/libarchive/archive_read_support_filter_compress.c +0 -457
- package/vendor/libarchive/libarchive/archive_read_support_filter_grzip.c +0 -108
- package/vendor/libarchive/libarchive/archive_read_support_filter_gzip.c +0 -538
- package/vendor/libarchive/libarchive/archive_read_support_filter_lrzip.c +0 -119
- package/vendor/libarchive/libarchive/archive_read_support_filter_lz4.c +0 -829
- package/vendor/libarchive/libarchive/archive_read_support_filter_lzop.c +0 -493
- package/vendor/libarchive/libarchive/archive_read_support_filter_none.c +0 -51
- package/vendor/libarchive/libarchive/archive_read_support_filter_program.c +0 -497
- package/vendor/libarchive/libarchive/archive_read_support_filter_rpm.c +0 -249
- package/vendor/libarchive/libarchive/archive_read_support_filter_uu.c +0 -739
- package/vendor/libarchive/libarchive/archive_read_support_filter_xz.c +0 -792
- package/vendor/libarchive/libarchive/archive_read_support_filter_zstd.c +0 -356
- package/vendor/libarchive/libarchive/archive_read_support_format_7zip.c +0 -4650
- package/vendor/libarchive/libarchive/archive_read_support_format_all.c +0 -88
- package/vendor/libarchive/libarchive/archive_read_support_format_ar.c +0 -597
- package/vendor/libarchive/libarchive/archive_read_support_format_by_code.c +0 -76
- package/vendor/libarchive/libarchive/archive_read_support_format_cab.c +0 -3410
- package/vendor/libarchive/libarchive/archive_read_support_format_cpio.c +0 -1152
- package/vendor/libarchive/libarchive/archive_read_support_format_empty.c +0 -95
- package/vendor/libarchive/libarchive/archive_read_support_format_iso9660.c +0 -3516
- package/vendor/libarchive/libarchive/archive_read_support_format_lha.c +0 -2931
- package/vendor/libarchive/libarchive/archive_read_support_format_mtree.c +0 -2113
- package/vendor/libarchive/libarchive/archive_read_support_format_rar.c +0 -3932
- package/vendor/libarchive/libarchive/archive_read_support_format_rar5.c +0 -4501
- package/vendor/libarchive/libarchive/archive_read_support_format_raw.c +0 -194
- package/vendor/libarchive/libarchive/archive_read_support_format_tar.c +0 -3785
- package/vendor/libarchive/libarchive/archive_read_support_format_warc.c +0 -875
- package/vendor/libarchive/libarchive/archive_read_support_format_xar.c +0 -3770
- package/vendor/libarchive/libarchive/archive_read_support_format_zip.c +0 -4710
- package/vendor/libarchive/libarchive/archive_string.c +0 -4391
- package/vendor/libarchive/libarchive/archive_string.h +0 -244
- package/vendor/libarchive/libarchive/archive_string_composition.h +0 -2289
- package/vendor/libarchive/libarchive/archive_string_sprintf.c +0 -200
- package/vendor/libarchive/libarchive/archive_time.c +0 -168
- package/vendor/libarchive/libarchive/archive_time_private.h +0 -47
- package/vendor/libarchive/libarchive/archive_util.3 +0 -239
- package/vendor/libarchive/libarchive/archive_util.c +0 -668
- package/vendor/libarchive/libarchive/archive_version_details.c +0 -516
- package/vendor/libarchive/libarchive/archive_virtual.c +0 -162
- package/vendor/libarchive/libarchive/archive_windows.c +0 -1035
- package/vendor/libarchive/libarchive/archive_windows.h +0 -332
- package/vendor/libarchive/libarchive/archive_write.3 +0 -266
- package/vendor/libarchive/libarchive/archive_write.c +0 -896
- package/vendor/libarchive/libarchive/archive_write_add_filter.c +0 -71
- package/vendor/libarchive/libarchive/archive_write_add_filter_b64encode.c +0 -329
- package/vendor/libarchive/libarchive/archive_write_add_filter_by_name.c +0 -76
- package/vendor/libarchive/libarchive/archive_write_add_filter_bzip2.c +0 -411
- package/vendor/libarchive/libarchive/archive_write_add_filter_compress.c +0 -459
- package/vendor/libarchive/libarchive/archive_write_add_filter_grzip.c +0 -143
- package/vendor/libarchive/libarchive/archive_write_add_filter_gzip.c +0 -493
- package/vendor/libarchive/libarchive/archive_write_add_filter_lrzip.c +0 -214
- package/vendor/libarchive/libarchive/archive_write_add_filter_lz4.c +0 -710
- package/vendor/libarchive/libarchive/archive_write_add_filter_lzop.c +0 -500
- package/vendor/libarchive/libarchive/archive_write_add_filter_none.c +0 -42
- package/vendor/libarchive/libarchive/archive_write_add_filter_program.c +0 -398
- package/vendor/libarchive/libarchive/archive_write_add_filter_uuencode.c +0 -320
- package/vendor/libarchive/libarchive/archive_write_add_filter_xz.c +0 -547
- package/vendor/libarchive/libarchive/archive_write_add_filter_zstd.c +0 -608
- package/vendor/libarchive/libarchive/archive_write_blocksize.3 +0 -112
- package/vendor/libarchive/libarchive/archive_write_data.3 +0 -88
- package/vendor/libarchive/libarchive/archive_write_disk.3 +0 -360
- package/vendor/libarchive/libarchive/archive_write_disk_posix.c +0 -4789
- package/vendor/libarchive/libarchive/archive_write_disk_private.h +0 -43
- package/vendor/libarchive/libarchive/archive_write_disk_set_standard_lookup.c +0 -265
- package/vendor/libarchive/libarchive/archive_write_disk_windows.c +0 -2952
- package/vendor/libarchive/libarchive/archive_write_filter.3 +0 -140
- package/vendor/libarchive/libarchive/archive_write_finish_entry.3 +0 -77
- package/vendor/libarchive/libarchive/archive_write_format.3 +0 -187
- package/vendor/libarchive/libarchive/archive_write_free.3 +0 -94
- package/vendor/libarchive/libarchive/archive_write_header.3 +0 -71
- package/vendor/libarchive/libarchive/archive_write_new.3 +0 -56
- package/vendor/libarchive/libarchive/archive_write_open.3 +0 -270
- package/vendor/libarchive/libarchive/archive_write_open_fd.c +0 -141
- package/vendor/libarchive/libarchive/archive_write_open_file.c +0 -102
- package/vendor/libarchive/libarchive/archive_write_open_filename.c +0 -272
- package/vendor/libarchive/libarchive/archive_write_open_memory.c +0 -110
- package/vendor/libarchive/libarchive/archive_write_private.h +0 -166
- package/vendor/libarchive/libarchive/archive_write_set_format.c +0 -124
- package/vendor/libarchive/libarchive/archive_write_set_format_7zip.c +0 -2571
- package/vendor/libarchive/libarchive/archive_write_set_format_ar.c +0 -540
- package/vendor/libarchive/libarchive/archive_write_set_format_by_name.c +0 -93
- package/vendor/libarchive/libarchive/archive_write_set_format_cpio.c +0 -11
- package/vendor/libarchive/libarchive/archive_write_set_format_cpio_binary.c +0 -618
- package/vendor/libarchive/libarchive/archive_write_set_format_cpio_newc.c +0 -457
- package/vendor/libarchive/libarchive/archive_write_set_format_cpio_odc.c +0 -508
- package/vendor/libarchive/libarchive/archive_write_set_format_filter_by_ext.c +0 -141
- package/vendor/libarchive/libarchive/archive_write_set_format_gnutar.c +0 -790
- package/vendor/libarchive/libarchive/archive_write_set_format_iso9660.c +0 -8216
- package/vendor/libarchive/libarchive/archive_write_set_format_mtree.c +0 -2307
- package/vendor/libarchive/libarchive/archive_write_set_format_pax.c +0 -2249
- package/vendor/libarchive/libarchive/archive_write_set_format_private.h +0 -40
- package/vendor/libarchive/libarchive/archive_write_set_format_raw.c +0 -123
- package/vendor/libarchive/libarchive/archive_write_set_format_shar.c +0 -650
- package/vendor/libarchive/libarchive/archive_write_set_format_ustar.c +0 -768
- package/vendor/libarchive/libarchive/archive_write_set_format_v7tar.c +0 -648
- package/vendor/libarchive/libarchive/archive_write_set_format_warc.c +0 -491
- package/vendor/libarchive/libarchive/archive_write_set_format_xar.c +0 -3799
- package/vendor/libarchive/libarchive/archive_write_set_format_zip.c +0 -2548
- package/vendor/libarchive/libarchive/archive_write_set_options.3 +0 -779
- package/vendor/libarchive/libarchive/archive_write_set_options.c +0 -129
- package/vendor/libarchive/libarchive/archive_write_set_passphrase.3 +0 -72
- package/vendor/libarchive/libarchive/archive_write_set_passphrase.c +0 -95
- package/vendor/libarchive/libarchive/archive_xxhash.h +0 -48
- package/vendor/libarchive/libarchive/config_freebsd.h +0 -275
- package/vendor/libarchive/libarchive/cpio.5 +0 -389
- package/vendor/libarchive/libarchive/filter_fork.h +0 -44
- package/vendor/libarchive/libarchive/filter_fork_posix.c +0 -269
- package/vendor/libarchive/libarchive/filter_fork_windows.c +0 -270
- package/vendor/libarchive/libarchive/libarchive-formats.5 +0 -478
- package/vendor/libarchive/libarchive/libarchive.3 +0 -297
- package/vendor/libarchive/libarchive/libarchive_changes.3 +0 -339
- package/vendor/libarchive/libarchive/libarchive_internals.3 +0 -363
- package/vendor/libarchive/libarchive/module.modulemap +0 -34
- package/vendor/libarchive/libarchive/mtree.5 +0 -323
- package/vendor/libarchive/libarchive/tar.5 +0 -947
- package/vendor/libarchive/libarchive/xxhash.c +0 -531
|
@@ -1,518 +0,0 @@
|
|
|
1
|
-
#import "PapyrusSelectionMenu.h"
|
|
2
|
-
#import "PapyrusTextDocumentView.h"
|
|
3
|
-
#import "PapyrusTextStore.h"
|
|
4
|
-
#import "PapyrusTextAnnotationRange.h"
|
|
5
|
-
|
|
6
|
-
static NSUInteger const PapyrusMaximumTextSearchHighlights = 2000;
|
|
7
|
-
|
|
8
|
-
@interface PapyrusTextDocumentView () <UITextViewDelegate, UIGestureRecognizerDelegate>
|
|
9
|
-
@property (nonatomic, strong) UITextView *textView;
|
|
10
|
-
@property (nonatomic, assign) NSInteger lastReportedStart;
|
|
11
|
-
@property (nonatomic, assign) NSInteger lastReportedEnd;
|
|
12
|
-
@property (nonatomic, assign) NSInteger lastReportedOffset;
|
|
13
|
-
@property (nonatomic, assign) CFAbsoluteTime lastOffsetEventTime;
|
|
14
|
-
@property (nonatomic, assign) BOOL hasLoadedDocument;
|
|
15
|
-
@property (nonatomic, assign) BOOL suppressOffsetEvents;
|
|
16
|
-
@property (nonatomic, strong) NSMutableDictionary<NSString *, UIButton *> *noteButtons;
|
|
17
|
-
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSValue *> *resolvedAnnotationRanges;
|
|
18
|
-
@property (nonatomic, copy) NSString *resolvedAnnotationText;
|
|
19
|
-
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSArray<NSString *> *> *noteGroups;
|
|
20
|
-
@end
|
|
21
|
-
|
|
22
|
-
@implementation PapyrusTextDocumentView
|
|
23
|
-
|
|
24
|
-
- (instancetype)initWithFrame:(CGRect)frame {
|
|
25
|
-
self = [super initWithFrame:frame];
|
|
26
|
-
if (self) {
|
|
27
|
-
self.backgroundColor = UIColor.whiteColor;
|
|
28
|
-
_searchResults = @[];
|
|
29
|
-
_annotations = @[];
|
|
30
|
-
_annotationLabels = @{};
|
|
31
|
-
_noteButtons = [NSMutableDictionary dictionary];
|
|
32
|
-
_activeSearchIndex = -1;
|
|
33
|
-
_pageTheme = @"normal";
|
|
34
|
-
_uiTheme = @"light";
|
|
35
|
-
_fontSize = 18;
|
|
36
|
-
_lineHeight = 28;
|
|
37
|
-
_pageMargin = 20;
|
|
38
|
-
_defineLabel = @"Define";
|
|
39
|
-
_defineSelectionMode = @"selection";
|
|
40
|
-
_lastReportedOffset = -1;
|
|
41
|
-
_textView = [[UITextView alloc] initWithFrame:self.bounds];
|
|
42
|
-
_textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
43
|
-
_textView.delegate = self;
|
|
44
|
-
UITapGestureRecognizer *annotationTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTextAnnotation:)];
|
|
45
|
-
annotationTap.cancelsTouchesInView = NO; annotationTap.delegate = self;
|
|
46
|
-
[_textView addGestureRecognizer:annotationTap];
|
|
47
|
-
_textView.editable = NO;
|
|
48
|
-
_textView.selectable = YES;
|
|
49
|
-
_textView.alwaysBounceVertical = YES;
|
|
50
|
-
_textView.scrollsToTop = YES;
|
|
51
|
-
_textView.textContainerInset = UIEdgeInsetsMake(_pageMargin, MAX(44,_pageMargin), _pageMargin, _pageMargin);
|
|
52
|
-
_textView.backgroundColor = UIColor.whiteColor;
|
|
53
|
-
_textView.textColor = UIColor.blackColor;
|
|
54
|
-
[self addSubview:_textView];
|
|
55
|
-
|
|
56
|
-
if (@available(iOS 16.0, *)) {
|
|
57
|
-
// UITextViewDelegate supplies the custom action to the native selection menu.
|
|
58
|
-
} else {
|
|
59
|
-
UIMenuController.sharedMenuController.menuItems = @[
|
|
60
|
-
[[UIMenuItem alloc] initWithTitle:_defineLabel action:@selector(defineCurrentSelection:)]
|
|
61
|
-
];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return self;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
- (void)didMoveToWindow {
|
|
68
|
-
[super didMoveToWindow];
|
|
69
|
-
[self reloadTextIfAvailable];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
- (void)layoutSubviews {
|
|
73
|
-
[super layoutSubviews];
|
|
74
|
-
[self reloadTextIfAvailable];
|
|
75
|
-
[self layoutNoteButtons];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
- (void)setEngineId:(NSString *)engineId {
|
|
79
|
-
if ([_engineId isEqualToString:engineId]) return;
|
|
80
|
-
_engineId = [engineId copy];
|
|
81
|
-
self.hasLoadedDocument = NO;
|
|
82
|
-
[self reloadTextIfAvailable];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
- (void)setDocumentGeneration:(NSInteger)documentGeneration {
|
|
86
|
-
if (_documentGeneration == documentGeneration) return;
|
|
87
|
-
_documentGeneration = documentGeneration;
|
|
88
|
-
self.hasLoadedDocument = NO;
|
|
89
|
-
[self reloadTextIfAvailable];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
- (void)setCurrentTextOffset:(NSInteger)currentTextOffset {
|
|
93
|
-
NSInteger nextOffset = MAX(0, currentTextOffset);
|
|
94
|
-
BOOL changed = _currentTextOffset != nextOffset;
|
|
95
|
-
_currentTextOffset = nextOffset;
|
|
96
|
-
if (changed) [self scrollToTextOffset:_currentTextOffset];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
- (void)setScrollToTextOffsetSignal:(NSNumber *)scrollToTextOffsetSignal {
|
|
100
|
-
if ((_scrollToTextOffsetSignal == scrollToTextOffsetSignal) ||
|
|
101
|
-
[_scrollToTextOffsetSignal isEqualToNumber:scrollToTextOffsetSignal]) return;
|
|
102
|
-
_scrollToTextOffsetSignal = [scrollToTextOffsetSignal copy];
|
|
103
|
-
[self scrollToTextOffset:scrollToTextOffsetSignal.integerValue];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
- (void)setTextNavigationRequest:(NSDictionary *)request {
|
|
107
|
-
if (![request isKindOfClass:NSDictionary.class] || [_textNavigationRequest isEqual:request]) return;
|
|
108
|
-
_textNavigationRequest = [request copy];
|
|
109
|
-
[self scrollToTextOffset:MAX(0,[request[@"offset"] integerValue])];
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
- (void)setSearchResults:(NSArray<NSDictionary *> *)searchResults {
|
|
113
|
-
_searchResults = [searchResults copy] ?: @[];
|
|
114
|
-
[self applySearchHighlights];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
- (void)setActiveSearchIndex:(NSInteger)activeSearchIndex {
|
|
118
|
-
_activeSearchIndex = activeSearchIndex;
|
|
119
|
-
[self applySearchHighlights];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
- (void)setPageTheme:(NSString *)pageTheme {
|
|
123
|
-
_pageTheme = [pageTheme copy] ?: @"normal";
|
|
124
|
-
[self applyThemeAndTypography];
|
|
125
|
-
[self applySearchHighlights];
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
- (void)setUiTheme:(NSString *)uiTheme {
|
|
129
|
-
_uiTheme = [uiTheme copy] ?: @"light";
|
|
130
|
-
[self applyThemeAndTypography];
|
|
131
|
-
[self applySearchHighlights];
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
- (void)setFontSize:(CGFloat)fontSize {
|
|
135
|
-
_fontSize = MAX(10, MIN(48, fontSize));
|
|
136
|
-
[self applyThemeAndTypography];
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
- (void)setLineHeight:(CGFloat)lineHeight {
|
|
140
|
-
_lineHeight = MAX(_fontSize, MIN(72, lineHeight));
|
|
141
|
-
[self applyThemeAndTypography];
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
- (void)setPageMargin:(CGFloat)pageMargin {
|
|
145
|
-
_pageMargin = MAX(8, MIN(64, pageMargin));
|
|
146
|
-
self.textView.textContainerInset = UIEdgeInsetsMake(_pageMargin, MAX(44,_pageMargin), _pageMargin, _pageMargin);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
- (void)setDefineLabel:(NSString *)defineLabel {
|
|
150
|
-
_defineLabel = [defineLabel copy] ?: @"Define";
|
|
151
|
-
[self setAnnotationLabels:self.annotationLabels];
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
- (void)setDefineSelectionMode:(NSString *)defineSelectionMode {
|
|
155
|
-
_defineSelectionMode = [defineSelectionMode copy] ?: @"selection";
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
- (void)reloadTextIfAvailable {
|
|
159
|
-
if (self.hasLoadedDocument || self.engineId.length == 0 || self.documentGeneration <= 0) return;
|
|
160
|
-
NSString *text = [[PapyrusTextStore shared] textForEngineId:self.engineId generation:self.documentGeneration];
|
|
161
|
-
if (!text) return;
|
|
162
|
-
self.hasLoadedDocument = YES;
|
|
163
|
-
self.suppressOffsetEvents = YES;
|
|
164
|
-
[self applyThemeAndTypography];
|
|
165
|
-
self.textView.text = text;
|
|
166
|
-
[self applyThemeAndTypography];
|
|
167
|
-
self.suppressOffsetEvents = NO;
|
|
168
|
-
[self applySearchHighlights];
|
|
169
|
-
[self scrollToTextOffset:self.currentTextOffset];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
- (void)applyThemeAndTypography {
|
|
173
|
-
UIColor *paper = UIColor.whiteColor;
|
|
174
|
-
UIColor *foreground = UIColor.blackColor;
|
|
175
|
-
if ([self.pageTheme isEqualToString:@"sepia"]) {
|
|
176
|
-
paper = [UIColor colorWithRed:0.957 green:0.922 blue:0.843 alpha:1];
|
|
177
|
-
foreground = [UIColor colorWithRed:0.20 green:0.17 blue:0.12 alpha:1];
|
|
178
|
-
} else if ([self.pageTheme isEqualToString:@"dark"]) {
|
|
179
|
-
paper = [UIColor colorWithRed:0.12 green:0.12 blue:0.13 alpha:1];
|
|
180
|
-
foreground = [UIColor colorWithRed:0.92 green:0.92 blue:0.92 alpha:1];
|
|
181
|
-
} else if ([self.pageTheme isEqualToString:@"high-contrast"]) {
|
|
182
|
-
paper = UIColor.blackColor;
|
|
183
|
-
foreground = UIColor.whiteColor;
|
|
184
|
-
} else if ([self.uiTheme isEqualToString:@"dark"]) {
|
|
185
|
-
paper = [UIColor colorWithRed:0.12 green:0.12 blue:0.13 alpha:1];
|
|
186
|
-
foreground = [UIColor colorWithRed:0.92 green:0.92 blue:0.92 alpha:1];
|
|
187
|
-
}
|
|
188
|
-
self.backgroundColor = paper;
|
|
189
|
-
self.textView.backgroundColor = paper;
|
|
190
|
-
self.textView.textColor = foreground;
|
|
191
|
-
self.textView.font = [UIFont systemFontOfSize:self.fontSize];
|
|
192
|
-
self.textView.textContainerInset = UIEdgeInsetsMake(_pageMargin, MAX(44,_pageMargin), _pageMargin, _pageMargin);
|
|
193
|
-
if (self.textView.text.length > 0) {
|
|
194
|
-
NSMutableParagraphStyle *paragraph = [[NSMutableParagraphStyle alloc] init];
|
|
195
|
-
paragraph.minimumLineHeight = MAX(self.lineHeight,self.fontSize);
|
|
196
|
-
paragraph.maximumLineHeight = MAX(self.lineHeight,self.fontSize);
|
|
197
|
-
paragraph.lineBreakMode = NSLineBreakByWordWrapping;
|
|
198
|
-
[self.textView.textStorage addAttribute:NSParagraphStyleAttributeName
|
|
199
|
-
value:paragraph
|
|
200
|
-
range:NSMakeRange(0, self.textView.textStorage.length)];
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
- (void)applySearchHighlights {
|
|
205
|
-
if (!self.hasLoadedDocument || self.textView.text.length == 0) return;
|
|
206
|
-
NSTextStorage *storage = self.textView.textStorage;
|
|
207
|
-
for (NSAttributedStringKey key in @[NSBackgroundColorAttributeName, NSUnderlineStyleAttributeName, NSUnderlineColorAttributeName, NSStrikethroughStyleAttributeName, NSStrikethroughColorAttributeName, @"PapyrusAnnotationId"]) [storage removeAttribute:key range:NSMakeRange(0, storage.length)];
|
|
208
|
-
[self applyAnnotationAttributes];
|
|
209
|
-
NSUInteger count = MIN(self.searchResults.count, PapyrusMaximumTextSearchHighlights);
|
|
210
|
-
CGFloat normalAlpha = [self.pageTheme isEqualToString:@"dark"] ? 0.35 : 0.42;
|
|
211
|
-
UIColor *normal = [UIColor colorWithRed:1.0 green:0.79 blue:0.16 alpha:normalAlpha];
|
|
212
|
-
UIColor *active = [UIColor colorWithRed:0.10 green:0.48 blue:0.98 alpha:0.55];
|
|
213
|
-
for (NSUInteger index = 0; index < count; index++) {
|
|
214
|
-
NSDictionary *location = self.searchResults[index][@"location"];
|
|
215
|
-
if (![location isKindOfClass:[NSDictionary class]]) continue;
|
|
216
|
-
NSInteger start = [location[@"start"] integerValue];
|
|
217
|
-
NSInteger end = [location[@"end"] integerValue];
|
|
218
|
-
if (start < 0 || end <= start || end > storage.length) continue;
|
|
219
|
-
[storage addAttribute:NSBackgroundColorAttributeName
|
|
220
|
-
value:(NSInteger)index == self.activeSearchIndex ? active : normal
|
|
221
|
-
range:NSMakeRange((NSUInteger)start, (NSUInteger)(end - start))];
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
- (void)scrollToTextOffset:(NSInteger)offset {
|
|
226
|
-
if (!self.hasLoadedDocument || self.textView.text.length == 0) return;
|
|
227
|
-
NSInteger safeOffset = MAX(0, MIN((NSInteger)self.textView.text.length, offset));
|
|
228
|
-
UITextPosition *position = [self.textView positionFromPosition:self.textView.beginningOfDocument offset:safeOffset];
|
|
229
|
-
if (!position) return;
|
|
230
|
-
CGRect caret = [self.textView caretRectForPosition:position];
|
|
231
|
-
if (!CGRectIsNull(caret)) {
|
|
232
|
-
self.suppressOffsetEvents = YES;
|
|
233
|
-
[self.textView scrollRectToVisible:CGRectInset(caret, 0, -self.fontSize * 2) animated:NO];
|
|
234
|
-
self.suppressOffsetEvents = NO;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
- (NSDictionary *)selectedRangePayload {
|
|
239
|
-
NSRange range = self.textView.selectedRange;
|
|
240
|
-
if (range.location == NSNotFound || range.length == 0 || NSMaxRange(range) > self.textView.text.length) return nil;
|
|
241
|
-
NSString *text = [self.textView.text substringWithRange:range];
|
|
242
|
-
NSUInteger prefixStart = range.location > 48 ? range.location - 48 : 0;
|
|
243
|
-
if (prefixStart > 0 && CFStringIsSurrogateLowCharacter([self.textView.text characterAtIndex:prefixStart])) prefixStart--;
|
|
244
|
-
NSUInteger suffixEnd = MIN(self.textView.text.length, NSMaxRange(range)+48);
|
|
245
|
-
if (suffixEnd < self.textView.text.length && CFStringIsSurrogateLowCharacter([self.textView.text characterAtIndex:suffixEnd])) suffixEnd++;
|
|
246
|
-
return @{ @"text": text, @"start": @(range.location), @"end": @(NSMaxRange(range)),
|
|
247
|
-
@"prefix": [self.textView.text substringWithRange:NSMakeRange(prefixStart, range.location - prefixStart)],
|
|
248
|
-
@"suffix": [self.textView.text substringWithRange:NSMakeRange(NSMaxRange(range), suffixEnd - NSMaxRange(range))] };
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
- (void)textViewDidChangeSelection:(UITextView *)textView {
|
|
252
|
-
NSDictionary *payload = [self selectedRangePayload];
|
|
253
|
-
if (!payload) {
|
|
254
|
-
self.lastReportedStart = -1;
|
|
255
|
-
self.lastReportedEnd = -1;
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
NSInteger start = [payload[@"start"] integerValue];
|
|
259
|
-
NSInteger end = [payload[@"end"] integerValue];
|
|
260
|
-
if (start == self.lastReportedStart && end == self.lastReportedEnd) return;
|
|
261
|
-
self.lastReportedStart = start;
|
|
262
|
-
self.lastReportedEnd = end;
|
|
263
|
-
if (self.onTextRangeSelected) self.onTextRangeSelected(@{ @"nativeEvent": payload });
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
- (BOOL)isSingleWordSelection {
|
|
267
|
-
NSDictionary *payload = [self selectedRangePayload];
|
|
268
|
-
NSString *text = payload[@"text"];
|
|
269
|
-
if (text.length == 0 || text.length > 64) return NO;
|
|
270
|
-
NSCharacterSet *spaces = NSCharacterSet.whitespaceAndNewlineCharacterSet;
|
|
271
|
-
return [text rangeOfCharacterFromSet:spaces].location == NSNotFound;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
|
275
|
-
if (self.suppressOffsetEvents || !self.onTextOffsetChange || !self.hasLoadedDocument) return;
|
|
276
|
-
CGPoint point = CGPointMake(2, MAX(0, scrollView.contentOffset.y) + self.textView.textContainerInset.top + 2);
|
|
277
|
-
UITextPosition *position = [self.textView closestPositionToPoint:point];
|
|
278
|
-
if (!position) return;
|
|
279
|
-
NSInteger offset = [self.textView offsetFromPosition:self.textView.beginningOfDocument toPosition:position];
|
|
280
|
-
offset = MAX(0, MIN((NSInteger)self.textView.text.length, offset));
|
|
281
|
-
CFAbsoluteTime now = CFAbsoluteTimeGetCurrent();
|
|
282
|
-
if (offset == self.lastReportedOffset || now - self.lastOffsetEventTime < 0.06) return;
|
|
283
|
-
self.lastReportedOffset = offset;
|
|
284
|
-
self.lastOffsetEventTime = now;
|
|
285
|
-
_currentTextOffset = offset;
|
|
286
|
-
self.onTextOffsetChange(@{ @"nativeEvent": @{ @"offset": @(offset) } });
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
- (void)defineCurrentSelection:(id)sender {
|
|
290
|
-
#pragma unused(sender)
|
|
291
|
-
if ([self.defineSelectionMode isEqualToString:@"single-word"] && ![self isSingleWordSelection]) return;
|
|
292
|
-
NSDictionary *payload = [self selectedRangePayload];
|
|
293
|
-
if (payload && self.onDefineSelection) self.onDefineSelection(@{ @"nativeEvent": payload });
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
|
|
297
|
-
if (action == @selector(defineCurrentSelection:)) {
|
|
298
|
-
return [self selectedRangePayload] != nil &&
|
|
299
|
-
(![self.defineSelectionMode isEqualToString:@"single-word"] || [self isSingleWordSelection]);
|
|
300
|
-
}
|
|
301
|
-
if (action == @selector(highlightSelection:) || action == @selector(underlineSelection:) ||
|
|
302
|
-
action == @selector(strikeoutSelection:) || action == @selector(noteSelection:)) {
|
|
303
|
-
return self.onAnnotateSelection != nil && [self selectedRangePayload] != nil;
|
|
304
|
-
}
|
|
305
|
-
return [super canPerformAction:action withSender:sender];
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
- (UIMenu *)textView:(UITextView *)textView
|
|
309
|
-
editMenuForTextInRange:(NSRange)range
|
|
310
|
-
suggestedActions:(NSArray<UIMenuElement *> *)suggestedActions API_AVAILABLE(ios(16.0)) {
|
|
311
|
-
if (range.location != NSNotFound && range.length > 0 && NSMaxRange(range) <= textView.text.length) {
|
|
312
|
-
textView.selectedRange = range;
|
|
313
|
-
}
|
|
314
|
-
NSMutableArray<UIMenuElement *> *actions = [PapyrusLocalizedSelectionActions(suggestedActions, self.annotationLabels[@"copy"], self.annotationLabels[@"selectAll"]) mutableCopy] ?: [NSMutableArray array];
|
|
315
|
-
if ([self selectedRangePayload] &&
|
|
316
|
-
(![self.defineSelectionMode isEqualToString:@"single-word"] || [self isSingleWordSelection])) {
|
|
317
|
-
UIAction *define = [UIAction actionWithTitle:self.defineLabel image:[UIImage systemImageNamed:@"text.magnifyingglass"] identifier:nil handler:^(__kindof UIAction *action) {
|
|
318
|
-
#pragma unused(action)
|
|
319
|
-
[self defineCurrentSelection:nil];
|
|
320
|
-
}];
|
|
321
|
-
[actions insertObject:define atIndex:0];
|
|
322
|
-
}
|
|
323
|
-
if ([self selectedRangePayload] && self.onAnnotateSelection) {
|
|
324
|
-
NSMutableArray *marks = [NSMutableArray array];
|
|
325
|
-
for (NSString *style in @[@"highlight", @"underline", @"strikeout", @"comment"]) {
|
|
326
|
-
NSString *label = self.annotationLabels[style];
|
|
327
|
-
if (!label.length) continue;
|
|
328
|
-
NSDictionary *symbols = @{@"highlight":@"highlighter", @"underline":@"underline",
|
|
329
|
-
@"strikeout":@"strikethrough", @"comment":@"note.text"};
|
|
330
|
-
[marks addObject:[UIAction actionWithTitle:label image:[UIImage systemImageNamed:symbols[style]] identifier:nil handler:^(__kindof UIAction *action) {
|
|
331
|
-
[self emitAnnotationIntent:style];
|
|
332
|
-
}]];
|
|
333
|
-
}
|
|
334
|
-
if (marks.count) [actions insertObject:[UIMenu menuWithTitle:self.annotationLabels[@"annotate"] ?: @"" children:marks] atIndex:0];
|
|
335
|
-
}
|
|
336
|
-
return [UIMenu menuWithChildren:actions];
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
- (void)setAnnotations:(NSArray<NSDictionary *> *)value {
|
|
341
|
-
_annotations = [value copy] ?: @[];
|
|
342
|
-
self.resolvedAnnotationRanges = [NSMutableDictionary dictionary];
|
|
343
|
-
[self applySearchHighlights];
|
|
344
|
-
}
|
|
345
|
-
- (void)setAnnotationLabels:(NSDictionary<NSString *,NSString *> *)value {
|
|
346
|
-
_annotationLabels = [value copy] ?: @{};
|
|
347
|
-
if (@available(iOS 16.0, *)) return;
|
|
348
|
-
NSMutableArray *items = [NSMutableArray array];
|
|
349
|
-
[items addObject:[[UIMenuItem alloc] initWithTitle:self.defineLabel action:@selector(defineCurrentSelection:)]];
|
|
350
|
-
NSArray *styles = @[@"highlight", @"underline", @"strikeout", @"comment"];
|
|
351
|
-
NSArray *selectors = @[@"highlightSelection:", @"underlineSelection:", @"strikeoutSelection:", @"noteSelection:"];
|
|
352
|
-
for (NSUInteger i=0; i<styles.count; i++) if (_annotationLabels[styles[i]].length) [items addObject:[[UIMenuItem alloc] initWithTitle:_annotationLabels[styles[i]] action:NSSelectorFromString(selectors[i])]];
|
|
353
|
-
UIMenuController.sharedMenuController.menuItems = items;
|
|
354
|
-
}
|
|
355
|
-
- (void)highlightSelection:(id)sender { [self emitAnnotationIntent:@"highlight"]; }
|
|
356
|
-
- (void)underlineSelection:(id)sender { [self emitAnnotationIntent:@"underline"]; }
|
|
357
|
-
- (void)strikeoutSelection:(id)sender { [self emitAnnotationIntent:@"strikeout"]; }
|
|
358
|
-
- (void)noteSelection:(id)sender { [self emitAnnotationIntent:@"comment"]; }
|
|
359
|
-
- (void)emitAnnotationIntent:(NSString *)style {
|
|
360
|
-
NSDictionary *selection = [self selectedRangePayload];
|
|
361
|
-
if (!selection || !self.onAnnotateSelection) return;
|
|
362
|
-
NSMutableDictionary *payload = [selection mutableCopy];
|
|
363
|
-
payload[@"style"] = style;
|
|
364
|
-
self.onAnnotateSelection(@{ @"nativeEvent": payload });
|
|
365
|
-
}
|
|
366
|
-
- (NSRange)rangeForAnnotation:(NSDictionary *)annotation {
|
|
367
|
-
if (![annotation isKindOfClass:NSDictionary.class]) return NSMakeRange(NSNotFound,0);
|
|
368
|
-
NSString *identifier = annotation[@"id"];
|
|
369
|
-
if (![identifier isKindOfClass:NSString.class]) return NSMakeRange(NSNotFound,0);
|
|
370
|
-
if (![self.resolvedAnnotationText isEqual:self.textView.text]) {
|
|
371
|
-
self.resolvedAnnotationText = self.textView.text.copy;
|
|
372
|
-
self.resolvedAnnotationRanges = [NSMutableDictionary dictionary];
|
|
373
|
-
}
|
|
374
|
-
NSValue *cached = self.resolvedAnnotationRanges[identifier];
|
|
375
|
-
if (cached) return cached.rangeValue;
|
|
376
|
-
NSRange resolved = [self resolveRangeForAnnotation:annotation];
|
|
377
|
-
self.resolvedAnnotationRanges[identifier] = [NSValue valueWithRange:resolved];
|
|
378
|
-
return resolved;
|
|
379
|
-
}
|
|
380
|
-
- (NSRange)resolveRangeForAnnotation:(NSDictionary *)annotation {
|
|
381
|
-
if (![annotation isKindOfClass:NSDictionary.class]) return NSMakeRange(NSNotFound,0);
|
|
382
|
-
NSDictionary *anchor = [annotation[@"anchor"] isKindOfClass:NSDictionary.class] ? annotation[@"anchor"] : @{};
|
|
383
|
-
NSDictionary *range = [anchor[@"kind"] isEqual:@"text-range"] ? anchor : annotation[@"textRange"];
|
|
384
|
-
if (![range isKindOfClass:NSDictionary.class]) return NSMakeRange(NSNotFound, 0);
|
|
385
|
-
if (![range[@"start"] isKindOfClass:NSNumber.class] || ![range[@"end"] isKindOfClass:NSNumber.class]) return NSMakeRange(NSNotFound,0);
|
|
386
|
-
NSInteger start = [range[@"start"] integerValue], end = [range[@"end"] integerValue];
|
|
387
|
-
if ([anchor[@"kind"] isEqual:@"text-range"]) return PapyrusResolveTextAnnotationRange(self.textView.text,anchor);
|
|
388
|
-
if (start < 0 || end <= start || end > self.textView.text.length) return NSMakeRange(NSNotFound, 0);
|
|
389
|
-
NSRange result = NSMakeRange(start, end-start);
|
|
390
|
-
NSString *quote = anchor[@"quote"];
|
|
391
|
-
if ([quote isKindOfClass:NSString.class] && ![[self.textView.text substringWithRange:result] isEqual:quote]) return NSMakeRange(NSNotFound,0);
|
|
392
|
-
return result;
|
|
393
|
-
}
|
|
394
|
-
- (UIColor *)annotationColor:(NSDictionary *)annotation {
|
|
395
|
-
NSString *hex = annotation[@"color"];
|
|
396
|
-
unsigned int rgb = 0xFFC928;
|
|
397
|
-
if ([hex isKindOfClass:NSString.class]) [[NSScanner scannerWithString:[hex stringByReplacingOccurrencesOfString:@"#" withString:@""]] scanHexInt:&rgb];
|
|
398
|
-
return [UIColor colorWithRed:((rgb>>16)&255)/255.0 green:((rgb>>8)&255)/255.0 blue:(rgb&255)/255.0 alpha:1];
|
|
399
|
-
}
|
|
400
|
-
- (void)applyAnnotationAttributes {
|
|
401
|
-
NSMutableSet *visibleIds = [NSMutableSet set];
|
|
402
|
-
for (NSDictionary *annotation in self.annotations) {
|
|
403
|
-
NSRange range = [self rangeForAnnotation:annotation];
|
|
404
|
-
if (range.location == NSNotFound) continue;
|
|
405
|
-
NSString *style = annotation[@"markupStyle"] ?: annotation[@"type"];
|
|
406
|
-
UIColor *color = [self annotationColor:annotation];
|
|
407
|
-
NSTextStorage *storage = self.textView.textStorage;
|
|
408
|
-
if ([style isEqual:@"highlight"]) [storage addAttribute:NSBackgroundColorAttributeName value:[color colorWithAlphaComponent:annotation[@"opacity"] ? MAX(0,MIN(1,[annotation[@"opacity"] doubleValue])) : 0.35] range:range];
|
|
409
|
-
if ([style isEqual:@"underline"] || [style isEqual:@"squiggly"]) {
|
|
410
|
-
[storage addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:range];
|
|
411
|
-
[storage addAttribute:NSUnderlineColorAttributeName value:color range:range];
|
|
412
|
-
}
|
|
413
|
-
if ([style isEqual:@"strikeout"]) {
|
|
414
|
-
[storage addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlineStyleSingle) range:range];
|
|
415
|
-
[storage addAttribute:NSStrikethroughColorAttributeName value:color range:range];
|
|
416
|
-
}
|
|
417
|
-
NSString *identifier = annotation[@"id"];
|
|
418
|
-
if (![identifier isKindOfClass:NSString.class]) continue;
|
|
419
|
-
[storage addAttribute:@"PapyrusAnnotationId" value:identifier range:range];
|
|
420
|
-
BOOL note = annotation[@"noteContent"] != nil || [annotation[@"type"] isEqual:@"comment"] || [annotation[@"type"] isEqual:@"text"];
|
|
421
|
-
if (note) {
|
|
422
|
-
[visibleIds addObject:identifier];
|
|
423
|
-
UIButton *button = self.noteButtons[identifier];
|
|
424
|
-
BOOL created = button == nil;
|
|
425
|
-
if (created) button = [UIButton buttonWithType:UIButtonTypeSystem];
|
|
426
|
-
[button setTitle:@"●" forState:UIControlStateNormal];
|
|
427
|
-
[button setTitleColor:color forState:UIControlStateNormal];
|
|
428
|
-
button.accessibilityIdentifier = identifier;
|
|
429
|
-
button.accessibilityLabel = self.annotationLabels[@"comment"] ?: @"";
|
|
430
|
-
if (created) [button addTarget:self action:@selector(openAnnotationNote:) forControlEvents:UIControlEventTouchUpInside];
|
|
431
|
-
self.noteButtons[identifier] = button;
|
|
432
|
-
if (created) {
|
|
433
|
-
[self.textView addSubview:button];
|
|
434
|
-
if (!UIAccessibilityIsReduceMotionEnabled()) {button.alpha=0;button.transform=CGAffineTransformMakeScale(0.92,0.92);[UIView animateWithDuration:0.18 animations:^{button.alpha=1;button.transform=CGAffineTransformIdentity;}];}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
for (NSString *identifier in self.noteButtons.allKeys.copy) if (![visibleIds containsObject:identifier]) {[self.noteButtons[identifier] removeFromSuperview];[self.noteButtons removeObjectForKey:identifier];}
|
|
439
|
-
[self layoutNoteButtons];
|
|
440
|
-
}
|
|
441
|
-
- (void)layoutNoteButtons {
|
|
442
|
-
if (self.noteButtons.count == 0) return;
|
|
443
|
-
[self.textView.layoutManager ensureLayoutForTextContainer:self.textView.textContainer];
|
|
444
|
-
self.noteGroups = [NSMutableDictionary dictionary];
|
|
445
|
-
NSMutableDictionary<NSNumber *, NSMutableArray<UIButton *> *> *groups = [NSMutableDictionary dictionary];
|
|
446
|
-
for (NSDictionary *annotation in self.annotations) {
|
|
447
|
-
UIButton *button = self.noteButtons[annotation[@"id"]];
|
|
448
|
-
NSRange range = [self rangeForAnnotation:annotation];
|
|
449
|
-
if (!button || range.location == NSNotFound) continue;
|
|
450
|
-
NSRange glyph = [self.textView.layoutManager glyphRangeForCharacterRange:NSMakeRange(range.location,1) actualCharacterRange:NULL];
|
|
451
|
-
CGRect bounds = [self.textView.layoutManager boundingRectForGlyphRange:glyph inTextContainer:self.textView.textContainer];
|
|
452
|
-
// Reserved outside the text container; follows UITextView's own content scroll.
|
|
453
|
-
CGFloat y = bounds.origin.y + self.textView.textContainerInset.top - 6;
|
|
454
|
-
button.frame = CGRectMake(0, floor(y/44)*44, 44, 44);
|
|
455
|
-
NSNumber *key = @(floor(y/44));
|
|
456
|
-
if (!groups[key]) groups[key] = [NSMutableArray array];
|
|
457
|
-
[groups[key] addObject:button];
|
|
458
|
-
button.hidden = YES;
|
|
459
|
-
}
|
|
460
|
-
for (NSArray<UIButton *> *buttons in groups.allValues) {
|
|
461
|
-
UIButton *leader = buttons.firstObject;
|
|
462
|
-
leader.hidden = NO;
|
|
463
|
-
NSMutableArray *ids=[NSMutableArray array];for(UIButton *button in buttons)[ids addObject:button.accessibilityIdentifier];
|
|
464
|
-
self.noteGroups[leader.accessibilityIdentifier]=ids;
|
|
465
|
-
[leader setTitle:buttons.count > 1 ? [NSString stringWithFormat:@"%lu",(unsigned long)buttons.count] : @"●" forState:UIControlStateNormal];
|
|
466
|
-
if (@available(iOS 14.0,*)) {
|
|
467
|
-
NSMutableArray *actions = [NSMutableArray array];
|
|
468
|
-
for (UIButton *button in buttons) {
|
|
469
|
-
NSString *identifier = button.accessibilityIdentifier;
|
|
470
|
-
NSString *title = identifier;
|
|
471
|
-
for (NSDictionary *annotation in self.annotations) if ([annotation[@"id"] isEqual:identifier]) { title = annotation[@"noteContent"] ?: annotation[@"content"] ?: identifier; break; }
|
|
472
|
-
__weak typeof(self) weakSelf = self;
|
|
473
|
-
[actions addObject:[UIAction actionWithTitle:title image:nil identifier:nil handler:^(__kindof UIAction *action) {
|
|
474
|
-
if (weakSelf.onAnnotationTap) weakSelf.onAnnotationTap(@{@"nativeEvent":@{@"id":identifier}});
|
|
475
|
-
}]];
|
|
476
|
-
}
|
|
477
|
-
leader.menu = buttons.count > 1 ? [UIMenu menuWithTitle:self.annotationLabels[@"comment"] ?: @"" children:actions] : nil;
|
|
478
|
-
leader.showsMenuAsPrimaryAction = buttons.count > 1;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)recognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)other { return YES; }
|
|
483
|
-
- (void)tapTextAnnotation:(UITapGestureRecognizer *)recognizer {
|
|
484
|
-
if (recognizer.state != UIGestureRecognizerStateEnded || self.textView.selectedRange.length > 0) return;
|
|
485
|
-
if (self.textView.layoutManager.numberOfGlyphs == 0) return;
|
|
486
|
-
CGPoint point = [recognizer locationInView:self.textView];
|
|
487
|
-
point.x -= self.textView.textContainerInset.left; point.y -= self.textView.textContainerInset.top;
|
|
488
|
-
CGFloat fraction = 0;
|
|
489
|
-
NSUInteger glyph = [self.textView.layoutManager glyphIndexForPoint:point inTextContainer:self.textView.textContainer fractionOfDistanceThroughGlyph:&fraction];
|
|
490
|
-
if (glyph >= self.textView.layoutManager.numberOfGlyphs) return;
|
|
491
|
-
CGRect bounds = [self.textView.layoutManager boundingRectForGlyphRange:NSMakeRange(glyph,1) inTextContainer:self.textView.textContainer];
|
|
492
|
-
if (!CGRectContainsPoint(CGRectInset(bounds,-3,-3),point)) return;
|
|
493
|
-
NSUInteger index = [self.textView.layoutManager characterIndexForGlyphAtIndex:glyph];
|
|
494
|
-
for (NSDictionary *annotation in self.annotations) {
|
|
495
|
-
NSRange range = [self rangeForAnnotation:annotation];
|
|
496
|
-
if (range.location != NSNotFound && NSLocationInRange(index,range) && self.onAnnotationTap) {
|
|
497
|
-
self.onAnnotationTap(@{@"nativeEvent":@{@"id":annotation[@"id"] ?: @""}});return;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
- (void)openAnnotationNote:(UIButton *)sender {
|
|
502
|
-
NSArray<NSString *> *ids=self.noteGroups[sender.accessibilityIdentifier];
|
|
503
|
-
if(ids.count>1) {
|
|
504
|
-
UIResponder *responder=self;while(responder && ![responder isKindOfClass:UIViewController.class])responder=responder.nextResponder;
|
|
505
|
-
UIViewController *controller=(UIViewController *)responder;
|
|
506
|
-
if(!controller || controller.presentedViewController)return;
|
|
507
|
-
UIAlertController *menu=[UIAlertController alertControllerWithTitle:self.annotationLabels[@"comment"] message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
|
508
|
-
__weak typeof(self) weakSelf=self;
|
|
509
|
-
for(NSString *identifier in ids){NSString *title=identifier;for(NSDictionary *a in self.annotations)if([a[@"id"] isEqual:identifier]){title=a[@"noteContent"] ?: a[@"content"] ?: identifier;break;}
|
|
510
|
-
[menu addAction:[UIAlertAction actionWithTitle:title style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){if(weakSelf.onAnnotationTap)weakSelf.onAnnotationTap(@{@"nativeEvent":@{@"id":identifier}});}]];
|
|
511
|
-
}
|
|
512
|
-
menu.popoverPresentationController.sourceView=sender;menu.popoverPresentationController.sourceRect=sender.bounds;
|
|
513
|
-
[controller presentViewController:menu animated:!UIAccessibilityIsReduceMotionEnabled() completion:nil];return;
|
|
514
|
-
}
|
|
515
|
-
if (self.onAnnotationTap) self.onAnnotationTap(@{ @"nativeEvent": @{ @"id": sender.accessibilityIdentifier ?: @"" } });
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
@end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#import <React/RCTViewManager.h>
|
|
2
|
-
#import "PapyrusTextDocumentView.h"
|
|
3
|
-
|
|
4
|
-
@interface PapyrusTextDocumentViewManager : RCTViewManager
|
|
5
|
-
@end
|
|
6
|
-
|
|
7
|
-
@implementation PapyrusTextDocumentViewManager
|
|
8
|
-
RCT_EXPORT_MODULE(PapyrusTextDocumentView)
|
|
9
|
-
RCT_EXPORT_VIEW_PROPERTY(engineId, NSString)
|
|
10
|
-
RCT_EXPORT_VIEW_PROPERTY(documentGeneration, NSInteger)
|
|
11
|
-
RCT_EXPORT_VIEW_PROPERTY(textLength, NSInteger)
|
|
12
|
-
RCT_EXPORT_VIEW_PROPERTY(currentTextOffset, NSInteger)
|
|
13
|
-
RCT_EXPORT_VIEW_PROPERTY(scrollToTextOffsetSignal, NSNumber)
|
|
14
|
-
RCT_EXPORT_VIEW_PROPERTY(textNavigationRequest, NSDictionary)
|
|
15
|
-
RCT_EXPORT_VIEW_PROPERTY(searchResults, NSArray)
|
|
16
|
-
RCT_EXPORT_VIEW_PROPERTY(annotations, NSArray)
|
|
17
|
-
RCT_EXPORT_VIEW_PROPERTY(annotationLabels, NSDictionary)
|
|
18
|
-
RCT_EXPORT_VIEW_PROPERTY(onAnnotateSelection, RCTBubblingEventBlock)
|
|
19
|
-
RCT_EXPORT_VIEW_PROPERTY(onAnnotationTap, RCTBubblingEventBlock)
|
|
20
|
-
RCT_EXPORT_VIEW_PROPERTY(activeSearchIndex, NSInteger)
|
|
21
|
-
RCT_EXPORT_VIEW_PROPERTY(pageTheme, NSString)
|
|
22
|
-
RCT_EXPORT_VIEW_PROPERTY(uiTheme, NSString)
|
|
23
|
-
RCT_EXPORT_VIEW_PROPERTY(fontSize, CGFloat)
|
|
24
|
-
RCT_EXPORT_VIEW_PROPERTY(lineHeight, CGFloat)
|
|
25
|
-
RCT_EXPORT_VIEW_PROPERTY(pageMargin, CGFloat)
|
|
26
|
-
RCT_EXPORT_VIEW_PROPERTY(defineLabel, NSString)
|
|
27
|
-
RCT_EXPORT_VIEW_PROPERTY(defineSelectionMode, NSString)
|
|
28
|
-
RCT_EXPORT_VIEW_PROPERTY(onTextOffsetChange, RCTBubblingEventBlock)
|
|
29
|
-
RCT_EXPORT_VIEW_PROPERTY(onTextRangeSelected, RCTBubblingEventBlock)
|
|
30
|
-
RCT_EXPORT_VIEW_PROPERTY(onDefineSelection, RCTBubblingEventBlock)
|
|
31
|
-
|
|
32
|
-
+ (BOOL)requiresMainQueueSetup { return YES; }
|
|
33
|
-
- (UIView *)view { return [[PapyrusTextDocumentView alloc] initWithFrame:CGRectZero]; }
|
|
34
|
-
@end
|
package/ios/PapyrusTextStore.h
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
-
|
|
5
|
-
@interface PapyrusTextStore : NSObject
|
|
6
|
-
+ (instancetype)shared;
|
|
7
|
-
- (void)setText:(NSString *)text engineId:(NSString *)engineId generation:(NSInteger)generation;
|
|
8
|
-
- (nullable NSString *)textForEngineId:(NSString *)engineId generation:(NSInteger)generation;
|
|
9
|
-
- (void)closeEngineId:(NSString *)engineId generation:(NSInteger)generation;
|
|
10
|
-
- (void)closeEngineId:(NSString *)engineId;
|
|
11
|
-
@end
|
|
12
|
-
|
|
13
|
-
NS_ASSUME_NONNULL_END
|
package/ios/PapyrusTextStore.m
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
#import "PapyrusTextStore.h"
|
|
2
|
-
|
|
3
|
-
@interface PapyrusTextStore ()
|
|
4
|
-
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSDictionary *> *documents;
|
|
5
|
-
@property (nonatomic, strong) NSMutableSet<NSString *> *destroyedEngineIds;
|
|
6
|
-
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSNumber *> *closedGenerations;
|
|
7
|
-
@property (nonatomic, strong) NSLock *lock;
|
|
8
|
-
@end
|
|
9
|
-
|
|
10
|
-
@implementation PapyrusTextStore
|
|
11
|
-
|
|
12
|
-
+ (instancetype)shared {
|
|
13
|
-
static PapyrusTextStore *store;
|
|
14
|
-
static dispatch_once_t onceToken;
|
|
15
|
-
dispatch_once(&onceToken, ^{
|
|
16
|
-
store = [[PapyrusTextStore alloc] init];
|
|
17
|
-
});
|
|
18
|
-
return store;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
- (instancetype)init {
|
|
22
|
-
self = [super init];
|
|
23
|
-
if (self) {
|
|
24
|
-
_documents = [NSMutableDictionary dictionary];
|
|
25
|
-
_destroyedEngineIds = [NSMutableSet set];
|
|
26
|
-
_closedGenerations = [NSMutableDictionary dictionary];
|
|
27
|
-
_lock = [[NSLock alloc] init];
|
|
28
|
-
}
|
|
29
|
-
return self;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
- (void)setText:(NSString *)text engineId:(NSString *)engineId generation:(NSInteger)generation {
|
|
33
|
-
if (engineId.length == 0 || !text) return;
|
|
34
|
-
[self.lock lock];
|
|
35
|
-
NSDictionary *previous = self.documents[engineId];
|
|
36
|
-
NSNumber *closed = self.closedGenerations[engineId];
|
|
37
|
-
NSInteger closedGeneration = closed ? closed.integerValue : -1;
|
|
38
|
-
if (![self.destroyedEngineIds containsObject:engineId] && generation > closedGeneration && [previous[@"generation"] integerValue] <= generation) {
|
|
39
|
-
self.documents[engineId] = @{ @"generation": @(generation), @"text": [text copy] };
|
|
40
|
-
}
|
|
41
|
-
[self.lock unlock];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
- (NSString *)textForEngineId:(NSString *)engineId generation:(NSInteger)generation {
|
|
45
|
-
[self.lock lock];
|
|
46
|
-
NSDictionary *entry = self.documents[engineId];
|
|
47
|
-
NSString *text = [entry[@"generation"] integerValue] == generation ? entry[@"text"] : nil;
|
|
48
|
-
[self.lock unlock];
|
|
49
|
-
return text;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
- (void)closeEngineId:(NSString *)engineId generation:(NSInteger)generation {
|
|
53
|
-
[self.lock lock];
|
|
54
|
-
NSNumber *closed = self.closedGenerations[engineId];
|
|
55
|
-
NSInteger closedGeneration = closed ? closed.integerValue : -1;
|
|
56
|
-
if (generation > closedGeneration) self.closedGenerations[engineId] = @(generation);
|
|
57
|
-
NSDictionary *entry = self.documents[engineId];
|
|
58
|
-
if ([entry[@"generation"] integerValue] <= generation) {
|
|
59
|
-
[self.documents removeObjectForKey:engineId];
|
|
60
|
-
}
|
|
61
|
-
[self.lock unlock];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
- (void)closeEngineId:(NSString *)engineId {
|
|
65
|
-
if (engineId.length == 0) return;
|
|
66
|
-
[self.lock lock];
|
|
67
|
-
[self.documents removeObjectForKey:engineId];
|
|
68
|
-
[self.destroyedEngineIds addObject:engineId];
|
|
69
|
-
[self.closedGenerations removeObjectForKey:engineId];
|
|
70
|
-
[self.lock unlock];
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@end
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
BLAKE2 reference source notice
|
|
2
|
-
|
|
3
|
-
The BLAKE2 reference source files included in the libarchive subset are
|
|
4
|
-
Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. They may be used under the
|
|
5
|
-
terms of CC0 1.0 Universal, the OpenSSL License, or Apache License 2.0, at the
|
|
6
|
-
user's option. The source files retain this notice. The license texts are
|
|
7
|
-
available from:
|
|
8
|
-
|
|
9
|
-
CC0 1.0 Universal: https://creativecommons.org/publicdomain/zero/1.0/legalcode
|
|
10
|
-
OpenSSL License: https://www.openssl.org/source/license.html
|
|
11
|
-
Apache License 2.0: https://www.apache.org/licenses/LICENSE-2.0
|