hicommonwealth / commonwealth

A platform for decentralized communities
https://commonwealth.im
GNU General Public License v3.0
67 stars 44 forks source link

Update Editor Component UI - Tables #6514

Open Miaplacidus opened 9 months ago

Miaplacidus commented 9 months ago

This code is a breakaway from #5949 and covers the portion of the toolbar that includes creating tables, table columns, and table rows.

Clicking the associated buttons should result in the following behavior:

  1. The table button should add table syntax into the editor with at 3 columns and 1 row, with placeholder text saying "header [NUM]" in the table heading and 'content' in the cells. The cursor should be placed after the last character in the table.
  2. Assuming the cursor is at the end of the table, clicking the table column button should add a column with the current number of rows in the table.
  3. Assuming the cursor is at the end of the table, clicking the table row button should add a row with the current number of columns in the table.

The relevant designs can be found in this Figma

@zakhap @jabell88 <-- feel free to add details, if you wish @jnaviask @CowMuon <-- tagged for visibility

COM-18

CowMuon commented 9 months ago

@zakhap What are our downstream dependencies here? As mentioned would like to Spike DataGridPro before we go too far in another direction.

zakhap commented 9 months ago

Gonna link my comment from over here: https://github.com/hicommonwealth/commonwealth/pull/6608#issuecomment-1933221474

I think it's important that we support standard markdown table syntax, even if we don't have helpers for users in the editor-toolbar.