@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
@@ -337,6 +337,11 @@ uint64_t uniffi_editor_core_fn_func_editor_create(RustBuffer config_json, RustCa
337
337
  RustBuffer uniffi_editor_core_fn_func_editor_delete_and_split_scalar(uint64_t id, uint32_t scalar_from, uint32_t scalar_to, RustCallStatus *_Nonnull out_status
338
338
  );
339
339
  #endif
340
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_DELETE_BACKWARD_AT_SELECTION_SCALAR
341
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_DELETE_BACKWARD_AT_SELECTION_SCALAR
342
+ RustBuffer uniffi_editor_core_fn_func_editor_delete_backward_at_selection_scalar(uint64_t id, uint32_t scalar_anchor, uint32_t scalar_head, RustCallStatus *_Nonnull out_status
343
+ );
344
+ #endif
340
345
  #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_DELETE_RANGE
341
346
  #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_DELETE_RANGE
342
347
  RustBuffer uniffi_editor_core_fn_func_editor_delete_range(uint64_t id, uint32_t from, uint32_t to, RustCallStatus *_Nonnull out_status
@@ -357,6 +362,11 @@ void uniffi_editor_core_fn_func_editor_destroy(uint64_t id, RustCallStatus *_Non
357
362
  uint32_t uniffi_editor_core_fn_func_editor_doc_to_scalar(uint64_t id, uint32_t doc_pos, RustCallStatus *_Nonnull out_status
358
363
  );
359
364
  #endif
365
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_GET_CONTENT_SNAPSHOT
366
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_GET_CONTENT_SNAPSHOT
367
+ RustBuffer uniffi_editor_core_fn_func_editor_get_content_snapshot(uint64_t id, RustCallStatus *_Nonnull out_status
368
+ );
369
+ #endif
360
370
  #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_GET_CURRENT_STATE
361
371
  #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_GET_CURRENT_STATE
362
372
  RustBuffer uniffi_editor_core_fn_func_editor_get_current_state(uint64_t id, RustCallStatus *_Nonnull out_status
@@ -377,6 +387,11 @@ RustBuffer uniffi_editor_core_fn_func_editor_get_json(uint64_t id, RustCallStatu
377
387
  RustBuffer uniffi_editor_core_fn_func_editor_get_selection(uint64_t id, RustCallStatus *_Nonnull out_status
378
388
  );
379
389
  #endif
390
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_GET_SELECTION_STATE
391
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_GET_SELECTION_STATE
392
+ RustBuffer uniffi_editor_core_fn_func_editor_get_selection_state(uint64_t id, RustCallStatus *_Nonnull out_status
393
+ );
394
+ #endif
380
395
  #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_INDENT_LIST_ITEM
381
396
  #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_INDENT_LIST_ITEM
382
397
  RustBuffer uniffi_editor_core_fn_func_editor_indent_list_item(uint64_t id, RustCallStatus *_Nonnull out_status
@@ -517,6 +532,16 @@ RustBuffer uniffi_editor_core_fn_func_editor_toggle_blockquote(uint64_t id, Rust
517
532
  RustBuffer uniffi_editor_core_fn_func_editor_toggle_blockquote_at_selection_scalar(uint64_t id, uint32_t scalar_anchor, uint32_t scalar_head, RustCallStatus *_Nonnull out_status
518
533
  );
519
534
  #endif
535
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_TOGGLE_HEADING
536
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_TOGGLE_HEADING
537
+ RustBuffer uniffi_editor_core_fn_func_editor_toggle_heading(uint64_t id, uint8_t level, RustCallStatus *_Nonnull out_status
538
+ );
539
+ #endif
540
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_TOGGLE_HEADING_AT_SELECTION_SCALAR
541
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_TOGGLE_HEADING_AT_SELECTION_SCALAR
542
+ RustBuffer uniffi_editor_core_fn_func_editor_toggle_heading_at_selection_scalar(uint64_t id, uint32_t scalar_anchor, uint32_t scalar_head, uint8_t level, RustCallStatus *_Nonnull out_status
543
+ );
544
+ #endif
520
545
  #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_TOGGLE_MARK
521
546
  #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_FN_FUNC_EDITOR_TOGGLE_MARK
522
547
  RustBuffer uniffi_editor_core_fn_func_editor_toggle_mark(uint64_t id, RustBuffer mark_name, RustCallStatus *_Nonnull out_status
@@ -942,6 +967,12 @@ uint16_t uniffi_editor_core_checksum_func_editor_create(void
942
967
  #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_DELETE_AND_SPLIT_SCALAR
943
968
  uint16_t uniffi_editor_core_checksum_func_editor_delete_and_split_scalar(void
944
969
 
970
+ );
971
+ #endif
972
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_DELETE_BACKWARD_AT_SELECTION_SCALAR
973
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_DELETE_BACKWARD_AT_SELECTION_SCALAR
974
+ uint16_t uniffi_editor_core_checksum_func_editor_delete_backward_at_selection_scalar(void
975
+
945
976
  );
946
977
  #endif
947
978
  #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_DELETE_RANGE
@@ -966,6 +997,12 @@ uint16_t uniffi_editor_core_checksum_func_editor_destroy(void
966
997
  #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_DOC_TO_SCALAR
967
998
  uint16_t uniffi_editor_core_checksum_func_editor_doc_to_scalar(void
968
999
 
1000
+ );
1001
+ #endif
1002
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_GET_CONTENT_SNAPSHOT
1003
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_GET_CONTENT_SNAPSHOT
1004
+ uint16_t uniffi_editor_core_checksum_func_editor_get_content_snapshot(void
1005
+
969
1006
  );
970
1007
  #endif
971
1008
  #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_GET_CURRENT_STATE
@@ -990,6 +1027,12 @@ uint16_t uniffi_editor_core_checksum_func_editor_get_json(void
990
1027
  #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_GET_SELECTION
991
1028
  uint16_t uniffi_editor_core_checksum_func_editor_get_selection(void
992
1029
 
1030
+ );
1031
+ #endif
1032
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_GET_SELECTION_STATE
1033
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_GET_SELECTION_STATE
1034
+ uint16_t uniffi_editor_core_checksum_func_editor_get_selection_state(void
1035
+
993
1036
  );
994
1037
  #endif
995
1038
  #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_INDENT_LIST_ITEM
@@ -1158,6 +1201,18 @@ uint16_t uniffi_editor_core_checksum_func_editor_toggle_blockquote(void
1158
1201
  #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_TOGGLE_BLOCKQUOTE_AT_SELECTION_SCALAR
1159
1202
  uint16_t uniffi_editor_core_checksum_func_editor_toggle_blockquote_at_selection_scalar(void
1160
1203
 
1204
+ );
1205
+ #endif
1206
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_TOGGLE_HEADING
1207
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_TOGGLE_HEADING
1208
+ uint16_t uniffi_editor_core_checksum_func_editor_toggle_heading(void
1209
+
1210
+ );
1211
+ #endif
1212
+ #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_TOGGLE_HEADING_AT_SELECTION_SCALAR
1213
+ #define UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_TOGGLE_HEADING_AT_SELECTION_SCALAR
1214
+ uint16_t uniffi_editor_core_checksum_func_editor_toggle_heading_at_selection_scalar(void
1215
+
1161
1216
  );
1162
1217
  #endif
1163
1218
  #ifndef UNIFFI_FFIDEF_UNIFFI_EDITOR_CORE_CHECKSUM_FUNC_EDITOR_TOGGLE_MARK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollohg/react-native-prose-editor",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
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",
@@ -30,11 +30,21 @@
30
30
  "build": "tsc -p tsconfig.build.json",
31
31
  "prepack": "npm run build",
32
32
  "test": "jest --runInBand --watchman=false",
33
+ "bench:rust": "cargo bench --manifest-path rust/editor-core/Cargo.toml --bench perf_suite --",
34
+ "bench:rust:quick": "cargo bench --manifest-path rust/editor-core/Cargo.toml --bench perf_suite -- --quick",
33
35
  "typecheck": "tsc --noEmit",
34
36
  "sync:version": "node scripts/sync-version.mjs",
37
+ "publish:prepare": "bash ./scripts/prepare-publish.sh",
35
38
  "version": "node scripts/sync-version.mjs",
36
39
  "android:compile": "cd example/android && ./gradlew :apollohg-react-native-prose-editor:compileDebugKotlin",
37
40
  "android:test": "cd example/android && ./gradlew :apollohg-react-native-prose-editor:testDebugUnitTest",
41
+ "android:test:perf": "cd example/android && ./gradlew :apollohg-react-native-prose-editor:testDebugUnitTest -PapollohgShowPerfTestOutput=true --tests com.apollohg.editor.NativePerformanceTest",
42
+ "android:test:device": "bash ./scripts/run-android-on-device.sh",
43
+ "android:test:perf:device": "bash ./scripts/run-android-on-device.sh --class com.apollohg.editor.NativeDevicePerformanceTest",
44
+ "ios:test": "bash ./scripts/run-ios-tests.sh",
45
+ "ios:test:perf": "bash ./scripts/run-ios-tests.sh -only-testing:NativeEditorTests/NativePerformanceTests",
46
+ "ios:test:device": "bash ./scripts/run-ios-on-device.sh",
47
+ "ios:test:perf:device": "bash ./scripts/run-ios-on-device.sh -only-testing:NativeEditorTests/NativePerformanceTests",
38
48
  "android:assemble": "cd example/android && ./gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a",
39
49
  "example:prebuild": "npm --prefix example run prebuild",
40
50
  "example:start": "npm --prefix example start",
@@ -47,7 +57,6 @@
47
57
  "peerDependencies": {
48
58
  "@expo/vector-icons": ">=14.0.0",
49
59
  "expo": ">=52.0.0",
50
- "expo-modules-core": ">=2.0.0",
51
60
  "react": ">=18.0.0",
52
61
  "react-native": ">=0.76.0"
53
62
  },
@@ -824,6 +824,16 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback {
824
824
 
825
825
 
826
826
 
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+
827
837
 
828
838
 
829
839
 
@@ -884,6 +894,8 @@ fun uniffi_editor_core_checksum_func_editor_create(
884
894
  ): Short
885
895
  fun uniffi_editor_core_checksum_func_editor_delete_and_split_scalar(
886
896
  ): Short
897
+ fun uniffi_editor_core_checksum_func_editor_delete_backward_at_selection_scalar(
898
+ ): Short
887
899
  fun uniffi_editor_core_checksum_func_editor_delete_range(
888
900
  ): Short
889
901
  fun uniffi_editor_core_checksum_func_editor_delete_scalar_range(
@@ -892,6 +904,8 @@ fun uniffi_editor_core_checksum_func_editor_destroy(
892
904
  ): Short
893
905
  fun uniffi_editor_core_checksum_func_editor_doc_to_scalar(
894
906
  ): Short
907
+ fun uniffi_editor_core_checksum_func_editor_get_content_snapshot(
908
+ ): Short
895
909
  fun uniffi_editor_core_checksum_func_editor_get_current_state(
896
910
  ): Short
897
911
  fun uniffi_editor_core_checksum_func_editor_get_html(
@@ -900,6 +914,8 @@ fun uniffi_editor_core_checksum_func_editor_get_json(
900
914
  ): Short
901
915
  fun uniffi_editor_core_checksum_func_editor_get_selection(
902
916
  ): Short
917
+ fun uniffi_editor_core_checksum_func_editor_get_selection_state(
918
+ ): Short
903
919
  fun uniffi_editor_core_checksum_func_editor_indent_list_item(
904
920
  ): Short
905
921
  fun uniffi_editor_core_checksum_func_editor_indent_list_item_at_selection_scalar(
@@ -956,6 +972,10 @@ fun uniffi_editor_core_checksum_func_editor_toggle_blockquote(
956
972
  ): Short
957
973
  fun uniffi_editor_core_checksum_func_editor_toggle_blockquote_at_selection_scalar(
958
974
  ): Short
975
+ fun uniffi_editor_core_checksum_func_editor_toggle_heading(
976
+ ): Short
977
+ fun uniffi_editor_core_checksum_func_editor_toggle_heading_at_selection_scalar(
978
+ ): Short
959
979
  fun uniffi_editor_core_checksum_func_editor_toggle_mark(
960
980
  ): Short
961
981
  fun uniffi_editor_core_checksum_func_editor_toggle_mark_at_selection_scalar(
@@ -1053,6 +1073,8 @@ fun uniffi_editor_core_fn_func_editor_create(`configJson`: RustBuffer.ByValue,un
1053
1073
  ): Long
1054
1074
  fun uniffi_editor_core_fn_func_editor_delete_and_split_scalar(`id`: Long,`scalarFrom`: Int,`scalarTo`: Int,uniffi_out_err: UniffiRustCallStatus,
1055
1075
  ): RustBuffer.ByValue
1076
+ fun uniffi_editor_core_fn_func_editor_delete_backward_at_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,uniffi_out_err: UniffiRustCallStatus,
1077
+ ): RustBuffer.ByValue
1056
1078
  fun uniffi_editor_core_fn_func_editor_delete_range(`id`: Long,`from`: Int,`to`: Int,uniffi_out_err: UniffiRustCallStatus,
1057
1079
  ): RustBuffer.ByValue
1058
1080
  fun uniffi_editor_core_fn_func_editor_delete_scalar_range(`id`: Long,`scalarFrom`: Int,`scalarTo`: Int,uniffi_out_err: UniffiRustCallStatus,
@@ -1061,6 +1083,8 @@ fun uniffi_editor_core_fn_func_editor_destroy(`id`: Long,uniffi_out_err: UniffiR
1061
1083
  ): Unit
1062
1084
  fun uniffi_editor_core_fn_func_editor_doc_to_scalar(`id`: Long,`docPos`: Int,uniffi_out_err: UniffiRustCallStatus,
1063
1085
  ): Int
1086
+ fun uniffi_editor_core_fn_func_editor_get_content_snapshot(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
1087
+ ): RustBuffer.ByValue
1064
1088
  fun uniffi_editor_core_fn_func_editor_get_current_state(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
1065
1089
  ): RustBuffer.ByValue
1066
1090
  fun uniffi_editor_core_fn_func_editor_get_html(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
@@ -1069,6 +1093,8 @@ fun uniffi_editor_core_fn_func_editor_get_json(`id`: Long,uniffi_out_err: Uniffi
1069
1093
  ): RustBuffer.ByValue
1070
1094
  fun uniffi_editor_core_fn_func_editor_get_selection(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
1071
1095
  ): RustBuffer.ByValue
1096
+ fun uniffi_editor_core_fn_func_editor_get_selection_state(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
1097
+ ): RustBuffer.ByValue
1072
1098
  fun uniffi_editor_core_fn_func_editor_indent_list_item(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
1073
1099
  ): RustBuffer.ByValue
1074
1100
  fun uniffi_editor_core_fn_func_editor_indent_list_item_at_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,uniffi_out_err: UniffiRustCallStatus,
@@ -1125,6 +1151,10 @@ fun uniffi_editor_core_fn_func_editor_toggle_blockquote(`id`: Long,uniffi_out_er
1125
1151
  ): RustBuffer.ByValue
1126
1152
  fun uniffi_editor_core_fn_func_editor_toggle_blockquote_at_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,uniffi_out_err: UniffiRustCallStatus,
1127
1153
  ): RustBuffer.ByValue
1154
+ fun uniffi_editor_core_fn_func_editor_toggle_heading(`id`: Long,`level`: Byte,uniffi_out_err: UniffiRustCallStatus,
1155
+ ): RustBuffer.ByValue
1156
+ fun uniffi_editor_core_fn_func_editor_toggle_heading_at_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,`level`: Byte,uniffi_out_err: UniffiRustCallStatus,
1157
+ ): RustBuffer.ByValue
1128
1158
  fun uniffi_editor_core_fn_func_editor_toggle_mark(`id`: Long,`markName`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
1129
1159
  ): RustBuffer.ByValue
1130
1160
  fun uniffi_editor_core_fn_func_editor_toggle_mark_at_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,`markName`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
@@ -1320,6 +1350,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
1320
1350
  if (lib.uniffi_editor_core_checksum_func_editor_delete_and_split_scalar() != 13764.toShort()) {
1321
1351
  throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1322
1352
  }
1353
+ if (lib.uniffi_editor_core_checksum_func_editor_delete_backward_at_selection_scalar() != 7697.toShort()) {
1354
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1355
+ }
1323
1356
  if (lib.uniffi_editor_core_checksum_func_editor_delete_range() != 6109.toShort()) {
1324
1357
  throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1325
1358
  }
@@ -1332,6 +1365,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
1332
1365
  if (lib.uniffi_editor_core_checksum_func_editor_doc_to_scalar() != 48291.toShort()) {
1333
1366
  throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1334
1367
  }
1368
+ if (lib.uniffi_editor_core_checksum_func_editor_get_content_snapshot() != 32837.toShort()) {
1369
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1370
+ }
1335
1371
  if (lib.uniffi_editor_core_checksum_func_editor_get_current_state() != 13946.toShort()) {
1336
1372
  throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1337
1373
  }
@@ -1344,6 +1380,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
1344
1380
  if (lib.uniffi_editor_core_checksum_func_editor_get_selection() != 20571.toShort()) {
1345
1381
  throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1346
1382
  }
1383
+ if (lib.uniffi_editor_core_checksum_func_editor_get_selection_state() != 16471.toShort()) {
1384
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1385
+ }
1347
1386
  if (lib.uniffi_editor_core_checksum_func_editor_indent_list_item() != 10818.toShort()) {
1348
1387
  throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1349
1388
  }
@@ -1428,6 +1467,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
1428
1467
  if (lib.uniffi_editor_core_checksum_func_editor_toggle_blockquote_at_selection_scalar() != 58523.toShort()) {
1429
1468
  throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1430
1469
  }
1470
+ if (lib.uniffi_editor_core_checksum_func_editor_toggle_heading() != 7099.toShort()) {
1471
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1472
+ }
1473
+ if (lib.uniffi_editor_core_checksum_func_editor_toggle_heading_at_selection_scalar() != 54315.toShort()) {
1474
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1475
+ }
1431
1476
  if (lib.uniffi_editor_core_checksum_func_editor_toggle_mark() != 30661.toShort()) {
1432
1477
  throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1433
1478
  }
@@ -1534,6 +1579,29 @@ inline fun <T : Disposable?, R> T.use(block: (T) -> R) =
1534
1579
  * */
1535
1580
  object NoPointer
1536
1581
 
1582
+ /**
1583
+ * @suppress
1584
+ */
1585
+ public object FfiConverterUByte: FfiConverter<UByte, Byte> {
1586
+ override fun lift(value: Byte): UByte {
1587
+ return value.toUByte()
1588
+ }
1589
+
1590
+ override fun read(buf: ByteBuffer): UByte {
1591
+ return lift(buf.get())
1592
+ }
1593
+
1594
+ override fun lower(value: UByte): Byte {
1595
+ return value.toByte()
1596
+ }
1597
+
1598
+ override fun allocationSize(value: UByte) = 1UL
1599
+
1600
+ override fun write(value: UByte, buf: ByteBuffer) {
1601
+ buf.put(value.toByte())
1602
+ }
1603
+ }
1604
+
1537
1605
  /**
1538
1606
  * @suppress
1539
1607
  */
@@ -1872,6 +1940,18 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
1872
1940
  }
1873
1941
 
1874
1942
 
1943
+ /**
1944
+ * Delete backward relative to an explicit scalar selection. Returns an update JSON string.
1945
+ */ fun `editorDeleteBackwardAtSelectionScalar`(`id`: kotlin.ULong, `scalarAnchor`: kotlin.UInt, `scalarHead`: kotlin.UInt): kotlin.String {
1946
+ return FfiConverterString.lift(
1947
+ uniffiRustCall() { _status ->
1948
+ UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_delete_backward_at_selection_scalar(
1949
+ FfiConverterULong.lower(`id`),FfiConverterUInt.lower(`scalarAnchor`),FfiConverterUInt.lower(`scalarHead`),_status)
1950
+ }
1951
+ )
1952
+ }
1953
+
1954
+
1875
1955
  /**
1876
1956
  * Delete a range. Returns an update JSON string.
1877
1957
  */ fun `editorDeleteRange`(`id`: kotlin.ULong, `from`: kotlin.UInt, `to`: kotlin.UInt): kotlin.String {
@@ -1919,6 +1999,18 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
1919
1999
  }
1920
2000
 
1921
2001
 
2002
+ /**
2003
+ * Get both HTML and ProseMirror JSON content in one payload.
2004
+ */ fun `editorGetContentSnapshot`(`id`: kotlin.ULong): kotlin.String {
2005
+ return FfiConverterString.lift(
2006
+ uniffiRustCall() { _status ->
2007
+ UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_get_content_snapshot(
2008
+ FfiConverterULong.lower(`id`),_status)
2009
+ }
2010
+ )
2011
+ }
2012
+
2013
+
1922
2014
  /**
1923
2015
  * Get the current editor state (render elements, selection, active state,
1924
2016
  * history state) without performing any edits. Used by native views to pull
@@ -1969,6 +2061,18 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
1969
2061
  }
1970
2062
 
1971
2063
 
2064
+ /**
2065
+ * Get the current selection-related editor state without render elements.
2066
+ */ fun `editorGetSelectionState`(`id`: kotlin.ULong): kotlin.String {
2067
+ return FfiConverterString.lift(
2068
+ uniffiRustCall() { _status ->
2069
+ UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_get_selection_state(
2070
+ FfiConverterULong.lower(`id`),_status)
2071
+ }
2072
+ )
2073
+ }
2074
+
2075
+
1972
2076
  /**
1973
2077
  * Indent the current list item into a nested list. Returns an update JSON string.
1974
2078
  */ fun `editorIndentListItem`(`id`: kotlin.ULong): kotlin.String {
@@ -2303,6 +2407,30 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
2303
2407
  }
2304
2408
 
2305
2409
 
2410
+ /**
2411
+ * Toggle a heading level on the current text-block selection. Returns an update JSON string.
2412
+ */ fun `editorToggleHeading`(`id`: kotlin.ULong, `level`: kotlin.UByte): kotlin.String {
2413
+ return FfiConverterString.lift(
2414
+ uniffiRustCall() { _status ->
2415
+ UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_toggle_heading(
2416
+ FfiConverterULong.lower(`id`),FfiConverterUByte.lower(`level`),_status)
2417
+ }
2418
+ )
2419
+ }
2420
+
2421
+
2422
+ /**
2423
+ * Toggle a heading level at an explicit scalar selection. Returns an update JSON string.
2424
+ */ fun `editorToggleHeadingAtSelectionScalar`(`id`: kotlin.ULong, `scalarAnchor`: kotlin.UInt, `scalarHead`: kotlin.UInt, `level`: kotlin.UByte): kotlin.String {
2425
+ return FfiConverterString.lift(
2426
+ uniffiRustCall() { _status ->
2427
+ UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_toggle_heading_at_selection_scalar(
2428
+ FfiConverterULong.lower(`id`),FfiConverterUInt.lower(`scalarAnchor`),FfiConverterUInt.lower(`scalarHead`),FfiConverterUByte.lower(`level`),_status)
2429
+ }
2430
+ )
2431
+ }
2432
+
2433
+
2306
2434
  /**
2307
2435
  * Toggle a mark on the current selection. Returns an update JSON string.
2308
2436
  */ fun `editorToggleMark`(`id`: kotlin.ULong, `markName`: kotlin.String): kotlin.String {