@vector-im/matrix-wysiwyg 2.42.0 → 2.42.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vector-im/matrix-wysiwyg-wasm",
3
- "version": "2.42.0",
3
+ "version": "2.42.1",
4
4
  "homepage": "https://gitlab.com/andybalaam/wysiwyg-rust",
5
5
  "description": "WASM bindings for wysiwyg-rust",
6
6
  "license": "SEE LICENSE IN README.md",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vector-im/matrix-wysiwyg",
3
- "version": "2.42.0",
3
+ "version": "2.42.1",
4
4
  "type": "module",
5
5
  "description": "Wysiwyg composer for Element Web using React",
6
6
  "author": "New Vector Ltd.",
@@ -1,265 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- export function start(): void;
4
- export function new_composer_model(): ComposerModel;
5
- export function new_composer_model_from_html(html: string, start_utf16_codeunit: number, end_utf16_codeunit: number): ComposerModel;
6
- export enum ActionState {
7
- /**
8
- * The button can be clicked, and will perform its normal action
9
- * e.g. make something bold
10
- */
11
- Enabled = 0,
12
- /**
13
- * The button can be clicked, and will perform the reverse of its
14
- * normal action e.g. stop something being bold
15
- */
16
- Reversed = 1,
17
- /**
18
- * The button cannot be clicked
19
- */
20
- Disabled = 2,
21
- }
22
- export enum ComposerAction {
23
- Bold = 0,
24
- Italic = 1,
25
- StrikeThrough = 2,
26
- Underline = 3,
27
- InlineCode = 4,
28
- Link = 5,
29
- Undo = 6,
30
- Redo = 7,
31
- OrderedList = 8,
32
- UnorderedList = 9,
33
- Indent = 10,
34
- Unindent = 11,
35
- CodeBlock = 12,
36
- Quote = 13,
37
- }
38
- export enum DomCreationError {
39
- HtmlParseError = 0,
40
- MarkdownParseError = 1,
41
- }
42
- export enum HtmlSource {
43
- Matrix = 0,
44
- GoogleDoc = 1,
45
- UnknownExternal = 2,
46
- }
47
- export enum PatternKeyType {
48
- At = 0,
49
- Hash = 1,
50
- Slash = 2,
51
- Custom = 3,
52
- Colon = 4,
53
- }
54
- export class ComposerModel {
55
- private constructor();
56
- free(): void;
57
- code_block(): ComposerUpdate;
58
- delete_word(): ComposerUpdate;
59
- inline_code(): ComposerUpdate;
60
- ordered_list(): ComposerUpdate;
61
- remove_links(): ComposerUpdate;
62
- replace_html(new_html: string, external_source: HtmlSource): ComposerUpdate;
63
- replace_text(new_text: string): ComposerUpdate;
64
- action_states(): Map<any, any>;
65
- selection_end(): number;
66
- backspace_word(): ComposerUpdate;
67
- /**
68
- * Creates a mention node and inserts it into the composer at the current selection
69
- */
70
- insert_mention(url: string, text: string, attributes: Map<any, any>): ComposerUpdate;
71
- strike_through(): ComposerUpdate;
72
- unordered_list(): ComposerUpdate;
73
- get_link_action(): LinkAction;
74
- selection_start(): number;
75
- to_example_format(): string;
76
- set_link_with_text(url: string, text: string, attributes: Map<any, any>): ComposerUpdate;
77
- static from_example_format(text: string): ComposerModel;
78
- get_content_as_html(): string;
79
- set_content_from_html(text: string): ComposerUpdate;
80
- /**
81
- * Creates an at-room mention node and inserts it into the composer at the current selection
82
- */
83
- insert_at_room_mention(attributes: Map<any, any>): ComposerUpdate;
84
- get_content_as_markdown(): string;
85
- replace_text_suggestion(new_text: string, suggestion: SuggestionPattern, append_space: boolean): ComposerUpdate;
86
- get_content_as_plain_text(): string;
87
- set_content_from_markdown(text: string): ComposerUpdate;
88
- get_content_as_message_html(): string;
89
- /**
90
- * Creates a mention node and inserts it into the composer, replacing the
91
- * text content defined by the suggestion
92
- */
93
- insert_mention_at_suggestion(url: string, text: string, suggestion: SuggestionPattern, attributes: Map<any, any>): ComposerUpdate;
94
- set_custom_suggestion_patterns(custom_suggestion_patterns: Array<any>): void;
95
- get_content_as_message_markdown(): string;
96
- /**
97
- * Creates an at-room mention node and inserts it into the composer, replacing the
98
- * text content defined by the suggestion
99
- */
100
- insert_at_room_mention_at_suggestion(suggestion: SuggestionPattern, attributes: Map<any, any>): ComposerUpdate;
101
- static new(): ComposerModel;
102
- bold(): ComposerUpdate;
103
- redo(): ComposerUpdate;
104
- undo(): ComposerUpdate;
105
- clear(): ComposerUpdate;
106
- enter(): ComposerUpdate;
107
- quote(): ComposerUpdate;
108
- delete(): ComposerUpdate;
109
- indent(): ComposerUpdate;
110
- italic(): ComposerUpdate;
111
- select(start_utf16_codeunit: number, end_utf16_codeunit: number): ComposerUpdate;
112
- document(): DomHandle;
113
- set_link(url: string, attributes: Map<any, any>): ComposerUpdate;
114
- unindent(): ComposerUpdate;
115
- backspace(): ComposerUpdate;
116
- underline(): ComposerUpdate;
117
- }
118
- export class ComposerUpdate {
119
- private constructor();
120
- free(): void;
121
- menu_state(): MenuState;
122
- menu_action(): MenuAction;
123
- text_update(): TextUpdate;
124
- }
125
- export class Create {
126
- private constructor();
127
- free(): void;
128
- }
129
- export class CreateWithText {
130
- private constructor();
131
- free(): void;
132
- }
133
- export class Disabled {
134
- private constructor();
135
- free(): void;
136
- }
137
- /**
138
- * An iterator-like view of a DomHandle's children, written to work around
139
- * the lack of support for returning Vec<T> in wasm_bindgen.
140
- */
141
- export class DomChildren {
142
- private constructor();
143
- free(): void;
144
- next_child(): DomHandle | undefined;
145
- }
146
- /**
147
- * Refers to a node in the composer model.
148
- */
149
- export class DomHandle {
150
- private constructor();
151
- free(): void;
152
- /**
153
- * Returns our tagname, or "-text-"/"-zwsp-" if we are a text/zwsp node.
154
- * Panics if we are not a valid reference (because the model has changed
155
- * since we were created, or because you passed in a different model
156
- * from the one that created us.)
157
- */
158
- tag(model: ComposerModel): string;
159
- /**
160
- * Returns the text of this node, or an empty string if this is a
161
- * container or line break.
162
- * Panics if we are not a valid reference (because the model has changed
163
- * since we were created, or because you passed in a different model
164
- * from the one that created us.)
165
- */
166
- text(model: ComposerModel): string;
167
- /**
168
- * Returns a list of our children nodes, or an empty list if we refer
169
- * to a text or line break node.
170
- * Panics if we are not a valid reference (because the model has changed
171
- * since we were created, or because you passed in a different model
172
- * from the one that created us.)
173
- */
174
- children(model: ComposerModel): DomChildren;
175
- /**
176
- * Returns "container", "line_break", "text" or "zwsp" depending on the type of
177
- * node we refer to.
178
- * Panics if we are not a valid reference (because the model has changed
179
- * since we were created, or because you passed in a different model
180
- * from the one that created us.)
181
- */
182
- node_type(model: ComposerModel): string;
183
- }
184
- export class Edit {
185
- private constructor();
186
- free(): void;
187
- url: string;
188
- }
189
- export class Keep {
190
- private constructor();
191
- free(): void;
192
- }
193
- export class LinkAction {
194
- private constructor();
195
- free(): void;
196
- get create_with_text(): CreateWithText | undefined;
197
- set create_with_text(value: CreateWithText | null | undefined);
198
- get create(): Create | undefined;
199
- set create(value: Create | null | undefined);
200
- get edit_link(): Edit | undefined;
201
- set edit_link(value: Edit | null | undefined);
202
- get disabled(): Disabled | undefined;
203
- set disabled(value: Disabled | null | undefined);
204
- }
205
- export class MenuAction {
206
- private constructor();
207
- free(): void;
208
- suggestion(): MenuActionSuggestion | undefined;
209
- keep(): boolean;
210
- none(): boolean;
211
- }
212
- export class MenuActionSuggestion {
213
- private constructor();
214
- free(): void;
215
- suggestion_pattern: SuggestionPattern;
216
- }
217
- export class MenuState {
218
- private constructor();
219
- free(): void;
220
- keep(): boolean;
221
- update(): MenuStateUpdate | undefined;
222
- }
223
- export class MenuStateUpdate {
224
- private constructor();
225
- free(): void;
226
- action_states: Map<any, any>;
227
- }
228
- export class PatternKey {
229
- private constructor();
230
- free(): void;
231
- key_type: PatternKeyType;
232
- get custom_key_value(): string | undefined;
233
- set custom_key_value(value: string | null | undefined);
234
- }
235
- export class ReplaceAll {
236
- private constructor();
237
- free(): void;
238
- replacement_html: string;
239
- start_utf16_codeunit: number;
240
- end_utf16_codeunit: number;
241
- }
242
- export class Selection {
243
- private constructor();
244
- free(): void;
245
- start_utf16_codeunit: number;
246
- end_utf16_codeunit: number;
247
- }
248
- export class SuggestionPattern {
249
- private constructor();
250
- free(): void;
251
- key: PatternKey;
252
- text: string;
253
- start: number;
254
- end: number;
255
- }
256
- export class TextUpdate {
257
- private constructor();
258
- free(): void;
259
- get keep(): Keep | undefined;
260
- set keep(value: Keep | null | undefined);
261
- get replace_all(): ReplaceAll | undefined;
262
- set replace_all(value: ReplaceAll | null | undefined);
263
- get select(): Selection | undefined;
264
- set select(value: Selection | null | undefined);
265
- }