@vector-im/matrix-wysiwyg 2.40.0 → 2.42.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/dist/lib/constants.d.ts +2 -0
- package/dist/lib/conversion.d.ts +4 -0
- package/dist/lib/types.d.ts +36 -0
- package/dist/lib/useComposerModel.d.ts +11 -0
- package/dist/lib/useListeners/types.d.ts +27 -0
- package/dist/lib/useTestCases/types.d.ts +5 -0
- package/dist/lib/useWysiwyg.d.ts +26 -0
- package/dist/matrix-wysiwyg.js +814 -996
- package/dist/matrix-wysiwyg.umd.cjs +4 -11
- package/node_modules/@vector-im/matrix-wysiwyg-wasm/package.json +7 -6
- package/node_modules/@vector-im/matrix-wysiwyg-wasm/pkg/wysiwyg.d.ts +55 -55
- package/node_modules/@vector-im/matrix-wysiwyg-wasm/pkg/wysiwyg_bg.cjs +299 -299
- package/node_modules/@vector-im/matrix-wysiwyg-wasm/pkg/wysiwyg_bg.js +301 -300
- package/node_modules/@vector-im/matrix-wysiwyg-wasm/pkg/wysiwyg_bg.wasm +0 -0
- package/node_modules/@vector-im/matrix-wysiwyg-wasm/pkg/wysiwyg_bg.wasm.d.ts +103 -103
- package/package.json +22 -21
- package/dist/index.d.ts +0 -98
|
Binary file
|
|
@@ -1,129 +1,129 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const start: () => void;
|
|
5
|
-
export const new_composer_model_from_html: (a: number, b: number, c: number, d: number) => number;
|
|
6
4
|
export const __wbg_composermodel_free: (a: number, b: number) => void;
|
|
7
|
-
export const
|
|
5
|
+
export const __wbg_composerupdate_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_create_free: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_domchildren_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_domhandle_free: (a: number, b: number) => void;
|
|
9
|
+
export const __wbg_edit_free: (a: number, b: number) => void;
|
|
10
|
+
export const __wbg_get_edit_url: (a: number) => [number, number];
|
|
11
|
+
export const __wbg_get_linkaction_create: (a: number) => number;
|
|
12
|
+
export const __wbg_get_linkaction_create_with_text: (a: number) => number;
|
|
13
|
+
export const __wbg_get_linkaction_disabled: (a: number) => number;
|
|
14
|
+
export const __wbg_get_linkaction_edit_link: (a: number) => number;
|
|
15
|
+
export const __wbg_get_menuactionsuggestion_suggestion_pattern: (a: number) => number;
|
|
16
|
+
export const __wbg_get_menustateupdate_action_states: (a: number) => any;
|
|
17
|
+
export const __wbg_get_patternkey_custom_key_value: (a: number) => [number, number];
|
|
18
|
+
export const __wbg_get_patternkey_key_type: (a: number) => number;
|
|
19
|
+
export const __wbg_get_replaceall_end_utf16_codeunit: (a: number) => number;
|
|
20
|
+
export const __wbg_get_replaceall_start_utf16_codeunit: (a: number) => number;
|
|
21
|
+
export const __wbg_get_selection_end_utf16_codeunit: (a: number) => number;
|
|
22
|
+
export const __wbg_get_selection_start_utf16_codeunit: (a: number) => number;
|
|
23
|
+
export const __wbg_get_suggestionpattern_end: (a: number) => number;
|
|
24
|
+
export const __wbg_get_suggestionpattern_key: (a: number) => number;
|
|
25
|
+
export const __wbg_get_suggestionpattern_start: (a: number) => number;
|
|
26
|
+
export const __wbg_get_textupdate_keep: (a: number) => number;
|
|
27
|
+
export const __wbg_get_textupdate_replace_all: (a: number) => number;
|
|
28
|
+
export const __wbg_get_textupdate_select: (a: number) => number;
|
|
29
|
+
export const __wbg_linkaction_free: (a: number, b: number) => void;
|
|
30
|
+
export const __wbg_menuaction_free: (a: number, b: number) => void;
|
|
31
|
+
export const __wbg_menuactionsuggestion_free: (a: number, b: number) => void;
|
|
32
|
+
export const __wbg_menustate_free: (a: number, b: number) => void;
|
|
33
|
+
export const __wbg_menustateupdate_free: (a: number, b: number) => void;
|
|
34
|
+
export const __wbg_patternkey_free: (a: number, b: number) => void;
|
|
35
|
+
export const __wbg_replaceall_free: (a: number, b: number) => void;
|
|
36
|
+
export const __wbg_selection_free: (a: number, b: number) => void;
|
|
37
|
+
export const __wbg_set_edit_url: (a: number, b: number, c: number) => void;
|
|
38
|
+
export const __wbg_set_linkaction_create: (a: number, b: number) => void;
|
|
39
|
+
export const __wbg_set_linkaction_create_with_text: (a: number, b: number) => void;
|
|
40
|
+
export const __wbg_set_linkaction_disabled: (a: number, b: number) => void;
|
|
41
|
+
export const __wbg_set_linkaction_edit_link: (a: number, b: number) => void;
|
|
42
|
+
export const __wbg_set_menuactionsuggestion_suggestion_pattern: (a: number, b: number) => void;
|
|
43
|
+
export const __wbg_set_menustateupdate_action_states: (a: number, b: any) => void;
|
|
44
|
+
export const __wbg_set_patternkey_custom_key_value: (a: number, b: number, c: number) => void;
|
|
45
|
+
export const __wbg_set_patternkey_key_type: (a: number, b: number) => void;
|
|
46
|
+
export const __wbg_set_replaceall_end_utf16_codeunit: (a: number, b: number) => void;
|
|
47
|
+
export const __wbg_set_replaceall_start_utf16_codeunit: (a: number, b: number) => void;
|
|
48
|
+
export const __wbg_set_selection_end_utf16_codeunit: (a: number, b: number) => void;
|
|
49
|
+
export const __wbg_set_selection_start_utf16_codeunit: (a: number, b: number) => void;
|
|
50
|
+
export const __wbg_set_suggestionpattern_end: (a: number, b: number) => void;
|
|
51
|
+
export const __wbg_set_suggestionpattern_key: (a: number, b: number) => void;
|
|
52
|
+
export const __wbg_set_suggestionpattern_start: (a: number, b: number) => void;
|
|
53
|
+
export const __wbg_set_textupdate_keep: (a: number, b: number) => void;
|
|
54
|
+
export const __wbg_set_textupdate_replace_all: (a: number, b: number) => void;
|
|
55
|
+
export const __wbg_set_textupdate_select: (a: number, b: number) => void;
|
|
56
|
+
export const __wbg_suggestionpattern_free: (a: number, b: number) => void;
|
|
57
|
+
export const __wbg_textupdate_free: (a: number, b: number) => void;
|
|
58
|
+
export const composermodel_action_states: (a: number) => any;
|
|
59
|
+
export const composermodel_backspace: (a: number) => number;
|
|
60
|
+
export const composermodel_backspace_word: (a: number) => number;
|
|
61
|
+
export const composermodel_bold: (a: number) => number;
|
|
62
|
+
export const composermodel_clear: (a: number) => number;
|
|
63
|
+
export const composermodel_code_block: (a: number) => number;
|
|
64
|
+
export const composermodel_delete: (a: number) => number;
|
|
65
|
+
export const composermodel_delete_word: (a: number) => number;
|
|
66
|
+
export const composermodel_document: (a: number) => number;
|
|
67
|
+
export const composermodel_enter: (a: number) => number;
|
|
8
68
|
export const composermodel_from_example_format: (a: number, b: number) => number;
|
|
9
|
-
export const composermodel_to_example_format: (a: number) => [number, number];
|
|
10
69
|
export const composermodel_get_content_as_html: (a: number) => [number, number];
|
|
11
|
-
export const composermodel_get_content_as_message_html: (a: number) => [number, number];
|
|
12
70
|
export const composermodel_get_content_as_markdown: (a: number) => [number, number];
|
|
71
|
+
export const composermodel_get_content_as_message_html: (a: number) => [number, number];
|
|
13
72
|
export const composermodel_get_content_as_message_markdown: (a: number) => [number, number];
|
|
14
73
|
export const composermodel_get_content_as_plain_text: (a: number) => [number, number];
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
74
|
+
export const composermodel_get_link_action: (a: number) => number;
|
|
75
|
+
export const composermodel_indent: (a: number) => number;
|
|
76
|
+
export const composermodel_inline_code: (a: number) => number;
|
|
77
|
+
export const composermodel_insert_at_room_mention: (a: number, b: any) => number;
|
|
78
|
+
export const composermodel_insert_at_room_mention_at_suggestion: (a: number, b: number, c: any) => number;
|
|
79
|
+
export const composermodel_insert_mention: (a: number, b: number, c: number, d: number, e: number, f: any) => number;
|
|
80
|
+
export const composermodel_insert_mention_at_suggestion: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => number;
|
|
81
|
+
export const composermodel_italic: (a: number) => number;
|
|
82
|
+
export const composermodel_new: () => number;
|
|
83
|
+
export const composermodel_ordered_list: (a: number) => number;
|
|
84
|
+
export const composermodel_quote: (a: number) => number;
|
|
85
|
+
export const composermodel_redo: (a: number) => number;
|
|
86
|
+
export const composermodel_remove_links: (a: number) => number;
|
|
21
87
|
export const composermodel_replace_html: (a: number, b: number, c: number, d: number) => number;
|
|
88
|
+
export const composermodel_replace_text: (a: number, b: number, c: number) => number;
|
|
22
89
|
export const composermodel_replace_text_suggestion: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
90
|
+
export const composermodel_select: (a: number, b: number, c: number) => number;
|
|
91
|
+
export const composermodel_selection_end: (a: number) => number;
|
|
92
|
+
export const composermodel_selection_start: (a: number) => number;
|
|
23
93
|
export const composermodel_set_content_from_html: (a: number, b: number, c: number) => [number, number, number];
|
|
24
94
|
export const composermodel_set_content_from_markdown: (a: number, b: number, c: number) => [number, number, number];
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const composermodel_backspace_word: (a: number) => number;
|
|
29
|
-
export const composermodel_delete: (a: number) => number;
|
|
30
|
-
export const composermodel_delete_word: (a: number) => number;
|
|
31
|
-
export const composermodel_bold: (a: number) => number;
|
|
32
|
-
export const composermodel_italic: (a: number) => number;
|
|
95
|
+
export const composermodel_set_custom_suggestion_patterns: (a: number, b: any) => void;
|
|
96
|
+
export const composermodel_set_link: (a: number, b: number, c: number, d: any) => number;
|
|
97
|
+
export const composermodel_set_link_with_text: (a: number, b: number, c: number, d: number, e: number, f: any) => number;
|
|
33
98
|
export const composermodel_strike_through: (a: number) => number;
|
|
99
|
+
export const composermodel_to_example_format: (a: number) => [number, number];
|
|
34
100
|
export const composermodel_underline: (a: number) => number;
|
|
35
|
-
export const composermodel_quote: (a: number) => number;
|
|
36
|
-
export const composermodel_inline_code: (a: number) => number;
|
|
37
|
-
export const composermodel_code_block: (a: number) => number;
|
|
38
101
|
export const composermodel_undo: (a: number) => number;
|
|
39
|
-
export const composermodel_redo: (a: number) => number;
|
|
40
|
-
export const composermodel_ordered_list: (a: number) => number;
|
|
41
|
-
export const composermodel_unordered_list: (a: number) => number;
|
|
42
|
-
export const composermodel_indent: (a: number) => number;
|
|
43
102
|
export const composermodel_unindent: (a: number) => number;
|
|
44
|
-
export const
|
|
45
|
-
export const composermodel_set_link: (a: number, b: number, c: number, d: any) => number;
|
|
46
|
-
export const composermodel_set_link_with_text: (a: number, b: number, c: number, d: number, e: number, f: any) => number;
|
|
47
|
-
export const composermodel_set_custom_suggestion_patterns: (a: number, b: any) => void;
|
|
48
|
-
export const composermodel_insert_at_room_mention: (a: number, b: any) => number;
|
|
49
|
-
export const composermodel_insert_mention: (a: number, b: number, c: number, d: number, e: number, f: any) => number;
|
|
50
|
-
export const composermodel_insert_at_room_mention_at_suggestion: (a: number, b: number, c: any) => number;
|
|
51
|
-
export const composermodel_insert_mention_at_suggestion: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => number;
|
|
52
|
-
export const composermodel_remove_links: (a: number) => number;
|
|
53
|
-
export const __wbg_composerupdate_free: (a: number, b: number) => void;
|
|
54
|
-
export const composerupdate_text_update: (a: number) => number;
|
|
55
|
-
export const composerupdate_menu_state: (a: number) => number;
|
|
103
|
+
export const composermodel_unordered_list: (a: number) => number;
|
|
56
104
|
export const composerupdate_menu_action: (a: number) => number;
|
|
57
|
-
export const
|
|
58
|
-
export const
|
|
59
|
-
export const __wbg_set_textupdate_keep: (a: number, b: number) => void;
|
|
60
|
-
export const __wbg_get_textupdate_replace_all: (a: number) => number;
|
|
61
|
-
export const __wbg_set_textupdate_replace_all: (a: number, b: number) => void;
|
|
62
|
-
export const __wbg_get_textupdate_select: (a: number) => number;
|
|
63
|
-
export const __wbg_set_textupdate_select: (a: number, b: number) => void;
|
|
64
|
-
export const __wbg_replaceall_free: (a: number, b: number) => void;
|
|
65
|
-
export const __wbg_get_replaceall_start_utf16_codeunit: (a: number) => number;
|
|
66
|
-
export const __wbg_set_replaceall_start_utf16_codeunit: (a: number, b: number) => void;
|
|
67
|
-
export const __wbg_get_replaceall_end_utf16_codeunit: (a: number) => number;
|
|
68
|
-
export const __wbg_set_replaceall_end_utf16_codeunit: (a: number, b: number) => void;
|
|
69
|
-
export const __wbg_selection_free: (a: number, b: number) => void;
|
|
70
|
-
export const __wbg_get_selection_start_utf16_codeunit: (a: number) => number;
|
|
71
|
-
export const __wbg_set_selection_start_utf16_codeunit: (a: number, b: number) => void;
|
|
72
|
-
export const __wbg_get_selection_end_utf16_codeunit: (a: number) => number;
|
|
73
|
-
export const __wbg_set_selection_end_utf16_codeunit: (a: number, b: number) => void;
|
|
74
|
-
export const __wbg_menustate_free: (a: number, b: number) => void;
|
|
75
|
-
export const menustate_keep: (a: number) => number;
|
|
76
|
-
export const menustate_update: (a: number) => number;
|
|
77
|
-
export const __wbg_menustateupdate_free: (a: number, b: number) => void;
|
|
78
|
-
export const __wbg_get_menustateupdate_action_states: (a: number) => any;
|
|
79
|
-
export const __wbg_set_menustateupdate_action_states: (a: number, b: any) => void;
|
|
80
|
-
export const __wbg_menuaction_free: (a: number, b: number) => void;
|
|
81
|
-
export const menuaction_keep: (a: number) => number;
|
|
82
|
-
export const menuaction_none: (a: number) => number;
|
|
83
|
-
export const menuaction_suggestion: (a: number) => number;
|
|
84
|
-
export const __wbg_menuactionsuggestion_free: (a: number, b: number) => void;
|
|
85
|
-
export const __wbg_get_menuactionsuggestion_suggestion_pattern: (a: number) => number;
|
|
86
|
-
export const __wbg_set_menuactionsuggestion_suggestion_pattern: (a: number, b: number) => void;
|
|
87
|
-
export const __wbg_suggestionpattern_free: (a: number, b: number) => void;
|
|
88
|
-
export const __wbg_get_suggestionpattern_key: (a: number) => number;
|
|
89
|
-
export const __wbg_set_suggestionpattern_key: (a: number, b: number) => void;
|
|
90
|
-
export const __wbg_get_suggestionpattern_start: (a: number) => number;
|
|
91
|
-
export const __wbg_set_suggestionpattern_start: (a: number, b: number) => void;
|
|
92
|
-
export const __wbg_get_suggestionpattern_end: (a: number) => number;
|
|
93
|
-
export const __wbg_set_suggestionpattern_end: (a: number, b: number) => void;
|
|
94
|
-
export const __wbg_patternkey_free: (a: number, b: number) => void;
|
|
95
|
-
export const __wbg_get_patternkey_key_type: (a: number) => number;
|
|
96
|
-
export const __wbg_set_patternkey_key_type: (a: number, b: number) => void;
|
|
97
|
-
export const __wbg_get_patternkey_custom_key_value: (a: number) => [number, number];
|
|
98
|
-
export const __wbg_set_patternkey_custom_key_value: (a: number, b: number, c: number) => void;
|
|
99
|
-
export const __wbg_domchildren_free: (a: number, b: number) => void;
|
|
105
|
+
export const composerupdate_menu_state: (a: number) => number;
|
|
106
|
+
export const composerupdate_text_update: (a: number) => number;
|
|
100
107
|
export const domchildren_next_child: (a: number) => number;
|
|
101
|
-
export const __wbg_domhandle_free: (a: number, b: number) => void;
|
|
102
|
-
export const domhandle_node_type: (a: number, b: number) => [number, number];
|
|
103
108
|
export const domhandle_children: (a: number, b: number) => number;
|
|
104
|
-
export const
|
|
109
|
+
export const domhandle_node_type: (a: number, b: number) => [number, number];
|
|
105
110
|
export const domhandle_tag: (a: number, b: number) => [number, number];
|
|
106
|
-
export const
|
|
107
|
-
export const
|
|
108
|
-
export const
|
|
109
|
-
export const
|
|
110
|
-
export const
|
|
111
|
-
export const
|
|
112
|
-
export const
|
|
113
|
-
export const
|
|
114
|
-
export const __wbg_set_linkaction_create: (a: number, b: number) => void;
|
|
115
|
-
export const __wbg_get_linkaction_edit_link: (a: number) => number;
|
|
116
|
-
export const __wbg_set_linkaction_edit_link: (a: number, b: number) => void;
|
|
117
|
-
export const __wbg_get_linkaction_disabled: (a: number) => number;
|
|
118
|
-
export const __wbg_set_linkaction_disabled: (a: number, b: number) => void;
|
|
119
|
-
export const __wbg_set_suggestionpattern_text: (a: number, b: number, c: number) => void;
|
|
111
|
+
export const domhandle_text: (a: number, b: number) => [number, number];
|
|
112
|
+
export const menuaction_keep: (a: number) => number;
|
|
113
|
+
export const menuaction_none: (a: number) => number;
|
|
114
|
+
export const menuaction_suggestion: (a: number) => number;
|
|
115
|
+
export const menustate_keep: (a: number) => number;
|
|
116
|
+
export const menustate_update: (a: number) => number;
|
|
117
|
+
export const new_composer_model_from_html: (a: number, b: number, c: number, d: number) => number;
|
|
118
|
+
export const start: () => void;
|
|
120
119
|
export const __wbg_set_replaceall_replacement_html: (a: number, b: number, c: number) => void;
|
|
121
|
-
export const
|
|
122
|
-
export const __wbg_get_replaceall_replacement_html: (a: number) => [number, number];
|
|
120
|
+
export const __wbg_set_suggestionpattern_text: (a: number, b: number, c: number) => void;
|
|
123
121
|
export const new_composer_model: () => number;
|
|
124
|
-
export const __wbg_keep_free: (a: number, b: number) => void;
|
|
125
122
|
export const __wbg_createwithtext_free: (a: number, b: number) => void;
|
|
126
123
|
export const __wbg_disabled_free: (a: number, b: number) => void;
|
|
124
|
+
export const __wbg_keep_free: (a: number, b: number) => void;
|
|
125
|
+
export const __wbg_get_replaceall_replacement_html: (a: number) => [number, number];
|
|
126
|
+
export const __wbg_get_suggestionpattern_text: (a: number) => [number, number];
|
|
127
127
|
export const __externref_table_alloc: () => number;
|
|
128
128
|
export const __wbindgen_export_1: WebAssembly.Table;
|
|
129
129
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
@@ -131,6 +131,6 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
131
131
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
132
132
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
133
133
|
export const __externref_table_dealloc: (a: number) => void;
|
|
134
|
-
export const
|
|
135
|
-
export const
|
|
134
|
+
export const closure84_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
135
|
+
export const closure78_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
136
136
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vector-im/matrix-wysiwyg",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.42.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Wysiwyg composer for Element Web using React",
|
|
6
6
|
"author": "New Vector Ltd.",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"license": "SEE LICENSE IN README.md",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
14
15
|
"import": "./dist/matrix-wysiwyg.js",
|
|
15
16
|
"require": "./dist/matrix-wysiwyg.umd.cjs"
|
|
16
17
|
}
|
|
@@ -30,8 +31,7 @@
|
|
|
30
31
|
"typecheck": "tsc --noEmit",
|
|
31
32
|
"lint": "eslint .",
|
|
32
33
|
"test": "vitest --run --pool=forks",
|
|
33
|
-
"test:
|
|
34
|
-
"test:cypress:open": "cypress open",
|
|
34
|
+
"test:e2e": "playwright test",
|
|
35
35
|
"test:watch": "vitest --pool=forks",
|
|
36
36
|
"test:ui": "vitest --ui",
|
|
37
37
|
"coverage": "vitest run --coverage --pool=forks",
|
|
@@ -41,45 +41,46 @@
|
|
|
41
41
|
"react": "^18.2.0 || ^19.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
+
"@playwright/test": "^1.58.0",
|
|
44
45
|
"@stylistic/eslint-plugin": "^5.0.0",
|
|
45
46
|
"@testing-library/dom": "^10.0.0",
|
|
46
47
|
"@testing-library/jest-dom": "^6.0.0",
|
|
47
48
|
"@testing-library/react": "^16.0.0",
|
|
48
49
|
"@testing-library/user-event": "^14.4.3",
|
|
49
|
-
"@types/jest": "^
|
|
50
|
+
"@types/jest": "^30.0.0",
|
|
50
51
|
"@types/react": "^19.0.0",
|
|
51
52
|
"@types/react-dom": "^19.0.0",
|
|
52
53
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
53
54
|
"@typescript-eslint/parser": "^8.0.0",
|
|
54
|
-
"@vitejs/plugin-react": "^
|
|
55
|
-
"@vitest/coverage-v8": "^
|
|
56
|
-
"@vitest/ui": "^
|
|
57
|
-
"
|
|
58
|
-
"eslint": "^9.20.0",
|
|
55
|
+
"@vitejs/plugin-react": "^6.0.0",
|
|
56
|
+
"@vitest/coverage-v8": "^4.0.0",
|
|
57
|
+
"@vitest/ui": "^4.0.0",
|
|
58
|
+
"eslint": "^8.57.0",
|
|
59
59
|
"eslint-config-google": "^0.14.0",
|
|
60
60
|
"eslint-config-prettier": "^10.0.0",
|
|
61
|
-
"eslint-plugin-deprecate": "^0.
|
|
61
|
+
"eslint-plugin-deprecate": "^0.9.0",
|
|
62
62
|
"eslint-plugin-import": "^2.26.0",
|
|
63
63
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
64
|
-
"eslint-plugin-matrix-org": "^
|
|
64
|
+
"eslint-plugin-matrix-org": "^3.0.0",
|
|
65
65
|
"eslint-plugin-prettier": "^5.0.0",
|
|
66
66
|
"eslint-plugin-react": "^7.31.8",
|
|
67
|
-
"eslint-plugin-react-hooks": "^
|
|
68
|
-
"eslint-plugin-unicorn": "^
|
|
69
|
-
"jest-environment-jsdom": "^
|
|
70
|
-
"prettier": "3.
|
|
67
|
+
"eslint-plugin-react-hooks": "^7.0.0",
|
|
68
|
+
"eslint-plugin-unicorn": "^56.0.0",
|
|
69
|
+
"jest-environment-jsdom": "^30.0.0",
|
|
70
|
+
"prettier": "3.8.4",
|
|
71
71
|
"react": "^19.0.0",
|
|
72
72
|
"react-dom": "^19.0.0",
|
|
73
|
-
"typescript": "^
|
|
74
|
-
"vite": "
|
|
75
|
-
"vite-plugin-dts": "^
|
|
76
|
-
"vitest": "^
|
|
77
|
-
"vitest-sonar-reporter": "^
|
|
73
|
+
"typescript": "^6.0.0",
|
|
74
|
+
"vite": "^8.0.0",
|
|
75
|
+
"vite-plugin-dts": "^5.0.0",
|
|
76
|
+
"vitest": "^4.0.0",
|
|
77
|
+
"vitest-sonar-reporter": "^3.0.0"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@vector-im/matrix-wysiwyg-wasm": "link:../../bindings/wysiwyg-wasm"
|
|
81
81
|
},
|
|
82
82
|
"bundledDependencies": [
|
|
83
83
|
"@vector-im/matrix-wysiwyg-wasm"
|
|
84
|
-
]
|
|
84
|
+
],
|
|
85
|
+
"packageManager": "yarn@4.16.0"
|
|
85
86
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { ComposerUpdate } from '@vector-im/matrix-wysiwyg-wasm';
|
|
2
|
-
import { RefObject } from 'react';
|
|
3
|
-
|
|
4
|
-
export declare const ACTION_TYPES: readonly ["bold", "italic", "strikeThrough", "underline", "undo", "redo", "orderedList", "unorderedList", "inlineCode", "clear", "link", "codeBlock", "quote", "indent", "unindent"];
|
|
5
|
-
|
|
6
|
-
export declare type ActionState = 'enabled' | 'reversed' | 'disabled';
|
|
7
|
-
|
|
8
|
-
export declare type ActionTypes = (typeof ACTION_TYPES)[number];
|
|
9
|
-
|
|
10
|
-
export declare type AllActionStates = Record<ActionTypes, ActionState>;
|
|
11
|
-
|
|
12
|
-
export declare type AllowedMentionAttributes = Map<'style' | 'data-mention-type', string>;
|
|
13
|
-
|
|
14
|
-
export declare type BlockType = InputEvent['inputType'] | 'formatInlineCode' | 'clear';
|
|
15
|
-
|
|
16
|
-
export declare type FormattingFunctions = Record<Exclude<ActionTypes, 'link'>, () => void> & {
|
|
17
|
-
insertText: (text: string) => void;
|
|
18
|
-
link: (url: string, text?: string) => void;
|
|
19
|
-
mention: (url: string, text: string, attributes: AllowedMentionAttributes) => void;
|
|
20
|
-
mentionAtRoom: (attributes: AllowedMentionAttributes) => void;
|
|
21
|
-
command: (text: string) => void;
|
|
22
|
-
emoji: (text: string) => void;
|
|
23
|
-
removeLinks: () => void;
|
|
24
|
-
getLink: () => string;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Initialise the WASM module, or do nothing if it is already initialised.
|
|
29
|
-
*/
|
|
30
|
-
export declare function initOnce(): Promise<void>;
|
|
31
|
-
|
|
32
|
-
export declare type InputEventProcessor = (event: WysiwygEvent, wysiwyg: Wysiwyg, editor: HTMLElement) => WysiwygEvent | null;
|
|
33
|
-
|
|
34
|
-
export declare type LinkEvent = Omit<InputEvent, 'data'> & {
|
|
35
|
-
inputType: 'insertLink';
|
|
36
|
-
data: {
|
|
37
|
-
url: string;
|
|
38
|
-
text?: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export declare type MappedSuggestion = {
|
|
43
|
-
keyChar: SuggestionChar;
|
|
44
|
-
text: string;
|
|
45
|
-
type: SuggestionType;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export declare function plainToRich(plainText: string, inMessageFormat: boolean): Promise<string>;
|
|
49
|
-
|
|
50
|
-
export declare function richToPlain(richText: string, inMessageFormat: boolean): Promise<string>;
|
|
51
|
-
|
|
52
|
-
export declare type SuggestionChar = (typeof SUGGESTIONS)[number] | '';
|
|
53
|
-
|
|
54
|
-
export declare const SUGGESTIONS: readonly ["@", "#", "/", "", ":"];
|
|
55
|
-
|
|
56
|
-
export declare type SuggestionType = 'mention' | 'command' | 'custom' | 'emoji' | 'unknown';
|
|
57
|
-
|
|
58
|
-
export declare type TraceAction = (update: ComposerUpdate | null, name: string, value1?: string | number, value2?: string | number) => ComposerUpdate | null;
|
|
59
|
-
|
|
60
|
-
export declare type UseWysiwyg = {
|
|
61
|
-
ref: RefObject<HTMLDivElement | null>;
|
|
62
|
-
isWysiwygReady: boolean;
|
|
63
|
-
wysiwyg: FormattingFunctions;
|
|
64
|
-
content: string | null;
|
|
65
|
-
actionStates: AllActionStates;
|
|
66
|
-
debug: {
|
|
67
|
-
modelRef: RefObject<HTMLDivElement | null>;
|
|
68
|
-
testRef: RefObject<HTMLDivElement | null>;
|
|
69
|
-
resetTestCase: () => void | null;
|
|
70
|
-
traceAction: TraceAction;
|
|
71
|
-
};
|
|
72
|
-
suggestion: MappedSuggestion | null;
|
|
73
|
-
messageContent: string | null;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export declare function useWysiwyg(wysiwygProps?: WysiwygProps): UseWysiwyg;
|
|
77
|
-
|
|
78
|
-
export declare type Wysiwyg = {
|
|
79
|
-
actions: FormattingFunctions;
|
|
80
|
-
content: () => string;
|
|
81
|
-
messageContent: () => string;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export declare type WysiwygEvent = WysiwygInputEvent | KeyboardEvent;
|
|
85
|
-
|
|
86
|
-
export declare type WysiwygInputEvent = ClipboardEvent | LinkEvent | (InputEvent & {
|
|
87
|
-
inputType: BlockType;
|
|
88
|
-
data?: string | null;
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
export declare type WysiwygProps = {
|
|
92
|
-
isAutoFocusEnabled?: boolean;
|
|
93
|
-
inputEventProcessor?: InputEventProcessor;
|
|
94
|
-
initialContent?: string;
|
|
95
|
-
emojiSuggestions?: Map<string, string>;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export { }
|