@apollohg/react-native-prose-editor 0.1.1 → 0.3.0
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 +12 -7
- package/android/build.gradle +7 -2
- package/android/src/main/java/com/apollohg/editor/EditorEditText.kt +289 -2
- package/android/src/main/java/com/apollohg/editor/EditorTheme.kt +51 -1
- package/android/src/main/java/com/apollohg/editor/ImageResizeOverlayView.kt +199 -0
- package/android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt +16 -3
- package/android/src/main/java/com/apollohg/editor/NativeEditorModule.kt +82 -1
- package/android/src/main/java/com/apollohg/editor/NativeToolbar.kt +403 -45
- package/android/src/main/java/com/apollohg/editor/RemoteSelectionOverlayView.kt +246 -0
- package/android/src/main/java/com/apollohg/editor/RenderBridge.kt +841 -155
- package/android/src/main/java/com/apollohg/editor/RichTextEditorView.kt +125 -8
- package/{src/EditorTheme.ts → dist/EditorTheme.d.ts} +12 -52
- package/dist/EditorTheme.js +29 -0
- package/dist/EditorToolbar.d.ts +129 -0
- package/dist/EditorToolbar.js +394 -0
- package/dist/NativeEditorBridge.d.ts +242 -0
- package/dist/NativeEditorBridge.js +647 -0
- package/dist/NativeRichTextEditor.d.ts +142 -0
- package/dist/NativeRichTextEditor.js +649 -0
- package/dist/YjsCollaboration.d.ts +83 -0
- package/dist/YjsCollaboration.js +585 -0
- package/dist/addons.d.ts +70 -0
- package/dist/addons.js +77 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +26 -0
- package/dist/schemas.d.ts +35 -0
- package/{src/schemas.ts → dist/schemas.js} +62 -27
- package/dist/useNativeEditor.d.ts +40 -0
- package/dist/useNativeEditor.js +117 -0
- package/ios/EditorAddons.swift +26 -3
- package/ios/EditorCore.xcframework/Info.plist +5 -5
- 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/EditorLayoutManager.swift +236 -0
- package/ios/EditorTheme.swift +51 -1
- package/ios/Generated_editor_core.swift +270 -2
- package/ios/NativeEditorExpoView.swift +612 -45
- package/ios/NativeEditorModule.swift +81 -0
- package/ios/PositionBridge.swift +22 -0
- package/ios/RenderBridge.swift +427 -39
- package/ios/RichTextEditorView.swift +1342 -18
- package/ios/editor_coreFFI/editor_coreFFI.h +209 -0
- package/package.json +80 -64
- 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
- package/rust/bindings/kotlin/uniffi/editor_core/editor_core.kt +404 -4
- package/src/EditorToolbar.tsx +0 -620
- package/src/NativeEditorBridge.ts +0 -607
- package/src/NativeRichTextEditor.tsx +0 -951
- package/src/addons.ts +0 -158
- package/src/index.ts +0 -63
- package/src/useNativeEditor.ts +0 -173
|
@@ -776,6 +776,44 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback {
|
|
|
776
776
|
|
|
777
777
|
|
|
778
778
|
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
779
817
|
|
|
780
818
|
|
|
781
819
|
|
|
@@ -812,7 +850,31 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback {
|
|
|
812
850
|
// when the library is loaded.
|
|
813
851
|
internal interface IntegrityCheckingUniffiLib : Library {
|
|
814
852
|
// Integrity check functions only
|
|
815
|
-
fun
|
|
853
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_apply_encoded_state(
|
|
854
|
+
): Short
|
|
855
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_apply_local_document_json(
|
|
856
|
+
): Short
|
|
857
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_clear_local_awareness(
|
|
858
|
+
): Short
|
|
859
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_create(
|
|
860
|
+
): Short
|
|
861
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_destroy(
|
|
862
|
+
): Short
|
|
863
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_get_document_json(
|
|
864
|
+
): Short
|
|
865
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_get_encoded_state(
|
|
866
|
+
): Short
|
|
867
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_get_peers_json(
|
|
868
|
+
): Short
|
|
869
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_handle_message(
|
|
870
|
+
): Short
|
|
871
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_replace_encoded_state(
|
|
872
|
+
): Short
|
|
873
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_set_local_awareness(
|
|
874
|
+
): Short
|
|
875
|
+
fun uniffi_editor_core_checksum_func_collaboration_session_start(
|
|
876
|
+
): Short
|
|
877
|
+
fun uniffi_editor_core_checksum_func_editor_can_redo(
|
|
816
878
|
): Short
|
|
817
879
|
fun uniffi_editor_core_checksum_func_editor_can_undo(
|
|
818
880
|
): Short
|
|
@@ -870,12 +932,18 @@ fun uniffi_editor_core_checksum_func_editor_replace_selection_text(
|
|
|
870
932
|
): Short
|
|
871
933
|
fun uniffi_editor_core_checksum_func_editor_replace_text_scalar(
|
|
872
934
|
): Short
|
|
935
|
+
fun uniffi_editor_core_checksum_func_editor_resize_image_at_doc_pos(
|
|
936
|
+
): Short
|
|
873
937
|
fun uniffi_editor_core_checksum_func_editor_scalar_to_doc(
|
|
874
938
|
): Short
|
|
875
939
|
fun uniffi_editor_core_checksum_func_editor_set_html(
|
|
876
940
|
): Short
|
|
877
941
|
fun uniffi_editor_core_checksum_func_editor_set_json(
|
|
878
942
|
): Short
|
|
943
|
+
fun uniffi_editor_core_checksum_func_editor_set_mark(
|
|
944
|
+
): Short
|
|
945
|
+
fun uniffi_editor_core_checksum_func_editor_set_mark_at_selection_scalar(
|
|
946
|
+
): Short
|
|
879
947
|
fun uniffi_editor_core_checksum_func_editor_set_selection(
|
|
880
948
|
): Short
|
|
881
949
|
fun uniffi_editor_core_checksum_func_editor_set_selection_scalar(
|
|
@@ -884,12 +952,20 @@ fun uniffi_editor_core_checksum_func_editor_split_block(
|
|
|
884
952
|
): Short
|
|
885
953
|
fun uniffi_editor_core_checksum_func_editor_split_block_scalar(
|
|
886
954
|
): Short
|
|
955
|
+
fun uniffi_editor_core_checksum_func_editor_toggle_blockquote(
|
|
956
|
+
): Short
|
|
957
|
+
fun uniffi_editor_core_checksum_func_editor_toggle_blockquote_at_selection_scalar(
|
|
958
|
+
): Short
|
|
887
959
|
fun uniffi_editor_core_checksum_func_editor_toggle_mark(
|
|
888
960
|
): Short
|
|
889
961
|
fun uniffi_editor_core_checksum_func_editor_toggle_mark_at_selection_scalar(
|
|
890
962
|
): Short
|
|
891
963
|
fun uniffi_editor_core_checksum_func_editor_undo(
|
|
892
964
|
): Short
|
|
965
|
+
fun uniffi_editor_core_checksum_func_editor_unset_mark(
|
|
966
|
+
): Short
|
|
967
|
+
fun uniffi_editor_core_checksum_func_editor_unset_mark_at_selection_scalar(
|
|
968
|
+
): Short
|
|
893
969
|
fun uniffi_editor_core_checksum_func_editor_unwrap_from_list(
|
|
894
970
|
): Short
|
|
895
971
|
fun uniffi_editor_core_checksum_func_editor_unwrap_from_list_at_selection_scalar(
|
|
@@ -943,7 +1019,31 @@ internal interface UniffiLib : Library {
|
|
|
943
1019
|
}
|
|
944
1020
|
|
|
945
1021
|
// FFI functions
|
|
946
|
-
fun
|
|
1022
|
+
fun uniffi_editor_core_fn_func_collaboration_session_apply_encoded_state(`id`: Long,`encodedStateJson`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1023
|
+
): RustBuffer.ByValue
|
|
1024
|
+
fun uniffi_editor_core_fn_func_collaboration_session_apply_local_document_json(`id`: Long,`json`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1025
|
+
): RustBuffer.ByValue
|
|
1026
|
+
fun uniffi_editor_core_fn_func_collaboration_session_clear_local_awareness(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
1027
|
+
): RustBuffer.ByValue
|
|
1028
|
+
fun uniffi_editor_core_fn_func_collaboration_session_create(`configJson`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1029
|
+
): Long
|
|
1030
|
+
fun uniffi_editor_core_fn_func_collaboration_session_destroy(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
1031
|
+
): Unit
|
|
1032
|
+
fun uniffi_editor_core_fn_func_collaboration_session_get_document_json(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
1033
|
+
): RustBuffer.ByValue
|
|
1034
|
+
fun uniffi_editor_core_fn_func_collaboration_session_get_encoded_state(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
1035
|
+
): RustBuffer.ByValue
|
|
1036
|
+
fun uniffi_editor_core_fn_func_collaboration_session_get_peers_json(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
1037
|
+
): RustBuffer.ByValue
|
|
1038
|
+
fun uniffi_editor_core_fn_func_collaboration_session_handle_message(`id`: Long,`messageJson`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1039
|
+
): RustBuffer.ByValue
|
|
1040
|
+
fun uniffi_editor_core_fn_func_collaboration_session_replace_encoded_state(`id`: Long,`encodedStateJson`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1041
|
+
): RustBuffer.ByValue
|
|
1042
|
+
fun uniffi_editor_core_fn_func_collaboration_session_set_local_awareness(`id`: Long,`awarenessJson`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1043
|
+
): RustBuffer.ByValue
|
|
1044
|
+
fun uniffi_editor_core_fn_func_collaboration_session_start(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
1045
|
+
): RustBuffer.ByValue
|
|
1046
|
+
fun uniffi_editor_core_fn_func_editor_can_redo(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
947
1047
|
): Byte
|
|
948
1048
|
fun uniffi_editor_core_fn_func_editor_can_undo(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
949
1049
|
): Byte
|
|
@@ -1001,12 +1101,18 @@ fun uniffi_editor_core_fn_func_editor_replace_selection_text(`id`: Long,`text`:
|
|
|
1001
1101
|
): RustBuffer.ByValue
|
|
1002
1102
|
fun uniffi_editor_core_fn_func_editor_replace_text_scalar(`id`: Long,`scalarFrom`: Int,`scalarTo`: Int,`text`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1003
1103
|
): RustBuffer.ByValue
|
|
1104
|
+
fun uniffi_editor_core_fn_func_editor_resize_image_at_doc_pos(`id`: Long,`docPos`: Int,`width`: Int,`height`: Int,uniffi_out_err: UniffiRustCallStatus,
|
|
1105
|
+
): RustBuffer.ByValue
|
|
1004
1106
|
fun uniffi_editor_core_fn_func_editor_scalar_to_doc(`id`: Long,`scalar`: Int,uniffi_out_err: UniffiRustCallStatus,
|
|
1005
1107
|
): Int
|
|
1006
1108
|
fun uniffi_editor_core_fn_func_editor_set_html(`id`: Long,`html`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1007
1109
|
): RustBuffer.ByValue
|
|
1008
1110
|
fun uniffi_editor_core_fn_func_editor_set_json(`id`: Long,`json`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1009
1111
|
): RustBuffer.ByValue
|
|
1112
|
+
fun uniffi_editor_core_fn_func_editor_set_mark(`id`: Long,`markName`: RustBuffer.ByValue,`attrsJson`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1113
|
+
): RustBuffer.ByValue
|
|
1114
|
+
fun uniffi_editor_core_fn_func_editor_set_mark_at_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,`markName`: RustBuffer.ByValue,`attrsJson`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1115
|
+
): RustBuffer.ByValue
|
|
1010
1116
|
fun uniffi_editor_core_fn_func_editor_set_selection(`id`: Long,`anchor`: Int,`head`: Int,uniffi_out_err: UniffiRustCallStatus,
|
|
1011
1117
|
): Unit
|
|
1012
1118
|
fun uniffi_editor_core_fn_func_editor_set_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,uniffi_out_err: UniffiRustCallStatus,
|
|
@@ -1015,12 +1121,20 @@ fun uniffi_editor_core_fn_func_editor_split_block(`id`: Long,`pos`: Int,uniffi_o
|
|
|
1015
1121
|
): RustBuffer.ByValue
|
|
1016
1122
|
fun uniffi_editor_core_fn_func_editor_split_block_scalar(`id`: Long,`scalarPos`: Int,uniffi_out_err: UniffiRustCallStatus,
|
|
1017
1123
|
): RustBuffer.ByValue
|
|
1124
|
+
fun uniffi_editor_core_fn_func_editor_toggle_blockquote(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
1125
|
+
): RustBuffer.ByValue
|
|
1126
|
+
fun uniffi_editor_core_fn_func_editor_toggle_blockquote_at_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,uniffi_out_err: UniffiRustCallStatus,
|
|
1127
|
+
): RustBuffer.ByValue
|
|
1018
1128
|
fun uniffi_editor_core_fn_func_editor_toggle_mark(`id`: Long,`markName`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1019
1129
|
): RustBuffer.ByValue
|
|
1020
1130
|
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,
|
|
1021
1131
|
): RustBuffer.ByValue
|
|
1022
1132
|
fun uniffi_editor_core_fn_func_editor_undo(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
1023
1133
|
): RustBuffer.ByValue
|
|
1134
|
+
fun uniffi_editor_core_fn_func_editor_unset_mark(`id`: Long,`markName`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1135
|
+
): RustBuffer.ByValue
|
|
1136
|
+
fun uniffi_editor_core_fn_func_editor_unset_mark_at_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,`markName`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
|
1137
|
+
): RustBuffer.ByValue
|
|
1024
1138
|
fun uniffi_editor_core_fn_func_editor_unwrap_from_list(`id`: Long,uniffi_out_err: UniffiRustCallStatus,
|
|
1025
1139
|
): RustBuffer.ByValue
|
|
1026
1140
|
fun uniffi_editor_core_fn_func_editor_unwrap_from_list_at_selection_scalar(`id`: Long,`scalarAnchor`: Int,`scalarHead`: Int,uniffi_out_err: UniffiRustCallStatus,
|
|
@@ -1155,6 +1269,42 @@ private fun uniffiCheckContractApiVersion(lib: IntegrityCheckingUniffiLib) {
|
|
|
1155
1269
|
}
|
|
1156
1270
|
@Suppress("UNUSED_PARAMETER")
|
|
1157
1271
|
private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
|
|
1272
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_apply_encoded_state() != 4684.toShort()) {
|
|
1273
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1274
|
+
}
|
|
1275
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_apply_local_document_json() != 396.toShort()) {
|
|
1276
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1277
|
+
}
|
|
1278
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_clear_local_awareness() != 48044.toShort()) {
|
|
1279
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1280
|
+
}
|
|
1281
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_create() != 60237.toShort()) {
|
|
1282
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1283
|
+
}
|
|
1284
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_destroy() != 56261.toShort()) {
|
|
1285
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1286
|
+
}
|
|
1287
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_get_document_json() != 44139.toShort()) {
|
|
1288
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1289
|
+
}
|
|
1290
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_get_encoded_state() != 16895.toShort()) {
|
|
1291
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1292
|
+
}
|
|
1293
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_get_peers_json() != 46461.toShort()) {
|
|
1294
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1295
|
+
}
|
|
1296
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_handle_message() != 25528.toShort()) {
|
|
1297
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1298
|
+
}
|
|
1299
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_replace_encoded_state() != 53994.toShort()) {
|
|
1300
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1301
|
+
}
|
|
1302
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_set_local_awareness() != 63617.toShort()) {
|
|
1303
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1304
|
+
}
|
|
1305
|
+
if (lib.uniffi_editor_core_checksum_func_collaboration_session_start() != 54751.toShort()) {
|
|
1306
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1307
|
+
}
|
|
1158
1308
|
if (lib.uniffi_editor_core_checksum_func_editor_can_redo() != 15854.toShort()) {
|
|
1159
1309
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1160
1310
|
}
|
|
@@ -1164,7 +1314,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
|
|
|
1164
1314
|
if (lib.uniffi_editor_core_checksum_func_editor_core_version() != 41638.toShort()) {
|
|
1165
1315
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1166
1316
|
}
|
|
1167
|
-
if (lib.uniffi_editor_core_checksum_func_editor_create() !=
|
|
1317
|
+
if (lib.uniffi_editor_core_checksum_func_editor_create() != 19812.toShort()) {
|
|
1168
1318
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1169
1319
|
}
|
|
1170
1320
|
if (lib.uniffi_editor_core_checksum_func_editor_delete_and_split_scalar() != 13764.toShort()) {
|
|
@@ -1242,6 +1392,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
|
|
|
1242
1392
|
if (lib.uniffi_editor_core_checksum_func_editor_replace_text_scalar() != 45475.toShort()) {
|
|
1243
1393
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1244
1394
|
}
|
|
1395
|
+
if (lib.uniffi_editor_core_checksum_func_editor_resize_image_at_doc_pos() != 36353.toShort()) {
|
|
1396
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1397
|
+
}
|
|
1245
1398
|
if (lib.uniffi_editor_core_checksum_func_editor_scalar_to_doc() != 40126.toShort()) {
|
|
1246
1399
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1247
1400
|
}
|
|
@@ -1251,6 +1404,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
|
|
|
1251
1404
|
if (lib.uniffi_editor_core_checksum_func_editor_set_json() != 18497.toShort()) {
|
|
1252
1405
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1253
1406
|
}
|
|
1407
|
+
if (lib.uniffi_editor_core_checksum_func_editor_set_mark() != 29349.toShort()) {
|
|
1408
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1409
|
+
}
|
|
1410
|
+
if (lib.uniffi_editor_core_checksum_func_editor_set_mark_at_selection_scalar() != 43994.toShort()) {
|
|
1411
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1412
|
+
}
|
|
1254
1413
|
if (lib.uniffi_editor_core_checksum_func_editor_set_selection() != 28236.toShort()) {
|
|
1255
1414
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1256
1415
|
}
|
|
@@ -1263,6 +1422,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
|
|
|
1263
1422
|
if (lib.uniffi_editor_core_checksum_func_editor_split_block_scalar() != 47554.toShort()) {
|
|
1264
1423
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1265
1424
|
}
|
|
1425
|
+
if (lib.uniffi_editor_core_checksum_func_editor_toggle_blockquote() != 25804.toShort()) {
|
|
1426
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1427
|
+
}
|
|
1428
|
+
if (lib.uniffi_editor_core_checksum_func_editor_toggle_blockquote_at_selection_scalar() != 58523.toShort()) {
|
|
1429
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1430
|
+
}
|
|
1266
1431
|
if (lib.uniffi_editor_core_checksum_func_editor_toggle_mark() != 30661.toShort()) {
|
|
1267
1432
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1268
1433
|
}
|
|
@@ -1272,6 +1437,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
|
|
|
1272
1437
|
if (lib.uniffi_editor_core_checksum_func_editor_undo() != 28689.toShort()) {
|
|
1273
1438
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1274
1439
|
}
|
|
1440
|
+
if (lib.uniffi_editor_core_checksum_func_editor_unset_mark() != 47985.toShort()) {
|
|
1441
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1442
|
+
}
|
|
1443
|
+
if (lib.uniffi_editor_core_checksum_func_editor_unset_mark_at_selection_scalar() != 54992.toShort()) {
|
|
1444
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1445
|
+
}
|
|
1275
1446
|
if (lib.uniffi_editor_core_checksum_func_editor_unwrap_from_list() != 41875.toShort()) {
|
|
1276
1447
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
1277
1448
|
}
|
|
@@ -1488,6 +1659,149 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
|
|
|
1488
1659
|
buf.put(byteBuf)
|
|
1489
1660
|
}
|
|
1490
1661
|
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Apply a durable Yjs encoded state/update represented as a JSON byte array.
|
|
1664
|
+
*/ fun `collaborationSessionApplyEncodedState`(`id`: kotlin.ULong, `encodedStateJson`: kotlin.String): kotlin.String {
|
|
1665
|
+
return FfiConverterString.lift(
|
|
1666
|
+
uniffiRustCall() { _status ->
|
|
1667
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_apply_encoded_state(
|
|
1668
|
+
FfiConverterULong.lower(`id`),FfiConverterString.lower(`encodedStateJson`),_status)
|
|
1669
|
+
}
|
|
1670
|
+
)
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* Apply a local ProseMirror JSON snapshot to the collaboration session.
|
|
1676
|
+
*/ fun `collaborationSessionApplyLocalDocumentJson`(`id`: kotlin.ULong, `json`: kotlin.String): kotlin.String {
|
|
1677
|
+
return FfiConverterString.lift(
|
|
1678
|
+
uniffiRustCall() { _status ->
|
|
1679
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_apply_local_document_json(
|
|
1680
|
+
FfiConverterULong.lower(`id`),FfiConverterString.lower(`json`),_status)
|
|
1681
|
+
}
|
|
1682
|
+
)
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* Clear the local awareness payload for a collaboration session.
|
|
1688
|
+
*/ fun `collaborationSessionClearLocalAwareness`(`id`: kotlin.ULong): kotlin.String {
|
|
1689
|
+
return FfiConverterString.lift(
|
|
1690
|
+
uniffiRustCall() { _status ->
|
|
1691
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_clear_local_awareness(
|
|
1692
|
+
FfiConverterULong.lower(`id`),_status)
|
|
1693
|
+
}
|
|
1694
|
+
)
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
/**
|
|
1699
|
+
* Create a Yjs collaboration session backed by yrs.
|
|
1700
|
+
*/ fun `collaborationSessionCreate`(`configJson`: kotlin.String): kotlin.ULong {
|
|
1701
|
+
return FfiConverterULong.lift(
|
|
1702
|
+
uniffiRustCall() { _status ->
|
|
1703
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_create(
|
|
1704
|
+
FfiConverterString.lower(`configJson`),_status)
|
|
1705
|
+
}
|
|
1706
|
+
)
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* Destroy a collaboration session and free its resources.
|
|
1712
|
+
*/ fun `collaborationSessionDestroy`(`id`: kotlin.ULong)
|
|
1713
|
+
=
|
|
1714
|
+
uniffiRustCall() { _status ->
|
|
1715
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_destroy(
|
|
1716
|
+
FfiConverterULong.lower(`id`),_status)
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
|
|
1720
|
+
|
|
1721
|
+
/**
|
|
1722
|
+
* Return the current shared ProseMirror JSON document for a collaboration session.
|
|
1723
|
+
*/ fun `collaborationSessionGetDocumentJson`(`id`: kotlin.ULong): kotlin.String {
|
|
1724
|
+
return FfiConverterString.lift(
|
|
1725
|
+
uniffiRustCall() { _status ->
|
|
1726
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_get_document_json(
|
|
1727
|
+
FfiConverterULong.lower(`id`),_status)
|
|
1728
|
+
}
|
|
1729
|
+
)
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
|
|
1733
|
+
/**
|
|
1734
|
+
* Return the current shared Yjs document state as a JSON byte array.
|
|
1735
|
+
*/ fun `collaborationSessionGetEncodedState`(`id`: kotlin.ULong): kotlin.String {
|
|
1736
|
+
return FfiConverterString.lift(
|
|
1737
|
+
uniffiRustCall() { _status ->
|
|
1738
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_get_encoded_state(
|
|
1739
|
+
FfiConverterULong.lower(`id`),_status)
|
|
1740
|
+
}
|
|
1741
|
+
)
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* Return the current awareness peers for a collaboration session.
|
|
1747
|
+
*/ fun `collaborationSessionGetPeersJson`(`id`: kotlin.ULong): kotlin.String {
|
|
1748
|
+
return FfiConverterString.lift(
|
|
1749
|
+
uniffiRustCall() { _status ->
|
|
1750
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_get_peers_json(
|
|
1751
|
+
FfiConverterULong.lower(`id`),_status)
|
|
1752
|
+
}
|
|
1753
|
+
)
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* Apply an incoming y-sync binary message encoded as a JSON byte array.
|
|
1759
|
+
*/ fun `collaborationSessionHandleMessage`(`id`: kotlin.ULong, `messageJson`: kotlin.String): kotlin.String {
|
|
1760
|
+
return FfiConverterString.lift(
|
|
1761
|
+
uniffiRustCall() { _status ->
|
|
1762
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_handle_message(
|
|
1763
|
+
FfiConverterULong.lower(`id`),FfiConverterString.lower(`messageJson`),_status)
|
|
1764
|
+
}
|
|
1765
|
+
)
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
/**
|
|
1770
|
+
* Replace the collaboration document with a durable Yjs encoded state/update.
|
|
1771
|
+
*/ fun `collaborationSessionReplaceEncodedState`(`id`: kotlin.ULong, `encodedStateJson`: kotlin.String): kotlin.String {
|
|
1772
|
+
return FfiConverterString.lift(
|
|
1773
|
+
uniffiRustCall() { _status ->
|
|
1774
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_replace_encoded_state(
|
|
1775
|
+
FfiConverterULong.lower(`id`),FfiConverterString.lower(`encodedStateJson`),_status)
|
|
1776
|
+
}
|
|
1777
|
+
)
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
|
|
1781
|
+
/**
|
|
1782
|
+
* Update the local awareness payload for a collaboration session.
|
|
1783
|
+
*/ fun `collaborationSessionSetLocalAwareness`(`id`: kotlin.ULong, `awarenessJson`: kotlin.String): kotlin.String {
|
|
1784
|
+
return FfiConverterString.lift(
|
|
1785
|
+
uniffiRustCall() { _status ->
|
|
1786
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_set_local_awareness(
|
|
1787
|
+
FfiConverterULong.lower(`id`),FfiConverterString.lower(`awarenessJson`),_status)
|
|
1788
|
+
}
|
|
1789
|
+
)
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* Start the sync handshake for a collaboration session.
|
|
1795
|
+
*/ fun `collaborationSessionStart`(`id`: kotlin.ULong): kotlin.String {
|
|
1796
|
+
return FfiConverterString.lift(
|
|
1797
|
+
uniffiRustCall() { _status ->
|
|
1798
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_collaboration_session_start(
|
|
1799
|
+
FfiConverterULong.lower(`id`),_status)
|
|
1800
|
+
}
|
|
1801
|
+
)
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
|
|
1491
1805
|
/**
|
|
1492
1806
|
* Check if redo is available.
|
|
1493
1807
|
*/ fun `editorCanRedo`(`id`: kotlin.ULong): kotlin.Boolean {
|
|
@@ -1527,12 +1841,14 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
|
|
|
1527
1841
|
/**
|
|
1528
1842
|
* Create a new editor from a JSON config object.
|
|
1529
1843
|
*
|
|
1530
|
-
* Config fields (all optional
|
|
1844
|
+
* Config fields (all optional):
|
|
1531
1845
|
* - `"schema"`: custom schema definition (see `Schema::from_json`)
|
|
1532
1846
|
* - `"maxLength"`: maximum document length in characters
|
|
1533
1847
|
* - `"readOnly"`: if `true`, rejects non-API mutations
|
|
1534
1848
|
* - `"inputFilter"`: regex pattern; only matching characters are inserted
|
|
1849
|
+
* - `"allowBase64Images"`: if `true`, parses `<img src="data:image/...">` as image nodes
|
|
1535
1850
|
*
|
|
1851
|
+
* An empty object creates a default editor.
|
|
1536
1852
|
* Falls back to the default Tiptap schema when `"schema"` is absent or invalid.
|
|
1537
1853
|
*/ fun `editorCreate`(`configJson`: kotlin.String): kotlin.ULong {
|
|
1538
1854
|
return FfiConverterULong.lift(
|
|
@@ -1845,6 +2161,18 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
|
|
|
1845
2161
|
}
|
|
1846
2162
|
|
|
1847
2163
|
|
|
2164
|
+
/**
|
|
2165
|
+
* Resize an image node at a document position. Returns an update JSON string.
|
|
2166
|
+
*/ fun `editorResizeImageAtDocPos`(`id`: kotlin.ULong, `docPos`: kotlin.UInt, `width`: kotlin.UInt, `height`: kotlin.UInt): kotlin.String {
|
|
2167
|
+
return FfiConverterString.lift(
|
|
2168
|
+
uniffiRustCall() { _status ->
|
|
2169
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_resize_image_at_doc_pos(
|
|
2170
|
+
FfiConverterULong.lower(`id`),FfiConverterUInt.lower(`docPos`),FfiConverterUInt.lower(`width`),FfiConverterUInt.lower(`height`),_status)
|
|
2171
|
+
}
|
|
2172
|
+
)
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
|
|
1848
2176
|
/**
|
|
1849
2177
|
* Convert a rendered-text scalar offset to a document position.
|
|
1850
2178
|
*/ fun `editorScalarToDoc`(`id`: kotlin.ULong, `scalar`: kotlin.UInt): kotlin.UInt {
|
|
@@ -1881,6 +2209,30 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
|
|
|
1881
2209
|
}
|
|
1882
2210
|
|
|
1883
2211
|
|
|
2212
|
+
/**
|
|
2213
|
+
* Set a mark with attrs on the current selection. Returns an update JSON string.
|
|
2214
|
+
*/ fun `editorSetMark`(`id`: kotlin.ULong, `markName`: kotlin.String, `attrsJson`: kotlin.String): kotlin.String {
|
|
2215
|
+
return FfiConverterString.lift(
|
|
2216
|
+
uniffiRustCall() { _status ->
|
|
2217
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_set_mark(
|
|
2218
|
+
FfiConverterULong.lower(`id`),FfiConverterString.lower(`markName`),FfiConverterString.lower(`attrsJson`),_status)
|
|
2219
|
+
}
|
|
2220
|
+
)
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
|
|
2224
|
+
/**
|
|
2225
|
+
* Set a mark with attrs at an explicit scalar selection. Returns an update JSON string.
|
|
2226
|
+
*/ fun `editorSetMarkAtSelectionScalar`(`id`: kotlin.ULong, `scalarAnchor`: kotlin.UInt, `scalarHead`: kotlin.UInt, `markName`: kotlin.String, `attrsJson`: kotlin.String): kotlin.String {
|
|
2227
|
+
return FfiConverterString.lift(
|
|
2228
|
+
uniffiRustCall() { _status ->
|
|
2229
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_set_mark_at_selection_scalar(
|
|
2230
|
+
FfiConverterULong.lower(`id`),FfiConverterUInt.lower(`scalarAnchor`),FfiConverterUInt.lower(`scalarHead`),FfiConverterString.lower(`markName`),FfiConverterString.lower(`attrsJson`),_status)
|
|
2231
|
+
}
|
|
2232
|
+
)
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
|
|
1884
2236
|
/**
|
|
1885
2237
|
* Set the selection. Anchor and head are document positions.
|
|
1886
2238
|
*/ fun `editorSetSelection`(`id`: kotlin.ULong, `anchor`: kotlin.UInt, `head`: kotlin.UInt)
|
|
@@ -1927,6 +2279,30 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
|
|
|
1927
2279
|
}
|
|
1928
2280
|
|
|
1929
2281
|
|
|
2282
|
+
/**
|
|
2283
|
+
* Toggle a blockquote around the current block selection. Returns an update JSON string.
|
|
2284
|
+
*/ fun `editorToggleBlockquote`(`id`: kotlin.ULong): kotlin.String {
|
|
2285
|
+
return FfiConverterString.lift(
|
|
2286
|
+
uniffiRustCall() { _status ->
|
|
2287
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_toggle_blockquote(
|
|
2288
|
+
FfiConverterULong.lower(`id`),_status)
|
|
2289
|
+
}
|
|
2290
|
+
)
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
|
|
2294
|
+
/**
|
|
2295
|
+
* Toggle a blockquote at an explicit scalar selection. Returns an update JSON string.
|
|
2296
|
+
*/ fun `editorToggleBlockquoteAtSelectionScalar`(`id`: kotlin.ULong, `scalarAnchor`: kotlin.UInt, `scalarHead`: kotlin.UInt): kotlin.String {
|
|
2297
|
+
return FfiConverterString.lift(
|
|
2298
|
+
uniffiRustCall() { _status ->
|
|
2299
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_toggle_blockquote_at_selection_scalar(
|
|
2300
|
+
FfiConverterULong.lower(`id`),FfiConverterUInt.lower(`scalarAnchor`),FfiConverterUInt.lower(`scalarHead`),_status)
|
|
2301
|
+
}
|
|
2302
|
+
)
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
|
|
1930
2306
|
/**
|
|
1931
2307
|
* Toggle a mark on the current selection. Returns an update JSON string.
|
|
1932
2308
|
*/ fun `editorToggleMark`(`id`: kotlin.ULong, `markName`: kotlin.String): kotlin.String {
|
|
@@ -1963,6 +2339,30 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
|
|
|
1963
2339
|
}
|
|
1964
2340
|
|
|
1965
2341
|
|
|
2342
|
+
/**
|
|
2343
|
+
* Remove a mark from the current selection. Returns an update JSON string.
|
|
2344
|
+
*/ fun `editorUnsetMark`(`id`: kotlin.ULong, `markName`: kotlin.String): kotlin.String {
|
|
2345
|
+
return FfiConverterString.lift(
|
|
2346
|
+
uniffiRustCall() { _status ->
|
|
2347
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_unset_mark(
|
|
2348
|
+
FfiConverterULong.lower(`id`),FfiConverterString.lower(`markName`),_status)
|
|
2349
|
+
}
|
|
2350
|
+
)
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
|
|
2354
|
+
/**
|
|
2355
|
+
* Remove a mark at an explicit scalar selection. Returns an update JSON string.
|
|
2356
|
+
*/ fun `editorUnsetMarkAtSelectionScalar`(`id`: kotlin.ULong, `scalarAnchor`: kotlin.UInt, `scalarHead`: kotlin.UInt, `markName`: kotlin.String): kotlin.String {
|
|
2357
|
+
return FfiConverterString.lift(
|
|
2358
|
+
uniffiRustCall() { _status ->
|
|
2359
|
+
UniffiLib.INSTANCE.uniffi_editor_core_fn_func_editor_unset_mark_at_selection_scalar(
|
|
2360
|
+
FfiConverterULong.lower(`id`),FfiConverterUInt.lower(`scalarAnchor`),FfiConverterUInt.lower(`scalarHead`),FfiConverterString.lower(`markName`),_status)
|
|
2361
|
+
}
|
|
2362
|
+
)
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
|
|
1966
2366
|
/**
|
|
1967
2367
|
* Unwrap the current list item back to a paragraph. Returns an update JSON string.
|
|
1968
2368
|
*/ fun `editorUnwrapFromList`(`id`: kotlin.ULong): kotlin.String {
|