-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Table Block v1 #3
Conversation
return ( | ||
<RichText.Content value={ attributes.content } /> | ||
<RichText.Content tagName="span" { ...blockProps } value={ attributes.content } /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@i-am-chitti We don't want to save any markup in here other than the value. That's why we are creating this block in the first place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junaidbhura I've added the color attribute to the cell block - https://github.com/Travelopia/wordpress-blocks/blob/WP-70/table-block-v1/src/blocks/table-cell/index.tsx#L39-L42
Now, if I don't include the tagName
, then, colors are not reflected on frontend, though present on editor side. Without tagName, if I just add the {...blockProps}
, there is no tag where these color classes can be applied.
Taking a step back, I've added color on table-row, table-column and table-cell. I have started thinking again that table-cell doesn't need the color since table column has it and a cell will be only present in the column.
colSpan={ attributes.colSpan } | ||
rowSpan={ attributes.rowSpan } | ||
/> | ||
{ attributes.isHead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@i-am-chitti Can I request you to remove this header code out of this PR?
background: true, | ||
text: true, | ||
}, | ||
align: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@i-am-chitti Does this also add align wide? If so, we should only allow left right and center
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junaidbhura It's not working currently. Will remove this and tackle in separate PR.
import { name as cellBlockName } from '../table-cell'; | ||
import { PanelBody, ToggleControl } from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@i-am-chitti lets remove this empty line
Closing this as it's changes are broken down into multiple PRs. Re-raising new ones. |
Description
This PR is under WIP for table block.
Features
[ ] Toggle Options to add a THEAD and TFOOT on the Table block
[ ] Toggle Options to make THEAD sticky
[x] Ability to select text and background colors on a row
[x] Ability to select text and background colors on a column
[x] Ability to transform a cell into a Paragraph, Image, Heading, List
[ ] Ability to move an entire column left or right
[ ] Ability to move an entire row up or down
[ ] Ability to add text alignment in the cell block
Note
tbody
is added.