We were relying on the `event.target`, and sometimes that target was not the button element with the `table-id` data attribute, but the svg.
This commit makes a few changes:
- renames `tableId` to `tableIndex`
- passes the index as part of the attributes to the `generateModal` function
Previously, the regex was catching uploads as well as tables.
This change ensures only strict tables are matched by requiring that
matches start with the pipe character.
Also adds a unit test for `findTableRegex` to describe the expected
behaviour of the helper.
Now that all of our singletons have been converted to true Ember Services, we can remove our custom `discourse/component/glimmer` superclass and use explicit injection
* DEV: Use alternate fork of `array-to-table`
* DEV: Add unit test for `arrayToTable()` method
* Move `arrayToTable` so it is available for unit tests
* DEV: Add assertion for creating a markdown table with special chars
When a table with special characters (such as `$`) is inserted in a cell to the right of a blank cell. The alignment of the table gets ruined if the table doesn't have surrounding pipes. This check ensures this alignment is correct.
Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
* UX: Wrap words instead of dynamic widths and align left
* UX: Improve sticky header on scroll
* DEV: Convert default column text to localizable strings
As of [this commit](327dd0beb3), render-modifiers have been introduced, allowing the spreadsheet component to be successfully converted into a Glimmer Component.
- Adds a button to the composer tools which triggers a modal window for a table builder
- Table builder contains fields to add table contents, as well as buttons to align contents, and add additional tables/rows