@papyrus-sdk/engine-native 0.2.22-beta.6 → 0.2.22-beta.7
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/src/main/cpp/papyrus_outline_loader_test.cpp +240 -0
- package/android/src/main/cpp/papyrus_text_word_test.cpp +72 -0
- package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentView.java +164 -26
- package/android/src/main/java/com/papyrus/engine/PapyrusComicPageLayout.java +21 -0
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.java +12 -0
- package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerView.java +195 -5
- package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerViewManager.java +20 -1
- package/android/src/main/java/com/papyrus/engine/PapyrusSelectionMenuIcon.java +48 -0
- package/android/src/main/java/com/papyrus/engine/PapyrusTextAnnotationModel.java +22 -0
- package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentView.java +239 -17
- package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentViewManager.java +6 -0
- package/dist/index.d.mts +137 -1
- package/dist/index.d.ts +137 -1
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -0
- package/dist/index.mjs.map +1 -1
- package/ios/PapyrusComicDocumentView.m +200 -27
- package/ios/PapyrusNativeEngine.m +12 -0
- package/ios/PapyrusPdfDocumentView.h +3 -0
- package/ios/PapyrusPdfDocumentView.m +96 -11
- package/ios/PapyrusPdfDocumentViewManager.m +3 -0
- package/ios/PapyrusSelectionMenu.h +27 -0
- package/ios/PapyrusTextAnnotationRange.h +2 -0
- package/ios/PapyrusTextAnnotationRange.m +29 -0
- package/ios/PapyrusTextDocumentView.h +5 -0
- package/ios/PapyrusTextDocumentView.m +233 -14
- package/ios/PapyrusTextDocumentViewManager.m +5 -0
- package/package.json +7 -7
|
@@ -9,8 +9,21 @@ import android.text.Selection;
|
|
|
9
9
|
import android.text.Spannable;
|
|
10
10
|
import android.text.SpannableString;
|
|
11
11
|
import android.text.style.BackgroundColorSpan;
|
|
12
|
+
import android.text.style.CharacterStyle;
|
|
13
|
+
import android.text.style.UnderlineSpan;
|
|
14
|
+
import android.text.style.LineBackgroundSpan;
|
|
15
|
+
import android.text.TextPaint;
|
|
16
|
+
import android.graphics.Canvas;
|
|
17
|
+
import android.graphics.Paint;
|
|
18
|
+
import android.app.AlertDialog;
|
|
19
|
+
import com.facebook.react.bridge.ReadableType;
|
|
20
|
+
import java.util.HashMap;
|
|
21
|
+
import java.util.Map;
|
|
22
|
+
import android.widget.Button;
|
|
12
23
|
import android.util.TypedValue;
|
|
13
24
|
import android.view.ActionMode;
|
|
25
|
+
import android.view.GestureDetector;
|
|
26
|
+
import android.view.MotionEvent;
|
|
14
27
|
import android.view.Menu;
|
|
15
28
|
import android.view.MenuItem;
|
|
16
29
|
import android.view.View;
|
|
@@ -34,10 +47,19 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
34
47
|
private static final int EVENT_THROTTLE_MS = 100;
|
|
35
48
|
private static final int MAX_SEARCH_HIGHLIGHTS = 2000;
|
|
36
49
|
private static final int ACTION_DEFINE = 0x5041;
|
|
50
|
+
private static final int ACTION_ANNOTATE = 0x5050;
|
|
51
|
+
private static final String[] MARKUP_ACTIONS = {"highlight", "underline", "strikeout", "comment"};
|
|
37
52
|
private static final ExecutorService TEXT_LAYOUT_EXECUTOR = Executors.newSingleThreadExecutor();
|
|
38
53
|
|
|
39
54
|
private final ScrollView scrollView;
|
|
40
55
|
private final PapyrusSelectableTextView textView;
|
|
56
|
+
private final FrameLayout textContainer;
|
|
57
|
+
private final List<Button> noteButtons = new ArrayList<>();
|
|
58
|
+
private ReadableArray annotations;
|
|
59
|
+
private final Map<String, Range> resolvedAnnotationRanges = new HashMap<>();
|
|
60
|
+
private String resolvedAnnotationText = "";
|
|
61
|
+
private final Map<Button,List<String>> noteGroups = new HashMap<>();
|
|
62
|
+
private ReadableMap annotationLabels;
|
|
41
63
|
private String engineId;
|
|
42
64
|
private int documentGeneration;
|
|
43
65
|
private int expectedTextLength;
|
|
@@ -65,31 +87,47 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
65
87
|
scrollView = new ScrollView(context);
|
|
66
88
|
scrollView.setFillViewport(false);
|
|
67
89
|
scrollView.setVerticalScrollBarEnabled(true);
|
|
90
|
+
textContainer = new FrameLayout(context);
|
|
68
91
|
textView = new PapyrusSelectableTextView(context);
|
|
69
92
|
textView.setTextIsSelectable(true);
|
|
93
|
+
if (Build.VERSION.SDK_INT >= 26) textView.setTextClassifier(android.view.textclassifier.TextClassifier.NO_OP);
|
|
70
94
|
textView.setFocusable(true);
|
|
71
95
|
textView.setFocusableInTouchMode(true);
|
|
72
96
|
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize);
|
|
73
|
-
textView.setPadding(dp(pageMarginDp), dp(pageMarginDp), dp(pageMarginDp), dp(pageMarginDp));
|
|
97
|
+
textView.setPadding(dp(Math.max(44,pageMarginDp)), dp(pageMarginDp), dp(pageMarginDp), dp(pageMarginDp));
|
|
74
98
|
textView.setOnSelectionChangedListener(this::emitTextRangeSelected);
|
|
99
|
+
GestureDetector annotationTaps = new GestureDetector(context,new GestureDetector.SimpleOnGestureListener(){
|
|
100
|
+
@Override public boolean onSingleTapUp(MotionEvent event){return hitTestAnnotation(event);}
|
|
101
|
+
});
|
|
102
|
+
textView.setOnTouchListener((v,event)->annotationTaps.onTouchEvent(event));
|
|
75
103
|
textView.setCustomSelectionActionModeCallback(new ActionMode.Callback() {
|
|
76
104
|
@Override public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
|
77
|
-
|
|
105
|
+
addSelectionActions(menu);
|
|
78
106
|
return true;
|
|
79
107
|
}
|
|
80
108
|
@Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
|
|
81
|
-
|
|
109
|
+
addSelectionActions(menu);
|
|
82
110
|
return true;
|
|
83
111
|
}
|
|
84
112
|
@Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
|
85
|
-
if (item.getItemId()
|
|
86
|
-
|
|
113
|
+
if (item.getItemId() == ACTION_DEFINE) { emitDefineSelection(); }
|
|
114
|
+
else if (item.getItemId() >= ACTION_ANNOTATE && item.getItemId() < ACTION_ANNOTATE + MARKUP_ACTIONS.length) {
|
|
115
|
+
WritableMap payload = selectedPayload();
|
|
116
|
+
if (payload != null) {
|
|
117
|
+
payload.putString("style", MARKUP_ACTIONS[item.getItemId() - ACTION_ANNOTATE]);
|
|
118
|
+
emit("onAnnotateSelection", payload);
|
|
119
|
+
}
|
|
120
|
+
} else return false;
|
|
87
121
|
mode.finish();
|
|
88
122
|
return true;
|
|
89
123
|
}
|
|
90
124
|
@Override public void onDestroyActionMode(ActionMode mode) { }
|
|
91
125
|
});
|
|
92
|
-
|
|
126
|
+
textContainer.addView(textView, new FrameLayout.LayoutParams(
|
|
127
|
+
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT
|
|
128
|
+
));
|
|
129
|
+
textView.addOnLayoutChangeListener((v,l,t,r,b,ol,ot,or,ob) -> layoutNoteButtons());
|
|
130
|
+
scrollView.addView(textContainer, new ScrollView.LayoutParams(
|
|
93
131
|
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT
|
|
94
132
|
));
|
|
95
133
|
scrollView.addOnLayoutChangeListener((view, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
|
|
@@ -143,6 +181,10 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
143
181
|
scrollToTextOffset(value);
|
|
144
182
|
}
|
|
145
183
|
|
|
184
|
+
public void setTextNavigationRequest(ReadableMap request) {
|
|
185
|
+
if(request!=null && request.hasKey("offset"))scrollToTextOffset(Math.max(0,request.getInt("offset")));
|
|
186
|
+
}
|
|
187
|
+
|
|
146
188
|
public void setSearchResults(ReadableArray results) {
|
|
147
189
|
searchRanges = new ArrayList<>();
|
|
148
190
|
if (results != null) {
|
|
@@ -179,6 +221,7 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
179
221
|
public void setFontSize(float value) {
|
|
180
222
|
fontSize = Math.max(10f, Math.min(48f, value));
|
|
181
223
|
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize);
|
|
224
|
+
textView.setLineSpacing(Math.max(0f,lineHeight-fontSize),1f);
|
|
182
225
|
applySearchHighlights();
|
|
183
226
|
requestTextContentLayout();
|
|
184
227
|
}
|
|
@@ -192,7 +235,7 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
192
235
|
|
|
193
236
|
public void setPageMargin(float value) {
|
|
194
237
|
pageMarginDp = Math.round(Math.max(8f, Math.min(64f, value)));
|
|
195
|
-
textView.setPadding(dp(pageMarginDp), dp(pageMarginDp), dp(pageMarginDp), dp(pageMarginDp));
|
|
238
|
+
textView.setPadding(dp(Math.max(44,pageMarginDp)), dp(pageMarginDp), dp(pageMarginDp), dp(pageMarginDp));
|
|
196
239
|
requestTextContentLayout();
|
|
197
240
|
}
|
|
198
241
|
|
|
@@ -204,11 +247,25 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
204
247
|
defineSelectionMode = value == null ? "selection" : value;
|
|
205
248
|
}
|
|
206
249
|
|
|
207
|
-
private void
|
|
208
|
-
|
|
250
|
+
private void addSelectionActions(Menu menu) {
|
|
251
|
+
MenuItem copy = menu.findItem(android.R.id.copy);
|
|
252
|
+
if (copy != null && !labelFor("copy").isEmpty()) copy.setTitle(labelFor("copy"));
|
|
253
|
+
MenuItem selectAll = menu.findItem(android.R.id.selectAll);
|
|
254
|
+
if (selectAll != null && !labelFor("selectAll").isEmpty()) selectAll.setTitle(labelFor("selectAll"));
|
|
255
|
+
for (int i = 0; i < MARKUP_ACTIONS.length; i++) {
|
|
256
|
+
String label = labelFor(MARKUP_ACTIONS[i]);
|
|
257
|
+
if (selectedPayload() != null && !label.isEmpty() && menu.findItem(ACTION_ANNOTATE+i) == null) {
|
|
258
|
+
menu.add(Menu.NONE, ACTION_ANNOTATE+i, i, label).setIcon(new PapyrusSelectionMenuIcon(MARKUP_ACTIONS[i]));
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (selectedPayload() == null || "single-word".equals(defineSelectionMode) && !isSingleWordSelection()) {
|
|
262
|
+
menu.removeItem(ACTION_DEFINE);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
209
265
|
MenuItem item = menu.findItem(ACTION_DEFINE);
|
|
210
266
|
if (item == null) {
|
|
211
267
|
item = menu.add(Menu.NONE, ACTION_DEFINE, Menu.NONE, defineLabel);
|
|
268
|
+
item.setIcon(new PapyrusSelectionMenuIcon("define"));
|
|
212
269
|
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
|
213
270
|
} else {
|
|
214
271
|
item.setTitle(defineLabel);
|
|
@@ -222,15 +279,18 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
222
279
|
int token = ++loadToken;
|
|
223
280
|
int initialOffset = currentTextOffset;
|
|
224
281
|
if (Build.VERSION.SDK_INT >= 28) {
|
|
225
|
-
android.text.PrecomputedText.Params params =
|
|
226
|
-
.setBreakStrategy(textView.getBreakStrategy())
|
|
227
|
-
.setHyphenationFrequency(textView.getHyphenationFrequency())
|
|
228
|
-
.build();
|
|
282
|
+
android.text.PrecomputedText.Params params = textView.getTextMetricsParams();
|
|
229
283
|
TEXT_LAYOUT_EXECUTOR.execute(() -> {
|
|
230
284
|
android.text.PrecomputedText precomputed = android.text.PrecomputedText.create(text, params);
|
|
231
285
|
post(() -> {
|
|
232
286
|
if (token != loadToken || !text.equals(PapyrusTextStore.getText(engineId, documentGeneration))) return;
|
|
287
|
+
// Typography can change while the background layout is running.
|
|
288
|
+
// Recompute with current metrics instead of applying an incompatible result.
|
|
289
|
+
if (!textView.getTextMetricsParams().equals(params)) { reloadText(); return; }
|
|
233
290
|
textView.setText(precomputed, TextView.BufferType.SPANNABLE);
|
|
291
|
+
textView.setTextIsSelectable(true);
|
|
292
|
+
textView.setClickable(true);
|
|
293
|
+
textView.setLongClickable(true);
|
|
234
294
|
applySearchHighlights();
|
|
235
295
|
requestTextContentLayout();
|
|
236
296
|
textView.requestLayout();
|
|
@@ -242,7 +302,10 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
242
302
|
} else {
|
|
243
303
|
textView.post(() -> {
|
|
244
304
|
if (token != loadToken) return;
|
|
245
|
-
textView.setText(text);
|
|
305
|
+
textView.setText(text, TextView.BufferType.SPANNABLE);
|
|
306
|
+
textView.setTextIsSelectable(true);
|
|
307
|
+
textView.setClickable(true);
|
|
308
|
+
textView.setLongClickable(true);
|
|
246
309
|
applySearchHighlights();
|
|
247
310
|
requestTextContentLayout();
|
|
248
311
|
textView.requestLayout();
|
|
@@ -285,6 +348,15 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
285
348
|
textView.getLeft() + textView.getMeasuredWidth(),
|
|
286
349
|
textView.getTop() + textView.getMeasuredHeight()
|
|
287
350
|
);
|
|
351
|
+
// React Native can retain the parent's old wrap-content measurement after
|
|
352
|
+
// asynchronous PrecomputedText arrives. Resize the content container too,
|
|
353
|
+
// otherwise its clip bounds can hide every line after the first.
|
|
354
|
+
android.view.ViewGroup.LayoutParams containerParams = textContainer.getLayoutParams();
|
|
355
|
+
containerParams.height = contentHeight;
|
|
356
|
+
textContainer.setLayoutParams(containerParams);
|
|
357
|
+
textContainer.forceLayout();
|
|
358
|
+
textContainer.measure(contentWidthSpec, exactHeightSpec);
|
|
359
|
+
textContainer.layout(0, 0, contentWidth, contentHeight);
|
|
288
360
|
scrollView.requestLayout();
|
|
289
361
|
requestLayout();
|
|
290
362
|
});
|
|
@@ -295,7 +367,14 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
295
367
|
int selectionStart = textView.getSelectionStart();
|
|
296
368
|
int selectionEnd = textView.getSelectionEnd();
|
|
297
369
|
int oldScrollY = scrollView.getScrollY();
|
|
298
|
-
|
|
370
|
+
Spannable styled = textView.getText() instanceof Spannable
|
|
371
|
+
? (Spannable) textView.getText() : new SpannableString(textView.getText());
|
|
372
|
+
for (BackgroundColorSpan span : styled.getSpans(0, styled.length(), BackgroundColorSpan.class)) styled.removeSpan(span);
|
|
373
|
+
for (LineBackgroundSpan span : styled.getSpans(0, styled.length(), LineBackgroundSpan.class)) styled.removeSpan(span);
|
|
374
|
+
for (CharacterStyle span : styled.getSpans(0, styled.length(), CharacterStyle.class)) {
|
|
375
|
+
if (!(span instanceof BackgroundColorSpan)) styled.removeSpan(span);
|
|
376
|
+
}
|
|
377
|
+
applyAnnotationSpans(styled);
|
|
299
378
|
for (int i = 0; i < searchRanges.size(); i++) {
|
|
300
379
|
Range range = searchRanges.get(i);
|
|
301
380
|
int start = Math.max(0, Math.min(styled.length(), range.start));
|
|
@@ -306,7 +385,8 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
306
385
|
}
|
|
307
386
|
}
|
|
308
387
|
suppressSelectionEvents = true;
|
|
309
|
-
textView.setText(styled, TextView.BufferType.SPANNABLE);
|
|
388
|
+
if (styled != textView.getText()) textView.setText(styled, TextView.BufferType.SPANNABLE);
|
|
389
|
+
textView.invalidate();
|
|
310
390
|
if (selectionStart >= 0 && selectionEnd >= selectionStart && selectionEnd <= textView.length()) {
|
|
311
391
|
Selection.setSelection((Spannable) textView.getText(), selectionStart, selectionEnd);
|
|
312
392
|
}
|
|
@@ -314,6 +394,142 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
314
394
|
scrollView.scrollTo(scrollView.getScrollX(), oldScrollY);
|
|
315
395
|
}
|
|
316
396
|
|
|
397
|
+
public void setAnnotations(ReadableArray value) {
|
|
398
|
+
annotations = value;
|
|
399
|
+
resolvedAnnotationRanges.clear();
|
|
400
|
+
applySearchHighlights();
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
public void setAnnotationLabels(ReadableMap value) { annotationLabels = value; }
|
|
404
|
+
|
|
405
|
+
private String labelFor(String key) {
|
|
406
|
+
return annotationLabels != null && annotationLabels.hasKey(key) && !annotationLabels.isNull(key)
|
|
407
|
+
? annotationLabels.getString(key) : "";
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
private ReadableMap annotationRange(ReadableMap item) {
|
|
411
|
+
if (item.hasKey("anchor") && !item.isNull("anchor")) {
|
|
412
|
+
ReadableMap anchor = item.getMap("anchor");
|
|
413
|
+
if (anchor != null && anchor.hasKey("kind") && "text-range".equals(anchor.getString("kind"))) return anchor;
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
return item.hasKey("textRange") && !item.isNull("textRange") ? item.getMap("textRange") : null;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
private Range checkedAnnotationRange(ReadableMap item) {
|
|
420
|
+
try {
|
|
421
|
+
String id=item.getString("id");
|
|
422
|
+
CharSequence source=textView.getText();
|
|
423
|
+
if(!resolvedAnnotationText.contentEquals(source)){resolvedAnnotationText=source.toString();resolvedAnnotationRanges.clear();}
|
|
424
|
+
if(resolvedAnnotationRanges.containsKey(id))return resolvedAnnotationRanges.get(id);
|
|
425
|
+
ReadableMap range=annotationRange(item);
|
|
426
|
+
if(range==null || !range.hasKey("start") || !range.hasKey("end") || range.getType("start")!=ReadableType.Number || range.getType("end")!=ReadableType.Number)return null;
|
|
427
|
+
int start=range.getInt("start"),end=range.getInt("end");
|
|
428
|
+
Range result=null;
|
|
429
|
+
if(range.hasKey("quote") && range.getType("quote")==ReadableType.String){
|
|
430
|
+
int[] resolved=PapyrusTextAnnotationModel.resolve(resolvedAnnotationText,start,end,range.getString("quote"),range.hasKey("prefix")&&range.getType("prefix")==ReadableType.String?range.getString("prefix"):null,range.hasKey("suffix")&&range.getType("suffix")==ReadableType.String?range.getString("suffix"):null);
|
|
431
|
+
if(resolved!=null)result=new Range(resolved[0],resolved[1]);
|
|
432
|
+
} else if(start>=0 && end>start && end<=source.length())result=new Range(start,end);
|
|
433
|
+
resolvedAnnotationRanges.put(id,result);return result;
|
|
434
|
+
} catch(RuntimeException malformed) {return null;}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
private void applyAnnotationSpans(Spannable styled) {
|
|
438
|
+
for (Button button : noteButtons) textContainer.removeView(button);
|
|
439
|
+
noteButtons.clear();
|
|
440
|
+
noteIds.clear();
|
|
441
|
+
if (annotations == null) return;
|
|
442
|
+
for (int i=0; i<annotations.size(); i++) {
|
|
443
|
+
ReadableMap item = annotations.getMap(i);
|
|
444
|
+
if (item == null || !item.hasKey("id")) continue;
|
|
445
|
+
Range range = checkedAnnotationRange(item);
|
|
446
|
+
if (range == null) continue;
|
|
447
|
+
String type = item.hasKey("type") ? item.getString("type") : "";
|
|
448
|
+
String style = item.hasKey("markupStyle") && !item.isNull("markupStyle") ? item.getString("markupStyle") : type;
|
|
449
|
+
int color = 0xFFFFC928;
|
|
450
|
+
try { if (item.hasKey("color")) color = Color.parseColor(item.getString("color")); } catch (IllegalArgumentException ignored) { }
|
|
451
|
+
final int spanColor=color;
|
|
452
|
+
if ("highlight".equals(style)) {
|
|
453
|
+
double opacity = item.hasKey("opacity") ? Math.max(0,Math.min(1,item.getDouble("opacity"))) : 0.35;
|
|
454
|
+
styled.setSpan(new BackgroundColorSpan((color & 0x00FFFFFF) | ((int)(opacity*255)<<24)),range.start,range.end,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
455
|
+
} else if ("underline".equals(style)) {
|
|
456
|
+
styled.setSpan(new UnderlineSpan(){@Override public void updateDrawState(TextPaint paint){super.updateDrawState(paint);paint.underlineColor=spanColor;paint.underlineThickness=Math.max(1,paint.getTextSize()/18);}},range.start,range.end,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
457
|
+
} else if ("strikeout".equals(style)) {
|
|
458
|
+
styled.setSpan((LineBackgroundSpan)(canvas,paint,left,right,top,baseline,bottom,text,start,end,lineNumber)->{
|
|
459
|
+
if(range.end<=start || range.start>=end)return;
|
|
460
|
+
float x=left+paint.measureText(text,start,Math.max(start,range.start));
|
|
461
|
+
float width=paint.measureText(text,Math.max(start,range.start),Math.min(end,range.end));
|
|
462
|
+
int old=paint.getColor();float oldWidth=paint.getStrokeWidth();paint.setColor(spanColor);paint.setStrokeWidth(Math.max(1,paint.getTextSize()/18));
|
|
463
|
+
canvas.drawLine(x,baseline+paint.ascent()*0.4f,x+width,baseline+paint.ascent()*0.4f,paint);paint.setColor(old);paint.setStrokeWidth(oldWidth);
|
|
464
|
+
},range.start,range.end,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
465
|
+
}
|
|
466
|
+
if (item.hasKey("noteContent") || "comment".equals(type) || "text".equals(type)) {
|
|
467
|
+
final String id = item.getString("id");
|
|
468
|
+
Button button = new Button(getContext());
|
|
469
|
+
button.setText("●"); button.setTextColor(color); button.setContentDescription(labelFor("comment"));
|
|
470
|
+
button.setTag(range.start); button.setMinWidth(0); button.setMinimumWidth(0);
|
|
471
|
+
button.setPadding(0,0,0,0); button.setBackgroundColor(Color.TRANSPARENT);
|
|
472
|
+
button.setOnClickListener(v -> openAnnotationGroup(button,id));
|
|
473
|
+
noteIds.put(button,id);
|
|
474
|
+
noteButtons.add(button); textContainer.addView(button,new FrameLayout.LayoutParams(dp(44),dp(44)));
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
textView.post(this::layoutNoteButtons);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
private boolean hitTestAnnotation(MotionEvent event) {
|
|
481
|
+
if (annotations == null || textView.getLayout() == null || textView.getSelectionEnd() > textView.getSelectionStart()) return false;
|
|
482
|
+
Layout layout = textView.getLayout();
|
|
483
|
+
float x = event.getX()-textView.getPaddingLeft();
|
|
484
|
+
int y = (int)event.getY()-textView.getPaddingTop();
|
|
485
|
+
if(x<0 || y<0 || y>layout.getHeight())return false;
|
|
486
|
+
int line=layout.getLineForVertical(y);
|
|
487
|
+
if(x<layout.getLineLeft(line) || x>layout.getLineRight(line))return false;
|
|
488
|
+
int offset=layout.getOffsetForHorizontal(line,x);
|
|
489
|
+
for(int i=0;i<annotations.size();i++) {
|
|
490
|
+
ReadableMap annotation=annotations.getMap(i);if(annotation==null)continue;
|
|
491
|
+
Range range=checkedAnnotationRange(annotation);
|
|
492
|
+
if(range!=null && offset>=range.start && offset<range.end) {
|
|
493
|
+
WritableMap payload=Arguments.createMap();payload.putString("id",annotation.getString("id"));emit("onAnnotationTap",payload);return true;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
private void layoutNoteButtons() {
|
|
500
|
+
Layout layout = textView.getLayout();
|
|
501
|
+
if (layout == null) return;
|
|
502
|
+
noteGroups.clear();
|
|
503
|
+
Map<Integer,Button> leaders=new HashMap<>();
|
|
504
|
+
for (Button button : noteButtons) {
|
|
505
|
+
int start = Math.min(textView.length(),(Integer)button.getTag());
|
|
506
|
+
int line = layout.getLineForOffset(start);
|
|
507
|
+
int y=textView.getPaddingTop()+layout.getLineTop(line);
|
|
508
|
+
button.setTranslationY((y/dp(44))*dp(44));
|
|
509
|
+
int bucket=y/dp(44);Button leader=leaders.get(bucket);
|
|
510
|
+
button.setVisibility(leader==null?View.VISIBLE:View.INVISIBLE);
|
|
511
|
+
String id=(String)button.getContentDescription();
|
|
512
|
+
// Accessibility label stays localized; stable IDs live in a keyed map.
|
|
513
|
+
id=noteIds.get(button);
|
|
514
|
+
if(leader==null){leaders.put(bucket,button);leader=button;noteGroups.put(leader,new ArrayList<>());}
|
|
515
|
+
noteGroups.get(leader).add(id);
|
|
516
|
+
}
|
|
517
|
+
for(Map.Entry<Button,List<String>> entry:noteGroups.entrySet())entry.getKey().setText(entry.getValue().size()>1?String.valueOf(entry.getValue().size()):"●");
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
private final Map<Button,String> noteIds=new HashMap<>();
|
|
521
|
+
private void openAnnotationGroup(Button button,String fallback) {
|
|
522
|
+
List<String> ids=noteGroups.get(button);
|
|
523
|
+
if(ids==null || ids.size()<2){emitAnnotationTap(fallback);return;}
|
|
524
|
+
String[] titles=new String[ids.size()];
|
|
525
|
+
for(int i=0;i<ids.size();i++){
|
|
526
|
+
titles[i]=ids.get(i);
|
|
527
|
+
for(int j=0;j<annotations.size();j++){ReadableMap a=annotations.getMap(j);if(ids.get(i).equals(a.getString("id"))){titles[i]=a.hasKey("noteContent")&&!a.isNull("noteContent")?a.getString("noteContent"):a.hasKey("content")&&!a.isNull("content")?a.getString("content"):ids.get(i);break;}}
|
|
528
|
+
}
|
|
529
|
+
new AlertDialog.Builder(getContext()).setTitle(labelFor("comment")).setItems(titles,(dialog,index)->emitAnnotationTap(ids.get(index))).show();
|
|
530
|
+
}
|
|
531
|
+
private void emitAnnotationTap(String id){WritableMap event=Arguments.createMap();event.putString("id",id);emit("onAnnotationTap",event);}
|
|
532
|
+
|
|
317
533
|
private void applyTheme() {
|
|
318
534
|
int paper = Color.WHITE;
|
|
319
535
|
int foreground = Color.BLACK;
|
|
@@ -367,6 +583,12 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
367
583
|
event.putString("text", textView.getText().subSequence(start, end).toString());
|
|
368
584
|
event.putInt("start", start);
|
|
369
585
|
event.putInt("end", end);
|
|
586
|
+
int prefixStart = Math.max(0, start - 48);
|
|
587
|
+
int suffixEnd = Math.min(textView.length(), end + 48);
|
|
588
|
+
if (prefixStart > 0 && Character.isLowSurrogate(textView.getText().charAt(prefixStart))) prefixStart--;
|
|
589
|
+
if (suffixEnd < textView.length() && Character.isLowSurrogate(textView.getText().charAt(suffixEnd))) suffixEnd++;
|
|
590
|
+
event.putString("prefix", textView.getText().subSequence(prefixStart, start).toString());
|
|
591
|
+
event.putString("suffix", textView.getText().subSequence(end, suffixEnd).toString());
|
|
370
592
|
return event;
|
|
371
593
|
}
|
|
372
594
|
|
|
@@ -395,7 +617,7 @@ public final class PapyrusTextDocumentView extends FrameLayout {
|
|
|
395
617
|
|
|
396
618
|
private void emitDefineSelection() {
|
|
397
619
|
WritableMap selection = selectedPayload();
|
|
398
|
-
if (selection != null) emit("onDefineSelection", selection);
|
|
620
|
+
if (selection != null && (!"single-word".equals(defineSelectionMode) || isSingleWordSelection())) emit("onDefineSelection", selection);
|
|
399
621
|
}
|
|
400
622
|
|
|
401
623
|
private void emit(String name, WritableMap payload) {
|
|
@@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
|
|
|
4
4
|
import androidx.annotation.Nullable;
|
|
5
5
|
|
|
6
6
|
import com.facebook.react.bridge.ReadableArray;
|
|
7
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
8
|
import com.facebook.react.common.MapBuilder;
|
|
8
9
|
import com.facebook.react.uimanager.SimpleViewManager;
|
|
9
10
|
import com.facebook.react.uimanager.ThemedReactContext;
|
|
@@ -23,14 +24,19 @@ public final class PapyrusTextDocumentViewManager extends SimpleViewManager<Papy
|
|
|
23
24
|
.put("onTextOffsetChange", MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", "onTextOffsetChange")))
|
|
24
25
|
.put("onTextRangeSelected", MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", "onTextRangeSelected")))
|
|
25
26
|
.put("onDefineSelection", MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", "onDefineSelection")))
|
|
27
|
+
.put("onAnnotateSelection", MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", "onAnnotateSelection")))
|
|
28
|
+
.put("onAnnotationTap", MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", "onAnnotationTap")))
|
|
26
29
|
.build();
|
|
27
30
|
}
|
|
28
31
|
|
|
32
|
+
@ReactProp(name = "annotations") public void setAnnotations(PapyrusTextDocumentView view, ReadableArray value) { view.setAnnotations(value); }
|
|
33
|
+
@ReactProp(name = "annotationLabels") public void setAnnotationLabels(PapyrusTextDocumentView view, ReadableMap value) { view.setAnnotationLabels(value); }
|
|
29
34
|
@ReactProp(name = "engineId") public void setEngineId(PapyrusTextDocumentView view, String value) { view.setEngineId(value); }
|
|
30
35
|
@ReactProp(name = "documentGeneration", defaultInt = 0) public void setDocumentGeneration(PapyrusTextDocumentView view, int value) { view.setDocumentGeneration(value); }
|
|
31
36
|
@ReactProp(name = "textLength", defaultInt = 0) public void setTextLength(PapyrusTextDocumentView view, int value) { view.setTextLength(value); }
|
|
32
37
|
@ReactProp(name = "currentTextOffset", defaultInt = 0) public void setCurrentTextOffset(PapyrusTextDocumentView view, int value) { view.setCurrentTextOffset(value); }
|
|
33
38
|
@ReactProp(name = "scrollToTextOffsetSignal") public void setScrollToTextOffsetSignal(PapyrusTextDocumentView view, Integer value) { view.setScrollToTextOffsetSignal(value); }
|
|
39
|
+
@ReactProp(name = "textNavigationRequest") public void setTextNavigationRequest(PapyrusTextDocumentView view, ReadableMap value) {view.setTextNavigationRequest(value);}
|
|
34
40
|
@ReactProp(name = "searchResults") public void setSearchResults(PapyrusTextDocumentView view, ReadableArray value) { view.setSearchResults(value); }
|
|
35
41
|
@ReactProp(name = "activeSearchIndex", defaultInt = -1) public void setActiveSearchIndex(PapyrusTextDocumentView view, int value) { view.setActiveSearchIndex(value); }
|
|
36
42
|
@ReactProp(name = "pageTheme") public void setPageTheme(PapyrusTextDocumentView view, String value) { view.setPageTheme(value); }
|
package/dist/index.d.mts
CHANGED
|
@@ -2,13 +2,30 @@ import * as react from 'react';
|
|
|
2
2
|
import { RefAttributes, ComponentType } from 'react';
|
|
3
3
|
import { ViewProps, View } from 'react-native';
|
|
4
4
|
import { BaseDocumentEngine } from '@papyrus-sdk/core';
|
|
5
|
-
import { RenderTargetType, DocumentLoadInput, RenderPageTelemetryContext, TextItem, SearchResult, TextSearchResult, TextSelectionEndpoints, TextSelection, OutlineItem, PageDestination, ComicFormat, RenderPageResult, PageTheme,
|
|
5
|
+
import { RenderTargetType, Annotation, DocumentLoadInput, RenderPageTelemetryContext, TextItem, SearchResult, TextSearchResult, TextSelectionEndpoints, TextSelection, OutlineItem, PageDestination, ComicFormat, RenderPageResult, PageTheme, PdfVisiblePage, InkStrokeCommit, ComicLayoutMode, ComicFitMode, ComicReadingDirection, TextRangeSelection } from '@papyrus-sdk/types';
|
|
6
6
|
|
|
7
7
|
type PapyrusPageViewProps = ViewProps & {
|
|
8
8
|
engineId?: string;
|
|
9
9
|
pageTheme?: PageTheme;
|
|
10
10
|
};
|
|
11
11
|
type PapyrusPdfViewerViewProps = ViewProps & {
|
|
12
|
+
annotationLabels?: Record<string, string>;
|
|
13
|
+
defineEnabled?: boolean;
|
|
14
|
+
copyLabel?: string;
|
|
15
|
+
selectAllLabel?: string;
|
|
16
|
+
onAnnotateSelection?: (event: {
|
|
17
|
+
nativeEvent: {
|
|
18
|
+
text: string;
|
|
19
|
+
pageIndex: number;
|
|
20
|
+
rects: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}[];
|
|
26
|
+
style: "highlight" | "underline" | "strikeout" | "comment";
|
|
27
|
+
};
|
|
28
|
+
}) => void;
|
|
12
29
|
engineId?: string;
|
|
13
30
|
pageTheme?: PageTheme;
|
|
14
31
|
zoom?: number;
|
|
@@ -22,6 +39,16 @@ type PapyrusPdfViewerViewProps = ViewProps & {
|
|
|
22
39
|
searchResults?: SearchResult[];
|
|
23
40
|
activeSearchIndex?: number;
|
|
24
41
|
annotations?: Annotation[];
|
|
42
|
+
annotationNavigationRequest?: {
|
|
43
|
+
pageIndex: number;
|
|
44
|
+
rect: {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
};
|
|
50
|
+
nonce: number;
|
|
51
|
+
} | null;
|
|
25
52
|
selectedAnnotationId?: string | null;
|
|
26
53
|
onPageChanged?: (event: {
|
|
27
54
|
nativeEvent: {
|
|
@@ -121,11 +148,29 @@ type PapyrusPdfViewerViewProps = ViewProps & {
|
|
|
121
148
|
viewMode?: "continuous" | "single";
|
|
122
149
|
};
|
|
123
150
|
type PapyrusTextDocumentViewProps = ViewProps & {
|
|
151
|
+
annotations?: Annotation[];
|
|
152
|
+
annotationLabels?: Record<string, string>;
|
|
153
|
+
onAnnotateSelection?: (event: {
|
|
154
|
+
nativeEvent: TextRangeSelection & {
|
|
155
|
+
style: "highlight" | "underline" | "strikeout" | "comment";
|
|
156
|
+
prefix?: string;
|
|
157
|
+
suffix?: string;
|
|
158
|
+
};
|
|
159
|
+
}) => void;
|
|
160
|
+
onAnnotationTap?: (event: {
|
|
161
|
+
nativeEvent: {
|
|
162
|
+
id: string;
|
|
163
|
+
};
|
|
164
|
+
}) => void;
|
|
124
165
|
engineId?: string;
|
|
125
166
|
documentGeneration?: number;
|
|
126
167
|
textLength?: number;
|
|
127
168
|
currentTextOffset?: number;
|
|
128
169
|
scrollToTextOffsetSignal?: number | null;
|
|
170
|
+
textNavigationRequest?: {
|
|
171
|
+
offset: number;
|
|
172
|
+
nonce: number;
|
|
173
|
+
} | null;
|
|
129
174
|
searchResults?: TextSearchResult[];
|
|
130
175
|
activeSearchIndex?: number;
|
|
131
176
|
pageTheme?: PageTheme;
|
|
@@ -191,6 +236,23 @@ declare const PapyrusPdfDocumentView: PapyrusPdfViewerViewComponent;
|
|
|
191
236
|
declare const isPapyrusTextDocumentViewAvailable: () => boolean;
|
|
192
237
|
declare const isPapyrusComicDocumentViewAvailable: () => boolean;
|
|
193
238
|
declare const PapyrusTextDocumentView: react.FunctionComponent<ViewProps & {
|
|
239
|
+
annotationLabels?: Record<string, string>;
|
|
240
|
+
defineEnabled?: boolean;
|
|
241
|
+
copyLabel?: string;
|
|
242
|
+
selectAllLabel?: string;
|
|
243
|
+
onAnnotateSelection?: (event: {
|
|
244
|
+
nativeEvent: {
|
|
245
|
+
text: string;
|
|
246
|
+
pageIndex: number;
|
|
247
|
+
rects: {
|
|
248
|
+
x: number;
|
|
249
|
+
y: number;
|
|
250
|
+
width: number;
|
|
251
|
+
height: number;
|
|
252
|
+
}[];
|
|
253
|
+
style: "highlight" | "underline" | "strikeout" | "comment";
|
|
254
|
+
};
|
|
255
|
+
}) => void;
|
|
194
256
|
engineId?: string;
|
|
195
257
|
pageTheme?: PageTheme;
|
|
196
258
|
zoom?: number;
|
|
@@ -204,6 +266,16 @@ declare const PapyrusTextDocumentView: react.FunctionComponent<ViewProps & {
|
|
|
204
266
|
searchResults?: SearchResult[];
|
|
205
267
|
activeSearchIndex?: number;
|
|
206
268
|
annotations?: Annotation[];
|
|
269
|
+
annotationNavigationRequest?: {
|
|
270
|
+
pageIndex: number;
|
|
271
|
+
rect: {
|
|
272
|
+
x: number;
|
|
273
|
+
y: number;
|
|
274
|
+
width: number;
|
|
275
|
+
height: number;
|
|
276
|
+
};
|
|
277
|
+
nonce: number;
|
|
278
|
+
} | null;
|
|
207
279
|
selectedAnnotationId?: string | null;
|
|
208
280
|
onPageChanged?: (event: {
|
|
209
281
|
nativeEvent: {
|
|
@@ -302,11 +374,29 @@ declare const PapyrusTextDocumentView: react.FunctionComponent<ViewProps & {
|
|
|
302
374
|
annotationDeleteLabel?: string;
|
|
303
375
|
viewMode?: "continuous" | "single";
|
|
304
376
|
} & RefAttributes<View>> | ComponentType<ViewProps & {
|
|
377
|
+
annotations?: Annotation[];
|
|
378
|
+
annotationLabels?: Record<string, string>;
|
|
379
|
+
onAnnotateSelection?: (event: {
|
|
380
|
+
nativeEvent: TextRangeSelection & {
|
|
381
|
+
style: "highlight" | "underline" | "strikeout" | "comment";
|
|
382
|
+
prefix?: string;
|
|
383
|
+
suffix?: string;
|
|
384
|
+
};
|
|
385
|
+
}) => void;
|
|
386
|
+
onAnnotationTap?: (event: {
|
|
387
|
+
nativeEvent: {
|
|
388
|
+
id: string;
|
|
389
|
+
};
|
|
390
|
+
}) => void;
|
|
305
391
|
engineId?: string;
|
|
306
392
|
documentGeneration?: number;
|
|
307
393
|
textLength?: number;
|
|
308
394
|
currentTextOffset?: number;
|
|
309
395
|
scrollToTextOffsetSignal?: number | null;
|
|
396
|
+
textNavigationRequest?: {
|
|
397
|
+
offset: number;
|
|
398
|
+
nonce: number;
|
|
399
|
+
} | null;
|
|
310
400
|
searchResults?: TextSearchResult[];
|
|
311
401
|
activeSearchIndex?: number;
|
|
312
402
|
pageTheme?: PageTheme;
|
|
@@ -337,6 +427,23 @@ declare const PapyrusTextDocumentView: react.FunctionComponent<ViewProps & {
|
|
|
337
427
|
}) => void;
|
|
338
428
|
} & RefAttributes<unknown>>;
|
|
339
429
|
declare const PapyrusComicDocumentView: react.FunctionComponent<ViewProps & {
|
|
430
|
+
annotationLabels?: Record<string, string>;
|
|
431
|
+
defineEnabled?: boolean;
|
|
432
|
+
copyLabel?: string;
|
|
433
|
+
selectAllLabel?: string;
|
|
434
|
+
onAnnotateSelection?: (event: {
|
|
435
|
+
nativeEvent: {
|
|
436
|
+
text: string;
|
|
437
|
+
pageIndex: number;
|
|
438
|
+
rects: {
|
|
439
|
+
x: number;
|
|
440
|
+
y: number;
|
|
441
|
+
width: number;
|
|
442
|
+
height: number;
|
|
443
|
+
}[];
|
|
444
|
+
style: "highlight" | "underline" | "strikeout" | "comment";
|
|
445
|
+
};
|
|
446
|
+
}) => void;
|
|
340
447
|
engineId?: string;
|
|
341
448
|
pageTheme?: PageTheme;
|
|
342
449
|
zoom?: number;
|
|
@@ -350,6 +457,16 @@ declare const PapyrusComicDocumentView: react.FunctionComponent<ViewProps & {
|
|
|
350
457
|
searchResults?: SearchResult[];
|
|
351
458
|
activeSearchIndex?: number;
|
|
352
459
|
annotations?: Annotation[];
|
|
460
|
+
annotationNavigationRequest?: {
|
|
461
|
+
pageIndex: number;
|
|
462
|
+
rect: {
|
|
463
|
+
x: number;
|
|
464
|
+
y: number;
|
|
465
|
+
width: number;
|
|
466
|
+
height: number;
|
|
467
|
+
};
|
|
468
|
+
nonce: number;
|
|
469
|
+
} | null;
|
|
353
470
|
selectedAnnotationId?: string | null;
|
|
354
471
|
onPageChanged?: (event: {
|
|
355
472
|
nativeEvent: {
|
|
@@ -529,6 +646,10 @@ declare class NativeTextDocumentEngine extends BaseDocumentEngine {
|
|
|
529
646
|
getTextLength(): number;
|
|
530
647
|
getCurrentTextOffset(): number;
|
|
531
648
|
goToTextOffset(offset: number): void;
|
|
649
|
+
resolveAnnotationTextRange(annotation: Annotation): Promise<{
|
|
650
|
+
start: number;
|
|
651
|
+
end: number;
|
|
652
|
+
} | null>;
|
|
532
653
|
getTextRange(start: number, end: number): Promise<string>;
|
|
533
654
|
searchTextRanges(query: string): Promise<TextSearchResult[]>;
|
|
534
655
|
getRenderTargetType(): RenderTargetType;
|
|
@@ -600,6 +721,12 @@ type MobileDocumentEngineOptions = {
|
|
|
600
721
|
webViewRuntimeConfig?: WebViewRuntimeConfig;
|
|
601
722
|
};
|
|
602
723
|
declare class WebViewDocumentEngine extends BaseDocumentEngine {
|
|
724
|
+
private documentSessionId;
|
|
725
|
+
getWebViewDocumentSessionId(): string;
|
|
726
|
+
syncEpubAnnotations(annotations: Annotation[], documentId?: string, labels?: {
|
|
727
|
+
comment: string;
|
|
728
|
+
}): Promise<void>;
|
|
729
|
+
goToAnnotation(annotation: Annotation): Promise<void>;
|
|
603
730
|
private readonly webViewRuntimeSource?;
|
|
604
731
|
private readonly webViewRuntimeConfig?;
|
|
605
732
|
private bridge;
|
|
@@ -680,6 +807,15 @@ declare class MobileDocumentEngine extends BaseDocumentEngine {
|
|
|
680
807
|
getCurrentTextOffset(): number;
|
|
681
808
|
goToTextOffset(offset: number): void;
|
|
682
809
|
getLifecycleStats(): Record<string, number>;
|
|
810
|
+
resolveAnnotationTextRange(annotation: Annotation): Promise<{
|
|
811
|
+
start: number;
|
|
812
|
+
end: number;
|
|
813
|
+
} | null>;
|
|
814
|
+
getWebViewDocumentSessionId(): string;
|
|
815
|
+
syncEpubAnnotations(annotations: Annotation[], documentId?: string, labels?: {
|
|
816
|
+
comment: string;
|
|
817
|
+
}): Promise<void>;
|
|
818
|
+
goToAnnotation(annotation: Annotation): void | Promise<void>;
|
|
683
819
|
attachWebView(bridge: WebViewBridge): void;
|
|
684
820
|
detachWebView(): void;
|
|
685
821
|
handleWebViewMessage(data: string): void;
|