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