@papyrus-sdk/engine-native 0.2.19 → 0.2.21
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/LICENSE +21 -0
- package/android/src/main/cpp/CMakeLists.txt +12 -1
- package/android/src/main/cpp/papyrus_outline_loader_test.cpp +240 -0
- package/android/src/main/cpp/papyrus_text_search.cpp +162 -24
- package/android/src/main/cpp/papyrus_text_word.cpp +33 -0
- package/android/src/main/cpp/papyrus_text_word.h +19 -0
- package/android/src/main/cpp/papyrus_text_word_test.cpp +72 -0
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.java +3 -3
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.kt +11 -3
- package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerView.java +296 -285
- package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerViewManager.java +9 -7
- package/android/src/main/java/com/papyrus/engine/PapyrusTextSelect.java +2 -2
- package/android/src/main/java/com/papyrus/engine/PapyrusTextSelectionGesture.java +65 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -6
- package/dist/index.mjs.map +1 -1
- package/ios/PapyrusNativeEngine.m +184 -0
- package/package.json +5 -5
|
@@ -426,7 +426,7 @@ public class PapyrusNativeEngineModule extends ReactContextBaseJavaModule {
|
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
@ReactMethod
|
|
429
|
-
public void selectText(String engineId, int pageIndex, double x, double y, double width, double height, Promise promise) {
|
|
429
|
+
public void selectText(String engineId, int pageIndex, double x, double y, double width, double height, double startX, double startY, double endX, double endY, Promise promise) {
|
|
430
430
|
executor.execute(() -> {
|
|
431
431
|
PapyrusEngineStore.EngineState state = PapyrusEngineStore.getEngine(engineId);
|
|
432
432
|
if (state == null || state.document == null || pageIndex < 0) {
|
|
@@ -443,7 +443,7 @@ public class PapyrusNativeEngineModule extends ReactContextBaseJavaModule {
|
|
|
443
443
|
try {
|
|
444
444
|
if (state.sourcePath != null && !state.sourcePath.isEmpty()) {
|
|
445
445
|
synchronized (state.pdfiumLock) {
|
|
446
|
-
selection = PapyrusTextSelect.nativeSelectTextFile(state.sourcePath, pageIndex, (float) x, (float) y, (float) width, (float) height);
|
|
446
|
+
selection = PapyrusTextSelect.nativeSelectTextFile(state.sourcePath, pageIndex, (float) x, (float) y, (float) width, (float) height, (float) startX, (float) startY, (float) endX, (float) endY);
|
|
447
447
|
}
|
|
448
448
|
} else {
|
|
449
449
|
long docPtr;
|
|
@@ -452,7 +452,7 @@ public class PapyrusNativeEngineModule extends ReactContextBaseJavaModule {
|
|
|
452
452
|
}
|
|
453
453
|
if (docPtr != 0) {
|
|
454
454
|
synchronized (state.pdfiumLock) {
|
|
455
|
-
selection = PapyrusTextSelect.nativeSelectText(docPtr, pageIndex, (float) x, (float) y, (float) width, (float) height);
|
|
455
|
+
selection = PapyrusTextSelect.nativeSelectText(docPtr, pageIndex, (float) x, (float) y, (float) width, (float) height, (float) startX, (float) startY, (float) endX, (float) endY);
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
}
|
|
@@ -333,7 +333,7 @@ class PapyrusNativeEngineModule : Module() {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
AsyncFunction("selectText") { engineId: String, pageIndex: Int, x: Double, y: Double, width: Double, height: Double, promise: Promise ->
|
|
336
|
+
AsyncFunction("selectText") { engineId: String, pageIndex: Int, x: Double, y: Double, width: Double, height: Double, startX: Double, startY: Double, endX: Double, endY: Double, promise: Promise ->
|
|
337
337
|
executor.execute {
|
|
338
338
|
val state = PapyrusEngineStore.getEngine(engineId)
|
|
339
339
|
if (state == null || state.document == null || pageIndex < 0) {
|
|
@@ -356,7 +356,11 @@ class PapyrusNativeEngineModule : Module() {
|
|
|
356
356
|
x.toFloat(),
|
|
357
357
|
y.toFloat(),
|
|
358
358
|
width.toFloat(),
|
|
359
|
-
height.toFloat()
|
|
359
|
+
height.toFloat(),
|
|
360
|
+
startX.toFloat(),
|
|
361
|
+
startY.toFloat(),
|
|
362
|
+
endX.toFloat(),
|
|
363
|
+
endY.toFloat()
|
|
360
364
|
)
|
|
361
365
|
}
|
|
362
366
|
} else {
|
|
@@ -369,7 +373,11 @@ class PapyrusNativeEngineModule : Module() {
|
|
|
369
373
|
x.toFloat(),
|
|
370
374
|
y.toFloat(),
|
|
371
375
|
width.toFloat(),
|
|
372
|
-
height.toFloat()
|
|
376
|
+
height.toFloat(),
|
|
377
|
+
startX.toFloat(),
|
|
378
|
+
startY.toFloat(),
|
|
379
|
+
endX.toFloat(),
|
|
380
|
+
endY.toFloat()
|
|
373
381
|
)
|
|
374
382
|
}
|
|
375
383
|
}
|