@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.
@@ -110,6 +110,18 @@ function handleError(f, args) {
110
110
  }
111
111
  }
112
112
 
113
+ function takeFromExternrefTable0(idx) {
114
+ const value = wasm.__wbindgen_export_1.get(idx);
115
+ wasm.__externref_table_dealloc(idx);
116
+ return value;
117
+ }
118
+
119
+ function _assertClass(instance, klass) {
120
+ if (!(instance instanceof klass)) {
121
+ throw new Error(`expected instance of ${klass.name}`);
122
+ }
123
+ }
124
+
113
125
  export function start() {
114
126
  wasm.start();
115
127
  }
@@ -135,23 +147,12 @@ export function new_composer_model_from_html(html, start_utf16_codeunit, end_utf
135
147
  return ComposerModel.__wrap(ret);
136
148
  }
137
149
 
138
- function _assertClass(instance, klass) {
139
- if (!(instance instanceof klass)) {
140
- throw new Error(`expected instance of ${klass.name}`);
141
- }
142
- }
143
-
144
- function takeFromExternrefTable0(idx) {
145
- const value = wasm.__wbindgen_export_1.get(idx);
146
- wasm.__externref_table_dealloc(idx);
147
- return value;
148
- }
149
- function __wbg_adapter_124(arg0, arg1, arg2, arg3, arg4) {
150
- wasm.closure102_externref_shim(arg0, arg1, arg2, arg3, arg4);
150
+ function __wbg_adapter_124(arg0, arg1, arg2, arg3) {
151
+ wasm.closure84_externref_shim(arg0, arg1, arg2, arg3);
151
152
  }
152
153
 
153
- function __wbg_adapter_127(arg0, arg1, arg2, arg3) {
154
- wasm.closure105_externref_shim(arg0, arg1, arg2, arg3);
154
+ function __wbg_adapter_131(arg0, arg1, arg2, arg3, arg4) {
155
+ wasm.closure78_externref_shim(arg0, arg1, arg2, arg3, arg4);
155
156
  }
156
157
 
157
158
  /**
@@ -246,118 +247,60 @@ export class ComposerModel {
246
247
  wasm.__wbg_composermodel_free(ptr, 0);
247
248
  }
248
249
  /**
249
- * @returns {ComposerModel}
250
- */
251
- static new() {
252
- const ret = wasm.composermodel_new();
253
- return ComposerModel.__wrap(ret);
254
- }
255
- /**
256
- * @param {string} text
257
- * @returns {ComposerModel}
258
- */
259
- static from_example_format(text) {
260
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
261
- const len0 = WASM_VECTOR_LEN;
262
- const ret = wasm.composermodel_from_example_format(ptr0, len0);
263
- return ComposerModel.__wrap(ret);
264
- }
265
- /**
266
- * @returns {string}
250
+ * @returns {ComposerUpdate}
267
251
  */
268
- to_example_format() {
269
- let deferred1_0;
270
- let deferred1_1;
271
- try {
272
- const ret = wasm.composermodel_to_example_format(this.__wbg_ptr);
273
- deferred1_0 = ret[0];
274
- deferred1_1 = ret[1];
275
- return getStringFromWasm0(ret[0], ret[1]);
276
- } finally {
277
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
278
- }
252
+ code_block() {
253
+ const ret = wasm.composermodel_code_block(this.__wbg_ptr);
254
+ return ComposerUpdate.__wrap(ret);
279
255
  }
280
256
  /**
281
- * @returns {string}
257
+ * @returns {ComposerUpdate}
282
258
  */
283
- get_content_as_html() {
284
- let deferred1_0;
285
- let deferred1_1;
286
- try {
287
- const ret = wasm.composermodel_get_content_as_html(this.__wbg_ptr);
288
- deferred1_0 = ret[0];
289
- deferred1_1 = ret[1];
290
- return getStringFromWasm0(ret[0], ret[1]);
291
- } finally {
292
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
293
- }
259
+ delete_word() {
260
+ const ret = wasm.composermodel_delete_word(this.__wbg_ptr);
261
+ return ComposerUpdate.__wrap(ret);
294
262
  }
295
263
  /**
296
- * @returns {string}
264
+ * @returns {ComposerUpdate}
297
265
  */
298
- get_content_as_message_html() {
299
- let deferred1_0;
300
- let deferred1_1;
301
- try {
302
- const ret = wasm.composermodel_get_content_as_message_html(this.__wbg_ptr);
303
- deferred1_0 = ret[0];
304
- deferred1_1 = ret[1];
305
- return getStringFromWasm0(ret[0], ret[1]);
306
- } finally {
307
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
308
- }
266
+ inline_code() {
267
+ const ret = wasm.composermodel_inline_code(this.__wbg_ptr);
268
+ return ComposerUpdate.__wrap(ret);
309
269
  }
310
270
  /**
311
- * @returns {string}
271
+ * @returns {ComposerUpdate}
312
272
  */
313
- get_content_as_markdown() {
314
- let deferred1_0;
315
- let deferred1_1;
316
- try {
317
- const ret = wasm.composermodel_get_content_as_markdown(this.__wbg_ptr);
318
- deferred1_0 = ret[0];
319
- deferred1_1 = ret[1];
320
- return getStringFromWasm0(ret[0], ret[1]);
321
- } finally {
322
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
323
- }
273
+ ordered_list() {
274
+ const ret = wasm.composermodel_ordered_list(this.__wbg_ptr);
275
+ return ComposerUpdate.__wrap(ret);
324
276
  }
325
277
  /**
326
- * @returns {string}
278
+ * @returns {ComposerUpdate}
327
279
  */
328
- get_content_as_message_markdown() {
329
- let deferred1_0;
330
- let deferred1_1;
331
- try {
332
- const ret = wasm.composermodel_get_content_as_message_markdown(this.__wbg_ptr);
333
- deferred1_0 = ret[0];
334
- deferred1_1 = ret[1];
335
- return getStringFromWasm0(ret[0], ret[1]);
336
- } finally {
337
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
338
- }
280
+ remove_links() {
281
+ const ret = wasm.composermodel_remove_links(this.__wbg_ptr);
282
+ return ComposerUpdate.__wrap(ret);
339
283
  }
340
284
  /**
341
- * @returns {string}
285
+ * @param {string} new_html
286
+ * @param {HtmlSource} external_source
287
+ * @returns {ComposerUpdate}
342
288
  */
343
- get_content_as_plain_text() {
344
- let deferred1_0;
345
- let deferred1_1;
346
- try {
347
- const ret = wasm.composermodel_get_content_as_plain_text(this.__wbg_ptr);
348
- deferred1_0 = ret[0];
349
- deferred1_1 = ret[1];
350
- return getStringFromWasm0(ret[0], ret[1]);
351
- } finally {
352
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
353
- }
289
+ replace_html(new_html, external_source) {
290
+ const ptr0 = passStringToWasm0(new_html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
291
+ const len0 = WASM_VECTOR_LEN;
292
+ const ret = wasm.composermodel_replace_html(this.__wbg_ptr, ptr0, len0, external_source);
293
+ return ComposerUpdate.__wrap(ret);
354
294
  }
355
295
  /**
356
- * @returns {DomHandle}
296
+ * @param {string} new_text
297
+ * @returns {ComposerUpdate}
357
298
  */
358
- document() {
359
- const ret = wasm.composermodel_document(this.__wbg_ptr);
360
- return DomHandle.__wrap(ret);
299
+ replace_text(new_text) {
300
+ const ptr0 = passStringToWasm0(new_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
301
+ const len0 = WASM_VECTOR_LEN;
302
+ const ret = wasm.composermodel_replace_text(this.__wbg_ptr, ptr0, len0);
303
+ return ComposerUpdate.__wrap(ret);
361
304
  }
362
305
  /**
363
306
  * @returns {Map<any, any>}
@@ -366,185 +309,273 @@ export class ComposerModel {
366
309
  const ret = wasm.composermodel_action_states(this.__wbg_ptr);
367
310
  return ret;
368
311
  }
369
- /**
370
- * @param {number} start_utf16_codeunit
371
- * @param {number} end_utf16_codeunit
372
- * @returns {ComposerUpdate}
373
- */
374
- select(start_utf16_codeunit, end_utf16_codeunit) {
375
- const ret = wasm.composermodel_select(this.__wbg_ptr, start_utf16_codeunit, end_utf16_codeunit);
376
- return ComposerUpdate.__wrap(ret);
377
- }
378
312
  /**
379
313
  * @returns {number}
380
314
  */
381
- selection_start() {
382
- const ret = wasm.composermodel_selection_start(this.__wbg_ptr);
315
+ selection_end() {
316
+ const ret = wasm.composermodel_selection_end(this.__wbg_ptr);
383
317
  return ret >>> 0;
384
318
  }
385
319
  /**
386
- * @returns {number}
320
+ * @returns {ComposerUpdate}
387
321
  */
388
- selection_end() {
389
- const ret = wasm.composermodel_selection_end(this.__wbg_ptr);
390
- return ret >>> 0;
322
+ backspace_word() {
323
+ const ret = wasm.composermodel_backspace_word(this.__wbg_ptr);
324
+ return ComposerUpdate.__wrap(ret);
391
325
  }
392
326
  /**
393
- * @param {string} new_text
327
+ * Creates a mention node and inserts it into the composer at the current selection
328
+ * @param {string} url
329
+ * @param {string} text
330
+ * @param {Map<any, any>} attributes
394
331
  * @returns {ComposerUpdate}
395
332
  */
396
- replace_text(new_text) {
397
- const ptr0 = passStringToWasm0(new_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
333
+ insert_mention(url, text, attributes) {
334
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
398
335
  const len0 = WASM_VECTOR_LEN;
399
- const ret = wasm.composermodel_replace_text(this.__wbg_ptr, ptr0, len0);
336
+ const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
337
+ const len1 = WASM_VECTOR_LEN;
338
+ const ret = wasm.composermodel_insert_mention(this.__wbg_ptr, ptr0, len0, ptr1, len1, attributes);
400
339
  return ComposerUpdate.__wrap(ret);
401
340
  }
402
341
  /**
403
- * @param {string} new_html
404
- * @param {HtmlSource} external_source
405
342
  * @returns {ComposerUpdate}
406
343
  */
407
- replace_html(new_html, external_source) {
408
- const ptr0 = passStringToWasm0(new_html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
409
- const len0 = WASM_VECTOR_LEN;
410
- const ret = wasm.composermodel_replace_html(this.__wbg_ptr, ptr0, len0, external_source);
344
+ strike_through() {
345
+ const ret = wasm.composermodel_strike_through(this.__wbg_ptr);
411
346
  return ComposerUpdate.__wrap(ret);
412
347
  }
413
348
  /**
414
- * @param {string} new_text
415
- * @param {SuggestionPattern} suggestion
416
- * @param {boolean} append_space
417
349
  * @returns {ComposerUpdate}
418
350
  */
419
- replace_text_suggestion(new_text, suggestion, append_space) {
420
- const ptr0 = passStringToWasm0(new_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
421
- const len0 = WASM_VECTOR_LEN;
422
- _assertClass(suggestion, SuggestionPattern);
423
- const ret = wasm.composermodel_replace_text_suggestion(this.__wbg_ptr, ptr0, len0, suggestion.__wbg_ptr, append_space);
351
+ unordered_list() {
352
+ const ret = wasm.composermodel_unordered_list(this.__wbg_ptr);
424
353
  return ComposerUpdate.__wrap(ret);
425
354
  }
426
355
  /**
356
+ * @returns {LinkAction}
357
+ */
358
+ get_link_action() {
359
+ const ret = wasm.composermodel_get_link_action(this.__wbg_ptr);
360
+ return LinkAction.__wrap(ret);
361
+ }
362
+ /**
363
+ * @returns {number}
364
+ */
365
+ selection_start() {
366
+ const ret = wasm.composermodel_selection_start(this.__wbg_ptr);
367
+ return ret >>> 0;
368
+ }
369
+ /**
370
+ * @returns {string}
371
+ */
372
+ to_example_format() {
373
+ let deferred1_0;
374
+ let deferred1_1;
375
+ try {
376
+ const ret = wasm.composermodel_to_example_format(this.__wbg_ptr);
377
+ deferred1_0 = ret[0];
378
+ deferred1_1 = ret[1];
379
+ return getStringFromWasm0(ret[0], ret[1]);
380
+ } finally {
381
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
382
+ }
383
+ }
384
+ /**
385
+ * @param {string} url
427
386
  * @param {string} text
387
+ * @param {Map<any, any>} attributes
428
388
  * @returns {ComposerUpdate}
429
389
  */
430
- set_content_from_html(text) {
431
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
390
+ set_link_with_text(url, text, attributes) {
391
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
432
392
  const len0 = WASM_VECTOR_LEN;
433
- const ret = wasm.composermodel_set_content_from_html(this.__wbg_ptr, ptr0, len0);
434
- if (ret[2]) {
435
- throw takeFromExternrefTable0(ret[1]);
436
- }
437
- return ComposerUpdate.__wrap(ret[0]);
393
+ const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
394
+ const len1 = WASM_VECTOR_LEN;
395
+ const ret = wasm.composermodel_set_link_with_text(this.__wbg_ptr, ptr0, len0, ptr1, len1, attributes);
396
+ return ComposerUpdate.__wrap(ret);
438
397
  }
439
398
  /**
440
399
  * @param {string} text
441
- * @returns {ComposerUpdate}
400
+ * @returns {ComposerModel}
442
401
  */
443
- set_content_from_markdown(text) {
402
+ static from_example_format(text) {
444
403
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
445
404
  const len0 = WASM_VECTOR_LEN;
446
- const ret = wasm.composermodel_set_content_from_markdown(this.__wbg_ptr, ptr0, len0);
447
- if (ret[2]) {
448
- throw takeFromExternrefTable0(ret[1]);
449
- }
450
- return ComposerUpdate.__wrap(ret[0]);
405
+ const ret = wasm.composermodel_from_example_format(ptr0, len0);
406
+ return ComposerModel.__wrap(ret);
451
407
  }
452
408
  /**
453
- * @returns {ComposerUpdate}
409
+ * @returns {string}
454
410
  */
455
- clear() {
456
- const ret = wasm.composermodel_clear(this.__wbg_ptr);
457
- return ComposerUpdate.__wrap(ret);
411
+ get_content_as_html() {
412
+ let deferred1_0;
413
+ let deferred1_1;
414
+ try {
415
+ const ret = wasm.composermodel_get_content_as_html(this.__wbg_ptr);
416
+ deferred1_0 = ret[0];
417
+ deferred1_1 = ret[1];
418
+ return getStringFromWasm0(ret[0], ret[1]);
419
+ } finally {
420
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
421
+ }
458
422
  }
459
423
  /**
424
+ * @param {string} text
460
425
  * @returns {ComposerUpdate}
461
426
  */
462
- enter() {
463
- const ret = wasm.composermodel_enter(this.__wbg_ptr);
464
- return ComposerUpdate.__wrap(ret);
427
+ set_content_from_html(text) {
428
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
429
+ const len0 = WASM_VECTOR_LEN;
430
+ const ret = wasm.composermodel_set_content_from_html(this.__wbg_ptr, ptr0, len0);
431
+ if (ret[2]) {
432
+ throw takeFromExternrefTable0(ret[1]);
433
+ }
434
+ return ComposerUpdate.__wrap(ret[0]);
465
435
  }
466
436
  /**
437
+ * Creates an at-room mention node and inserts it into the composer at the current selection
438
+ * @param {Map<any, any>} attributes
467
439
  * @returns {ComposerUpdate}
468
440
  */
469
- backspace() {
470
- const ret = wasm.composermodel_backspace(this.__wbg_ptr);
441
+ insert_at_room_mention(attributes) {
442
+ const ret = wasm.composermodel_insert_at_room_mention(this.__wbg_ptr, attributes);
471
443
  return ComposerUpdate.__wrap(ret);
472
444
  }
473
445
  /**
474
- * @returns {ComposerUpdate}
446
+ * @returns {string}
475
447
  */
476
- backspace_word() {
477
- const ret = wasm.composermodel_backspace_word(this.__wbg_ptr);
478
- return ComposerUpdate.__wrap(ret);
448
+ get_content_as_markdown() {
449
+ let deferred1_0;
450
+ let deferred1_1;
451
+ try {
452
+ const ret = wasm.composermodel_get_content_as_markdown(this.__wbg_ptr);
453
+ deferred1_0 = ret[0];
454
+ deferred1_1 = ret[1];
455
+ return getStringFromWasm0(ret[0], ret[1]);
456
+ } finally {
457
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
458
+ }
479
459
  }
480
460
  /**
461
+ * @param {string} new_text
462
+ * @param {SuggestionPattern} suggestion
463
+ * @param {boolean} append_space
481
464
  * @returns {ComposerUpdate}
482
465
  */
483
- delete() {
484
- const ret = wasm.composermodel_delete(this.__wbg_ptr);
466
+ replace_text_suggestion(new_text, suggestion, append_space) {
467
+ const ptr0 = passStringToWasm0(new_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
468
+ const len0 = WASM_VECTOR_LEN;
469
+ _assertClass(suggestion, SuggestionPattern);
470
+ const ret = wasm.composermodel_replace_text_suggestion(this.__wbg_ptr, ptr0, len0, suggestion.__wbg_ptr, append_space);
485
471
  return ComposerUpdate.__wrap(ret);
486
472
  }
487
473
  /**
488
- * @returns {ComposerUpdate}
474
+ * @returns {string}
489
475
  */
490
- delete_word() {
491
- const ret = wasm.composermodel_delete_word(this.__wbg_ptr);
492
- return ComposerUpdate.__wrap(ret);
476
+ get_content_as_plain_text() {
477
+ let deferred1_0;
478
+ let deferred1_1;
479
+ try {
480
+ const ret = wasm.composermodel_get_content_as_plain_text(this.__wbg_ptr);
481
+ deferred1_0 = ret[0];
482
+ deferred1_1 = ret[1];
483
+ return getStringFromWasm0(ret[0], ret[1]);
484
+ } finally {
485
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
486
+ }
493
487
  }
494
488
  /**
489
+ * @param {string} text
495
490
  * @returns {ComposerUpdate}
496
491
  */
497
- bold() {
498
- const ret = wasm.composermodel_bold(this.__wbg_ptr);
499
- return ComposerUpdate.__wrap(ret);
492
+ set_content_from_markdown(text) {
493
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
494
+ const len0 = WASM_VECTOR_LEN;
495
+ const ret = wasm.composermodel_set_content_from_markdown(this.__wbg_ptr, ptr0, len0);
496
+ if (ret[2]) {
497
+ throw takeFromExternrefTable0(ret[1]);
498
+ }
499
+ return ComposerUpdate.__wrap(ret[0]);
500
500
  }
501
501
  /**
502
- * @returns {ComposerUpdate}
502
+ * @returns {string}
503
503
  */
504
- italic() {
505
- const ret = wasm.composermodel_italic(this.__wbg_ptr);
506
- return ComposerUpdate.__wrap(ret);
504
+ get_content_as_message_html() {
505
+ let deferred1_0;
506
+ let deferred1_1;
507
+ try {
508
+ const ret = wasm.composermodel_get_content_as_message_html(this.__wbg_ptr);
509
+ deferred1_0 = ret[0];
510
+ deferred1_1 = ret[1];
511
+ return getStringFromWasm0(ret[0], ret[1]);
512
+ } finally {
513
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
514
+ }
507
515
  }
508
516
  /**
517
+ * Creates a mention node and inserts it into the composer, replacing the
518
+ * text content defined by the suggestion
519
+ * @param {string} url
520
+ * @param {string} text
521
+ * @param {SuggestionPattern} suggestion
522
+ * @param {Map<any, any>} attributes
509
523
  * @returns {ComposerUpdate}
510
524
  */
511
- strike_through() {
512
- const ret = wasm.composermodel_strike_through(this.__wbg_ptr);
525
+ insert_mention_at_suggestion(url, text, suggestion, attributes) {
526
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
527
+ const len0 = WASM_VECTOR_LEN;
528
+ const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
529
+ const len1 = WASM_VECTOR_LEN;
530
+ _assertClass(suggestion, SuggestionPattern);
531
+ const ret = wasm.composermodel_insert_mention_at_suggestion(this.__wbg_ptr, ptr0, len0, ptr1, len1, suggestion.__wbg_ptr, attributes);
513
532
  return ComposerUpdate.__wrap(ret);
514
533
  }
515
534
  /**
516
- * @returns {ComposerUpdate}
535
+ * @param {Array<any>} custom_suggestion_patterns
517
536
  */
518
- underline() {
519
- const ret = wasm.composermodel_underline(this.__wbg_ptr);
520
- return ComposerUpdate.__wrap(ret);
537
+ set_custom_suggestion_patterns(custom_suggestion_patterns) {
538
+ wasm.composermodel_set_custom_suggestion_patterns(this.__wbg_ptr, custom_suggestion_patterns);
521
539
  }
522
540
  /**
523
- * @returns {ComposerUpdate}
541
+ * @returns {string}
524
542
  */
525
- quote() {
526
- const ret = wasm.composermodel_quote(this.__wbg_ptr);
527
- return ComposerUpdate.__wrap(ret);
543
+ get_content_as_message_markdown() {
544
+ let deferred1_0;
545
+ let deferred1_1;
546
+ try {
547
+ const ret = wasm.composermodel_get_content_as_message_markdown(this.__wbg_ptr);
548
+ deferred1_0 = ret[0];
549
+ deferred1_1 = ret[1];
550
+ return getStringFromWasm0(ret[0], ret[1]);
551
+ } finally {
552
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
553
+ }
528
554
  }
529
555
  /**
556
+ * Creates an at-room mention node and inserts it into the composer, replacing the
557
+ * text content defined by the suggestion
558
+ * @param {SuggestionPattern} suggestion
559
+ * @param {Map<any, any>} attributes
530
560
  * @returns {ComposerUpdate}
531
561
  */
532
- inline_code() {
533
- const ret = wasm.composermodel_inline_code(this.__wbg_ptr);
562
+ insert_at_room_mention_at_suggestion(suggestion, attributes) {
563
+ _assertClass(suggestion, SuggestionPattern);
564
+ const ret = wasm.composermodel_insert_at_room_mention_at_suggestion(this.__wbg_ptr, suggestion.__wbg_ptr, attributes);
534
565
  return ComposerUpdate.__wrap(ret);
535
566
  }
536
567
  /**
537
- * @returns {ComposerUpdate}
568
+ * @returns {ComposerModel}
538
569
  */
539
- code_block() {
540
- const ret = wasm.composermodel_code_block(this.__wbg_ptr);
541
- return ComposerUpdate.__wrap(ret);
570
+ static new() {
571
+ const ret = wasm.composermodel_new();
572
+ return ComposerModel.__wrap(ret);
542
573
  }
543
574
  /**
544
575
  * @returns {ComposerUpdate}
545
576
  */
546
- undo() {
547
- const ret = wasm.composermodel_undo(this.__wbg_ptr);
577
+ bold() {
578
+ const ret = wasm.composermodel_bold(this.__wbg_ptr);
548
579
  return ComposerUpdate.__wrap(ret);
549
580
  }
550
581
  /**
@@ -557,128 +588,98 @@ export class ComposerModel {
557
588
  /**
558
589
  * @returns {ComposerUpdate}
559
590
  */
560
- ordered_list() {
561
- const ret = wasm.composermodel_ordered_list(this.__wbg_ptr);
591
+ undo() {
592
+ const ret = wasm.composermodel_undo(this.__wbg_ptr);
562
593
  return ComposerUpdate.__wrap(ret);
563
594
  }
564
595
  /**
565
596
  * @returns {ComposerUpdate}
566
597
  */
567
- unordered_list() {
568
- const ret = wasm.composermodel_unordered_list(this.__wbg_ptr);
598
+ clear() {
599
+ const ret = wasm.composermodel_clear(this.__wbg_ptr);
569
600
  return ComposerUpdate.__wrap(ret);
570
601
  }
571
602
  /**
572
603
  * @returns {ComposerUpdate}
573
604
  */
574
- indent() {
575
- const ret = wasm.composermodel_indent(this.__wbg_ptr);
605
+ enter() {
606
+ const ret = wasm.composermodel_enter(this.__wbg_ptr);
576
607
  return ComposerUpdate.__wrap(ret);
577
608
  }
578
609
  /**
579
610
  * @returns {ComposerUpdate}
580
611
  */
581
- unindent() {
582
- const ret = wasm.composermodel_unindent(this.__wbg_ptr);
612
+ quote() {
613
+ const ret = wasm.composermodel_quote(this.__wbg_ptr);
583
614
  return ComposerUpdate.__wrap(ret);
584
615
  }
585
616
  /**
586
- * @returns {LinkAction}
617
+ * @returns {ComposerUpdate}
587
618
  */
588
- get_link_action() {
589
- const ret = wasm.composermodel_get_link_action(this.__wbg_ptr);
590
- return LinkAction.__wrap(ret);
619
+ delete() {
620
+ const ret = wasm.composermodel_delete(this.__wbg_ptr);
621
+ return ComposerUpdate.__wrap(ret);
591
622
  }
592
623
  /**
593
- * @param {string} url
594
- * @param {Map<any, any>} attributes
595
624
  * @returns {ComposerUpdate}
596
625
  */
597
- set_link(url, attributes) {
598
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
599
- const len0 = WASM_VECTOR_LEN;
600
- const ret = wasm.composermodel_set_link(this.__wbg_ptr, ptr0, len0, attributes);
626
+ indent() {
627
+ const ret = wasm.composermodel_indent(this.__wbg_ptr);
601
628
  return ComposerUpdate.__wrap(ret);
602
629
  }
603
630
  /**
604
- * @param {string} url
605
- * @param {string} text
606
- * @param {Map<any, any>} attributes
607
631
  * @returns {ComposerUpdate}
608
632
  */
609
- set_link_with_text(url, text, attributes) {
610
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
611
- const len0 = WASM_VECTOR_LEN;
612
- const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
613
- const len1 = WASM_VECTOR_LEN;
614
- const ret = wasm.composermodel_set_link_with_text(this.__wbg_ptr, ptr0, len0, ptr1, len1, attributes);
633
+ italic() {
634
+ const ret = wasm.composermodel_italic(this.__wbg_ptr);
615
635
  return ComposerUpdate.__wrap(ret);
616
636
  }
617
637
  /**
618
- * @param {Array<any>} custom_suggestion_patterns
638
+ * @param {number} start_utf16_codeunit
639
+ * @param {number} end_utf16_codeunit
640
+ * @returns {ComposerUpdate}
619
641
  */
620
- set_custom_suggestion_patterns(custom_suggestion_patterns) {
621
- wasm.composermodel_set_custom_suggestion_patterns(this.__wbg_ptr, custom_suggestion_patterns);
642
+ select(start_utf16_codeunit, end_utf16_codeunit) {
643
+ const ret = wasm.composermodel_select(this.__wbg_ptr, start_utf16_codeunit, end_utf16_codeunit);
644
+ return ComposerUpdate.__wrap(ret);
622
645
  }
623
646
  /**
624
- * Creates an at-room mention node and inserts it into the composer at the current selection
625
- * @param {Map<any, any>} attributes
626
- * @returns {ComposerUpdate}
647
+ * @returns {DomHandle}
627
648
  */
628
- insert_at_room_mention(attributes) {
629
- const ret = wasm.composermodel_insert_at_room_mention(this.__wbg_ptr, attributes);
630
- return ComposerUpdate.__wrap(ret);
649
+ document() {
650
+ const ret = wasm.composermodel_document(this.__wbg_ptr);
651
+ return DomHandle.__wrap(ret);
631
652
  }
632
653
  /**
633
- * Creates a mention node and inserts it into the composer at the current selection
634
654
  * @param {string} url
635
- * @param {string} text
636
655
  * @param {Map<any, any>} attributes
637
656
  * @returns {ComposerUpdate}
638
657
  */
639
- insert_mention(url, text, attributes) {
658
+ set_link(url, attributes) {
640
659
  const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
641
660
  const len0 = WASM_VECTOR_LEN;
642
- const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
643
- const len1 = WASM_VECTOR_LEN;
644
- const ret = wasm.composermodel_insert_mention(this.__wbg_ptr, ptr0, len0, ptr1, len1, attributes);
661
+ const ret = wasm.composermodel_set_link(this.__wbg_ptr, ptr0, len0, attributes);
645
662
  return ComposerUpdate.__wrap(ret);
646
663
  }
647
664
  /**
648
- * Creates an at-room mention node and inserts it into the composer, replacing the
649
- * text content defined by the suggestion
650
- * @param {SuggestionPattern} suggestion
651
- * @param {Map<any, any>} attributes
652
665
  * @returns {ComposerUpdate}
653
666
  */
654
- insert_at_room_mention_at_suggestion(suggestion, attributes) {
655
- _assertClass(suggestion, SuggestionPattern);
656
- const ret = wasm.composermodel_insert_at_room_mention_at_suggestion(this.__wbg_ptr, suggestion.__wbg_ptr, attributes);
667
+ unindent() {
668
+ const ret = wasm.composermodel_unindent(this.__wbg_ptr);
657
669
  return ComposerUpdate.__wrap(ret);
658
670
  }
659
671
  /**
660
- * Creates a mention node and inserts it into the composer, replacing the
661
- * text content defined by the suggestion
662
- * @param {string} url
663
- * @param {string} text
664
- * @param {SuggestionPattern} suggestion
665
- * @param {Map<any, any>} attributes
666
672
  * @returns {ComposerUpdate}
667
673
  */
668
- insert_mention_at_suggestion(url, text, suggestion, attributes) {
669
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
670
- const len0 = WASM_VECTOR_LEN;
671
- const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
672
- const len1 = WASM_VECTOR_LEN;
673
- _assertClass(suggestion, SuggestionPattern);
674
- const ret = wasm.composermodel_insert_mention_at_suggestion(this.__wbg_ptr, ptr0, len0, ptr1, len1, suggestion.__wbg_ptr, attributes);
674
+ backspace() {
675
+ const ret = wasm.composermodel_backspace(this.__wbg_ptr);
675
676
  return ComposerUpdate.__wrap(ret);
676
677
  }
677
678
  /**
678
679
  * @returns {ComposerUpdate}
679
680
  */
680
- remove_links() {
681
- const ret = wasm.composermodel_remove_links(this.__wbg_ptr);
681
+ underline() {
682
+ const ret = wasm.composermodel_underline(this.__wbg_ptr);
682
683
  return ComposerUpdate.__wrap(ret);
683
684
  }
684
685
  }
@@ -708,13 +709,6 @@ export class ComposerUpdate {
708
709
  const ptr = this.__destroy_into_raw();
709
710
  wasm.__wbg_composerupdate_free(ptr, 0);
710
711
  }
711
- /**
712
- * @returns {TextUpdate}
713
- */
714
- text_update() {
715
- const ret = wasm.composerupdate_text_update(this.__wbg_ptr);
716
- return TextUpdate.__wrap(ret);
717
- }
718
712
  /**
719
713
  * @returns {MenuState}
720
714
  */
@@ -729,6 +723,13 @@ export class ComposerUpdate {
729
723
  const ret = wasm.composerupdate_menu_action(this.__wbg_ptr);
730
724
  return MenuAction.__wrap(ret);
731
725
  }
726
+ /**
727
+ * @returns {TextUpdate}
728
+ */
729
+ text_update() {
730
+ const ret = wasm.composerupdate_text_update(this.__wbg_ptr);
731
+ return TextUpdate.__wrap(ret);
732
+ }
732
733
  }
733
734
 
734
735
  const CreateFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -877,20 +878,19 @@ export class DomHandle {
877
878
  wasm.__wbg_domhandle_free(ptr, 0);
878
879
  }
879
880
  /**
880
- * Returns "container", "line_break", "text" or "zwsp" depending on the type of
881
- * node we refer to.
881
+ * Returns our tagname, or "-text-"/"-zwsp-" if we are a text/zwsp node.
882
882
  * Panics if we are not a valid reference (because the model has changed
883
883
  * since we were created, or because you passed in a different model
884
884
  * from the one that created us.)
885
885
  * @param {ComposerModel} model
886
886
  * @returns {string}
887
887
  */
888
- node_type(model) {
888
+ tag(model) {
889
889
  let deferred1_0;
890
890
  let deferred1_1;
891
891
  try {
892
892
  _assertClass(model, ComposerModel);
893
- const ret = wasm.domhandle_node_type(this.__wbg_ptr, model.__wbg_ptr);
893
+ const ret = wasm.domhandle_tag(this.__wbg_ptr, model.__wbg_ptr);
894
894
  deferred1_0 = ret[0];
895
895
  deferred1_1 = ret[1];
896
896
  return getStringFromWasm0(ret[0], ret[1]);
@@ -898,20 +898,6 @@ export class DomHandle {
898
898
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
899
899
  }
900
900
  }
901
- /**
902
- * Returns a list of our children nodes, or an empty list if we refer
903
- * to a text or line break node.
904
- * Panics if we are not a valid reference (because the model has changed
905
- * since we were created, or because you passed in a different model
906
- * from the one that created us.)
907
- * @param {ComposerModel} model
908
- * @returns {DomChildren}
909
- */
910
- children(model) {
911
- _assertClass(model, ComposerModel);
912
- const ret = wasm.domhandle_children(this.__wbg_ptr, model.__wbg_ptr);
913
- return DomChildren.__wrap(ret);
914
- }
915
901
  /**
916
902
  * Returns the text of this node, or an empty string if this is a
917
903
  * container or line break.
@@ -935,19 +921,34 @@ export class DomHandle {
935
921
  }
936
922
  }
937
923
  /**
938
- * Returns our tagname, or "-text-"/"-zwsp-" if we are a text/zwsp node.
924
+ * Returns a list of our children nodes, or an empty list if we refer
925
+ * to a text or line break node.
926
+ * Panics if we are not a valid reference (because the model has changed
927
+ * since we were created, or because you passed in a different model
928
+ * from the one that created us.)
929
+ * @param {ComposerModel} model
930
+ * @returns {DomChildren}
931
+ */
932
+ children(model) {
933
+ _assertClass(model, ComposerModel);
934
+ const ret = wasm.domhandle_children(this.__wbg_ptr, model.__wbg_ptr);
935
+ return DomChildren.__wrap(ret);
936
+ }
937
+ /**
938
+ * Returns "container", "line_break", "text" or "zwsp" depending on the type of
939
+ * node we refer to.
939
940
  * Panics if we are not a valid reference (because the model has changed
940
941
  * since we were created, or because you passed in a different model
941
942
  * from the one that created us.)
942
943
  * @param {ComposerModel} model
943
944
  * @returns {string}
944
945
  */
945
- tag(model) {
946
+ node_type(model) {
946
947
  let deferred1_0;
947
948
  let deferred1_1;
948
949
  try {
949
950
  _assertClass(model, ComposerModel);
950
- const ret = wasm.domhandle_tag(this.__wbg_ptr, model.__wbg_ptr);
951
+ const ret = wasm.domhandle_node_type(this.__wbg_ptr, model.__wbg_ptr);
951
952
  deferred1_0 = ret[0];
952
953
  deferred1_1 = ret[1];
953
954
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1158,6 +1159,13 @@ export class MenuAction {
1158
1159
  const ptr = this.__destroy_into_raw();
1159
1160
  wasm.__wbg_menuaction_free(ptr, 0);
1160
1161
  }
1162
+ /**
1163
+ * @returns {MenuActionSuggestion | undefined}
1164
+ */
1165
+ suggestion() {
1166
+ const ret = wasm.menuaction_suggestion(this.__wbg_ptr);
1167
+ return ret === 0 ? undefined : MenuActionSuggestion.__wrap(ret);
1168
+ }
1161
1169
  /**
1162
1170
  * @returns {boolean}
1163
1171
  */
@@ -1172,13 +1180,6 @@ export class MenuAction {
1172
1180
  const ret = wasm.menuaction_none(this.__wbg_ptr);
1173
1181
  return ret !== 0;
1174
1182
  }
1175
- /**
1176
- * @returns {MenuActionSuggestion | undefined}
1177
- */
1178
- suggestion() {
1179
- const ret = wasm.menuaction_suggestion(this.__wbg_ptr);
1180
- return ret === 0 ? undefined : MenuActionSuggestion.__wrap(ret);
1181
- }
1182
1183
  }
1183
1184
 
1184
1185
  const MenuActionSuggestionFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1694,7 +1695,7 @@ export function __wbg_forEach_d6a05ca96422eff9(arg0, arg1, arg2) {
1694
1695
  const a = state0.a;
1695
1696
  state0.a = 0;
1696
1697
  try {
1697
- return __wbg_adapter_124(a, state0.b, arg0, arg1, arg2);
1698
+ return __wbg_adapter_131(a, state0.b, arg0, arg1, arg2);
1698
1699
  } finally {
1699
1700
  state0.a = a;
1700
1701
  }
@@ -1712,7 +1713,7 @@ export function __wbg_forEach_e1cf6f7c8ecb7dae(arg0, arg1, arg2) {
1712
1713
  const a = state0.a;
1713
1714
  state0.a = 0;
1714
1715
  try {
1715
- return __wbg_adapter_127(a, state0.b, arg0, arg1);
1716
+ return __wbg_adapter_124(a, state0.b, arg0, arg1);
1716
1717
  } finally {
1717
1718
  state0.a = a;
1718
1719
  }