@apollohg/react-native-prose-editor 0.5.7 → 0.5.8
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/java/com/apollohg/editor/EditorEditText.kt +1 -1
- package/android/src/main/java/com/apollohg/editor/EditorTheme.kt +2 -0
- package/android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt +13 -2
- package/dist/EditorTheme.d.ts +1 -0
- package/ios/EditorCore.xcframework/ios-arm64/libeditor_core.a +0 -0
- package/ios/EditorCore.xcframework/ios-arm64_x86_64-simulator/libeditor_core.a +0 -0
- package/ios/EditorTheme.swift +2 -0
- package/ios/RichTextEditorView.swift +1 -0
- package/package.json +1 -1
- package/rust/android/arm64-v8a/libeditor_core.so +0 -0
- package/rust/android/armeabi-v7a/libeditor_core.so +0 -0
- package/rust/android/x86_64/libeditor_core.so +0 -0
|
@@ -339,7 +339,7 @@ class EditorEditText @JvmOverloads constructor(
|
|
|
339
339
|
val resolvedTypeface = resolvePlaceholderTypeface(textStyle)
|
|
340
340
|
|
|
341
341
|
return TextPaint(paint).apply {
|
|
342
|
-
color = currentHintTextColor
|
|
342
|
+
color = theme?.placeholderColor ?: currentHintTextColor
|
|
343
343
|
textSize = resolvedTextSize
|
|
344
344
|
typeface = resolvedTypeface
|
|
345
345
|
}
|
|
@@ -304,6 +304,7 @@ data class EditorTheme(
|
|
|
304
304
|
val mentions: EditorMentionTheme? = null,
|
|
305
305
|
val links: EditorLinkTheme? = null,
|
|
306
306
|
val toolbar: EditorToolbarTheme? = null,
|
|
307
|
+
val placeholderColor: Int? = null,
|
|
307
308
|
val backgroundColor: Int? = null,
|
|
308
309
|
val borderRadius: Float? = null,
|
|
309
310
|
val contentInsets: EditorContentInsets? = null
|
|
@@ -335,6 +336,7 @@ data class EditorTheme(
|
|
|
335
336
|
mentions = EditorMentionTheme.fromJson(root.optJSONObject("mentions")),
|
|
336
337
|
links = EditorLinkTheme.fromJson(root.optJSONObject("links")),
|
|
337
338
|
toolbar = EditorToolbarTheme.fromJson(root.optJSONObject("toolbar")),
|
|
339
|
+
placeholderColor = parseColor(root.optNullableString("placeholderColor")),
|
|
338
340
|
backgroundColor = parseColor(root.optNullableString("backgroundColor")),
|
|
339
341
|
borderRadius = root.optNullableFloat("borderRadius"),
|
|
340
342
|
contentInsets = EditorContentInsets.fromJson(root.optJSONObject("contentInsets"))
|
|
@@ -405,8 +405,19 @@ class NativeEditorExpoView(
|
|
|
405
405
|
return false
|
|
406
406
|
}
|
|
407
407
|
val toolbarFrame = toolbarFrameInWindow
|
|
408
|
-
if (toolbarFrame != null
|
|
409
|
-
|
|
408
|
+
if (toolbarFrame != null) {
|
|
409
|
+
// toolbarFrame is in DP (from React Native's measureInWindow),
|
|
410
|
+
// but rawX/rawY are in pixels — convert before comparing.
|
|
411
|
+
val density = resources.displayMetrics.density
|
|
412
|
+
val frameInPx = RectF(
|
|
413
|
+
toolbarFrame.left * density,
|
|
414
|
+
toolbarFrame.top * density,
|
|
415
|
+
toolbarFrame.right * density,
|
|
416
|
+
toolbarFrame.bottom * density
|
|
417
|
+
)
|
|
418
|
+
if (frameInPx.contains(event.rawX, event.rawY)) {
|
|
419
|
+
return false
|
|
420
|
+
}
|
|
410
421
|
}
|
|
411
422
|
val rect = Rect()
|
|
412
423
|
richTextView.editorEditText.getGlobalVisibleRect(rect)
|
package/dist/EditorTheme.d.ts
CHANGED
|
Binary file
|
|
Binary file
|
package/ios/EditorTheme.swift
CHANGED
|
@@ -299,6 +299,7 @@ struct EditorTheme {
|
|
|
299
299
|
var mentions: EditorMentionTheme?
|
|
300
300
|
var links: EditorLinkTheme?
|
|
301
301
|
var toolbar: EditorToolbarTheme?
|
|
302
|
+
var placeholderColor: UIColor?
|
|
302
303
|
var backgroundColor: UIColor?
|
|
303
304
|
var borderRadius: CGFloat?
|
|
304
305
|
var contentInsets: EditorContentInsets?
|
|
@@ -345,6 +346,7 @@ struct EditorTheme {
|
|
|
345
346
|
if let toolbar = dictionary["toolbar"] as? [String: Any] {
|
|
346
347
|
self.toolbar = EditorToolbarTheme(dictionary: toolbar)
|
|
347
348
|
}
|
|
349
|
+
placeholderColor = EditorTheme.color(from: dictionary["placeholderColor"])
|
|
348
350
|
backgroundColor = EditorTheme.color(from: dictionary["backgroundColor"])
|
|
349
351
|
borderRadius = EditorTheme.cgFloat(dictionary["borderRadius"])
|
|
350
352
|
if let contentInsets = dictionary["contentInsets"] as? [String: Any] {
|
|
@@ -865,6 +865,7 @@ final class EditorTextView: UITextView, UITextViewDelegate, UIGestureRecognizerD
|
|
|
865
865
|
didSet {
|
|
866
866
|
renderAppearanceRevision &+= 1
|
|
867
867
|
placeholderLabel.font = resolvedDefaultFont()
|
|
868
|
+
placeholderLabel.textColor = theme?.placeholderColor ?? .placeholderText
|
|
868
869
|
backgroundColor = theme?.backgroundColor ?? baseBackgroundColor
|
|
869
870
|
if let contentInsets = theme?.contentInsets {
|
|
870
871
|
textContainerInset = UIEdgeInsets(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apollohg/react-native-prose-editor",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"description": "Native rich text editor with Rust core for React Native",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/apollohg/react-native-prose-editor",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|