-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add/147 table block (alternate vision) #850
Changes from 1 commit
c3f6fb5
2c1fab0
7eda289
f0fc3cf
462528f
5bc3a62
5d8bec7
172eb3d
fbaf6a9
6347878
55c999a
e591c31
7af4bba
4f8c24c
3ec4f0b
183bb4d
10d42e1
a1826f6
6d1ba0f
c02da21
97c3e9d
e60070b
9a1ef91
3ec9506
bd1a183
ed2d5a5
e4871d3
2249999
a15a781
95c353d
d01937b
7b08fa1
f067183
be1791b
2f6d3e4
9d62f49
6d87fcd
3494440
27b6f01
13fdec5
45ea9ac
fc27514
e9db8b7
79808f6
0404c87
07c5262
b9cdc9d
0cb4cf5
fca185c
dc0dfcf
9daaef9
c133e8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import Editable from '../../editable'; | ||
import BlockControls from '../../block-controls'; | ||
import BlockAlignmentToolbar from '../../block-alignment-toolbar'; | ||
import BlockMenu from '../../block-menu'; | ||
import { ToolbarMenu } from 'components'; | ||
|
||
function execCommand( command ) { | ||
return ( editor ) => { | ||
|
@@ -66,17 +66,6 @@ export default class TableBlock extends wp.element.Component { | |
/> | ||
</BlockControls> | ||
), | ||
focus && ( | ||
<BlockMenu | ||
key="menu" | ||
icon="editor-table" | ||
controls={ | ||
TABLE_CONTROLS.map( ( control ) => ( { | ||
...control, | ||
onClick: () => control.onClick( this.state.editor ), | ||
} ) ) } | ||
/> | ||
), | ||
<Editable | ||
key="editor" | ||
tagName="table" | ||
|
@@ -90,6 +79,18 @@ export default class TableBlock extends wp.element.Component { | |
focus={ focus } | ||
onFocus={ onFocus } | ||
/>, | ||
focus && ( | ||
<BlockControls key="menu"> | ||
<ToolbarMenu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So if I understand correctly, the purpose of this component is to display a toolbar with a dropdown button. I think instead we'd probably want to refactor this to be able to do something like: <Toolbar>
<DropdownMenu />
<DropdownMenu />
</Toolbar> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have changed it so it nests inside a Toolbar and renamed it to DropdownMenu. |
||
icon="editor-table" | ||
controls={ | ||
TABLE_CONTROLS.map( ( control ) => ( { | ||
...control, | ||
onClick: () => control.onClick( this.state.editor ), | ||
} ) ) } | ||
/> | ||
</BlockControls> | ||
), | ||
]; | ||
} | ||
} |
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 think we should encourage the use of the new generated classNames for styling
wp-block-table2
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.
Ok, I have moved the table styles so they are a child of
wp-block-table-2
. I can't move the other styles though because the div withwp-block-table-2
class is not the same div that is selected by.editor-visual-editor__block[data-type="core/table2"]
.