@apollohg/react-native-prose-editor 0.3.0 → 0.4.1

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.
Files changed (37) hide show
  1. package/README.md +18 -0
  2. package/android/build.gradle +23 -0
  3. package/android/src/main/java/com/apollohg/editor/EditorEditText.kt +515 -39
  4. package/android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt +58 -28
  5. package/android/src/main/java/com/apollohg/editor/NativeEditorModule.kt +25 -0
  6. package/android/src/main/java/com/apollohg/editor/NativeToolbar.kt +232 -62
  7. package/android/src/main/java/com/apollohg/editor/PositionBridge.kt +57 -27
  8. package/android/src/main/java/com/apollohg/editor/RemoteSelectionOverlayView.kt +147 -78
  9. package/android/src/main/java/com/apollohg/editor/RenderBridge.kt +249 -71
  10. package/android/src/main/java/com/apollohg/editor/RichTextEditorView.kt +7 -6
  11. package/dist/EditorToolbar.d.ts +26 -6
  12. package/dist/EditorToolbar.js +299 -65
  13. package/dist/NativeEditorBridge.d.ts +40 -1
  14. package/dist/NativeEditorBridge.js +184 -90
  15. package/dist/NativeRichTextEditor.d.ts +5 -1
  16. package/dist/NativeRichTextEditor.js +201 -78
  17. package/dist/YjsCollaboration.d.ts +2 -0
  18. package/dist/YjsCollaboration.js +142 -20
  19. package/dist/index.d.ts +1 -1
  20. package/dist/schemas.js +12 -0
  21. package/dist/useNativeEditor.d.ts +2 -0
  22. package/dist/useNativeEditor.js +7 -0
  23. package/ios/EditorCore.xcframework/ios-arm64/libeditor_core.a +0 -0
  24. package/ios/EditorCore.xcframework/ios-arm64_x86_64-simulator/libeditor_core.a +0 -0
  25. package/ios/EditorLayoutManager.swift +3 -3
  26. package/ios/Generated_editor_core.swift +87 -0
  27. package/ios/NativeEditorExpoView.swift +488 -178
  28. package/ios/NativeEditorModule.swift +25 -0
  29. package/ios/PositionBridge.swift +310 -75
  30. package/ios/RenderBridge.swift +362 -27
  31. package/ios/RichTextEditorView.swift +2001 -189
  32. package/ios/editor_coreFFI/editor_coreFFI.h +55 -0
  33. package/package.json +11 -2
  34. package/rust/android/arm64-v8a/libeditor_core.so +0 -0
  35. package/rust/android/armeabi-v7a/libeditor_core.so +0 -0
  36. package/rust/android/x86_64/libeditor_core.so +0 -0
  37. package/rust/bindings/kotlin/uniffi/editor_core/editor_core.kt +128 -0
package/README.md CHANGED
@@ -117,6 +117,8 @@ Common commands:
117
117
 
118
118
  ```sh
119
119
  npm run typecheck
120
+ npm run bench:rust -- --quick
121
+ npm run publish:prepare
120
122
  npm run example:start
121
123
  npm run example:ios
122
124
  npm run example:android
@@ -129,6 +131,22 @@ Tests:
129
131
  npm test # TypeScript unit tests
130
132
  cargo test --manifest-path rust/editor-core/Cargo.toml # Rust core tests
131
133
  npm run android:test # Android Robolectric tests
134
+ npm run android:test:perf # Android native perf test suite
135
+ npm run android:test:perf:device # Android on-device perf instrumentation suite
136
+ npm run ios:test:perf # iOS native perf XCTest suite
137
+ npm run ios:test:perf:device # iOS on-device perf XCTest suite
138
+ ```
139
+
140
+ Benchmarks:
141
+
142
+ ```sh
143
+ npm run bench:rust -- --quick
144
+ npm run bench:rust -- --filter collaboration
145
+ npm run bench:rust -- --json > perf-results.json
146
+ npm run android:test:perf
147
+ npm run android:test:perf:device
148
+ npm run ios:test:perf
149
+ npm run ios:test:perf:device
132
150
  ```
133
151
 
134
152
  ## Documentation
@@ -14,10 +14,19 @@ android {
14
14
  namespace "com.apollohg.editor"
15
15
  testOptions {
16
16
  unitTests.includeAndroidResources = true
17
+ unitTests.all { test ->
18
+ if (project.findProperty("apollohgShowPerfTestOutput") == "true") {
19
+ test.testLogging {
20
+ events "passed", "failed"
21
+ showStandardStreams = true
22
+ }
23
+ }
24
+ }
17
25
  }
18
26
  defaultConfig {
19
27
  versionCode 1
20
28
  versionName packageJson.version
29
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
21
30
  }
22
31
 
23
32
  // Include prebuilt Rust .so files from the package's rust/android/ directory
@@ -31,6 +40,16 @@ android {
31
40
  "${project.projectDir}/../rust/bindings/kotlin"
32
41
  ]
33
42
  }
43
+ test {
44
+ java.srcDirs += [
45
+ "${project.projectDir}/src/sharedTest/java"
46
+ ]
47
+ }
48
+ androidTest {
49
+ java.srcDirs += [
50
+ "${project.projectDir}/src/sharedTest/java"
51
+ ]
52
+ }
34
53
  }
35
54
  }
36
55
 
@@ -41,4 +60,8 @@ dependencies {
41
60
 
42
61
  testImplementation "junit:junit:4.13.2"
43
62
  testImplementation "org.robolectric:robolectric:4.14.1"
63
+
64
+ androidTestImplementation "androidx.test:core-ktx:1.6.1"
65
+ androidTestImplementation "androidx.test:runner:1.6.2"
66
+ androidTestImplementation "androidx.test.ext:junit:1.2.1"
44
67
  }