@openeditor/react-native-prose-editor 0.0.9 → 0.0.10
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/README.md +5 -9
- package/android/src/main/java/com/apollohg/editor/EditorTheme.kt +23 -0
- package/android/src/main/java/com/apollohg/editor/ImageResizeOverlayView.kt +2 -2
- package/android/src/main/java/com/apollohg/editor/NativeBlockEditorSurface.kt +381 -49
- package/android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt +110 -169
- package/android/src/main/java/com/apollohg/editor/NativeEditorModule.kt +1 -1
- package/android/src/main/java/com/apollohg/editor/RichTextEditorView.kt +124 -337
- package/dist/EditorTheme.d.ts +8 -0
- package/ios/NativeBlockEditorSurface.swift +268 -58
- package/ios/NativeEditorExpoView.swift +114 -117
- package/ios/NativeInputSupport.swift +0 -302
- package/ios/PositionBridge.swift +22 -548
- package/ios/RichTextEditorView.swift +217 -4671
- package/package.json +1 -1
- package/android/src/main/java/com/apollohg/editor/CaretGeometry.kt +0 -50
- package/android/src/main/java/com/apollohg/editor/EditorEditText.kt +0 -4068
- package/android/src/main/java/com/apollohg/editor/EditorInputConnection.kt +0 -1009
- package/android/src/main/java/com/apollohg/editor/InputSnapshotSupport.kt +0 -6
package/README.md
CHANGED
|
@@ -153,10 +153,9 @@ Tests:
|
|
|
153
153
|
npm test # TypeScript unit tests
|
|
154
154
|
cargo test --manifest-path rust/editor-core/Cargo.toml # Rust core tests
|
|
155
155
|
npm run android:test # Android Robolectric tests
|
|
156
|
-
npm run android:test:
|
|
157
|
-
npm run
|
|
158
|
-
npm run ios:test:
|
|
159
|
-
npm run ios:test:perf:device # iOS on-device perf XCTest suite
|
|
156
|
+
npm run android:test:device # Android device integration tests
|
|
157
|
+
npm run ios:test # iOS simulator integration tests
|
|
158
|
+
npm run ios:test:device # iOS device integration tests
|
|
160
159
|
```
|
|
161
160
|
|
|
162
161
|
Benchmarks:
|
|
@@ -165,15 +164,12 @@ Benchmarks:
|
|
|
165
164
|
npm run bench:rust -- --quick
|
|
166
165
|
npm run bench:rust -- --filter collaboration
|
|
167
166
|
npm run bench:rust -- --json > perf-results.json
|
|
168
|
-
npm run android:test:perf
|
|
169
|
-
npm run android:test:perf:device
|
|
170
|
-
npm run ios:test:perf
|
|
171
|
-
npm run ios:test:perf:device
|
|
172
167
|
```
|
|
173
168
|
|
|
174
169
|
## Documentation
|
|
175
170
|
|
|
176
|
-
|
|
171
|
+
The native ownership rules are normative and documented in
|
|
172
|
+
[`docs/native-editor-architecture.md`](../../docs/native-editor-architecture.md).
|
|
177
173
|
|
|
178
174
|
## Project Status
|
|
179
175
|
|
|
@@ -133,6 +133,27 @@ data class EditorCodeBlockTheme(
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
data class EditorTableTheme(
|
|
137
|
+
val cellBackgroundColor: Int? = null,
|
|
138
|
+
val headerBackgroundColor: Int? = null,
|
|
139
|
+
val borderColor: Int? = null,
|
|
140
|
+
val selectionBackgroundColor: Int? = null,
|
|
141
|
+
val selectionBorderColor: Int? = null
|
|
142
|
+
) {
|
|
143
|
+
companion object {
|
|
144
|
+
fun fromJson(json: JSONObject?): EditorTableTheme? {
|
|
145
|
+
json ?: return null
|
|
146
|
+
return EditorTableTheme(
|
|
147
|
+
cellBackgroundColor = parseColor(json.optNullableString("cellBackgroundColor")),
|
|
148
|
+
headerBackgroundColor = parseColor(json.optNullableString("headerBackgroundColor")),
|
|
149
|
+
borderColor = parseColor(json.optNullableString("borderColor")),
|
|
150
|
+
selectionBackgroundColor = parseColor(json.optNullableString("selectionBackgroundColor")),
|
|
151
|
+
selectionBorderColor = parseColor(json.optNullableString("selectionBorderColor"))
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
136
157
|
data class EditorLinkTheme(
|
|
137
158
|
val fontFamily: String? = null,
|
|
138
159
|
val fontSize: Float? = null,
|
|
@@ -322,6 +343,7 @@ data class EditorTheme(
|
|
|
322
343
|
val paragraph: EditorTextStyle? = null,
|
|
323
344
|
val blockquote: EditorBlockquoteTheme? = null,
|
|
324
345
|
val codeBlock: EditorCodeBlockTheme? = null,
|
|
346
|
+
val table: EditorTableTheme? = null,
|
|
325
347
|
val headings: Map<String, EditorTextStyle> = emptyMap(),
|
|
326
348
|
val list: EditorListTheme? = null,
|
|
327
349
|
val horizontalRule: EditorHorizontalRuleTheme? = null,
|
|
@@ -355,6 +377,7 @@ data class EditorTheme(
|
|
|
355
377
|
paragraph = EditorTextStyle.fromJson(root.optJSONObject("paragraph")),
|
|
356
378
|
blockquote = EditorBlockquoteTheme.fromJson(root.optJSONObject("blockquote")),
|
|
357
379
|
codeBlock = EditorCodeBlockTheme.fromJson(root.optJSONObject("codeBlock")),
|
|
380
|
+
table = EditorTableTheme.fromJson(root.optJSONObject("table")),
|
|
358
381
|
headings = headings,
|
|
359
382
|
list = EditorListTheme.fromJson(root.optJSONObject("list")),
|
|
360
383
|
horizontalRule = EditorHorizontalRuleTheme.fromJson(root.optJSONObject("horizontalRule")),
|
|
@@ -31,7 +31,7 @@ internal class ImageResizeOverlayView @JvmOverloads constructor(
|
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
private var editorView: RichTextEditorView? = null
|
|
34
|
-
private var currentGeometry:
|
|
34
|
+
private var currentGeometry: SelectedImageGeometry? = null
|
|
35
35
|
private var dragState: DragState? = null
|
|
36
36
|
|
|
37
37
|
private val density = resources.displayMetrics.density
|
|
@@ -116,7 +116,7 @@ internal class ImageResizeOverlayView @JvmOverloads constructor(
|
|
|
116
116
|
maximumWidthPx = state.maximumWidthPx
|
|
117
117
|
)
|
|
118
118
|
state.previewRect = RectF(nextRect)
|
|
119
|
-
currentGeometry =
|
|
119
|
+
currentGeometry = SelectedImageGeometry(state.docPos, nextRect)
|
|
120
120
|
invalidate()
|
|
121
121
|
return true
|
|
122
122
|
}
|