3
3
*/
4
4
import { createElement , Component } from 'wp-elements' ;
5
5
6
- import { EditableComponent , EnhancedInputComponent } from 'wp-blocks' ;
7
- import { serialize } from 'serializers/block' ;
8
- import { parse } from 'parsers/block' ;
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { EditableComponent } from 'wp-blocks' ;
9
10
import EditableFormatToolbar from 'controls/editable-format-toolbar' ;
10
11
import BlockArrangement from 'controls/block-arrangement' ;
12
+ import TransformBlockToolbar from 'controls/transform-block-toolbar' ;
11
13
12
14
export default class QuoteBlockForm extends Component {
13
15
bindContent = ( ref ) => {
@@ -59,7 +61,7 @@ export default class QuoteBlockForm extends Component {
59
61
render ( ) {
60
62
const { block, change, moveCursorUp, moveCursorDown, remove,
61
63
mergeWithPrevious, appendBlock, isSelected, focusConfig, focus,
62
- moveBlockUp, moveBlockDown } = this . props ;
64
+ moveBlockUp, moveBlockDown, select , unselect , transform } = this . props ;
63
65
const splitValue = ( left , right ) => {
64
66
change ( { cite : left } ) ;
65
67
appendBlock ( {
@@ -78,13 +80,17 @@ export default class QuoteBlockForm extends Component {
78
80
moveBlockUp = { moveBlockUp } moveBlockDown = { moveBlockDown } /> }
79
81
{ isSelected &&
80
82
< div className = "block-list__block-controls" >
83
+ < div className = "block-list__block-controls-group" >
84
+ < TransformBlockToolbar blockType = "quote" onTransform = { transform } />
85
+ </ div >
86
+
81
87
< div className = "block-list__block-controls-group" >
82
88
< EditableFormatToolbar editable = { focusInput === 'content' ? this . content : this . cite } ref = { this . bindFormatToolbar } />
83
89
</ div >
84
90
</ div >
85
91
}
86
92
87
- < div className = "quote-block__form" >
93
+ < div className = "quote-block__form" onClick = { select } >
88
94
< div className = "quote-block__content" >
89
95
< EditableComponent
90
96
ref = { this . bindContent }
@@ -97,6 +103,7 @@ export default class QuoteBlockForm extends Component {
97
103
setToolbarState = { focusInput === 'content' ? this . setToolbarState : undefined }
98
104
focusConfig = { focusInput === 'content' ? focusConfig : null }
99
105
onFocusChange = { ( config ) => focus ( Object . assign ( { input : 'content' } , config ) ) }
106
+ onType = { unselect }
100
107
inline
101
108
/>
102
109
</ div >
@@ -113,6 +120,7 @@ export default class QuoteBlockForm extends Component {
113
120
setToolbarState = { focusInput === 'cite' ? this . setToolbarState : undefined }
114
121
focusConfig = { focusInput === 'cite' ? focusConfig : null }
115
122
onFocusChange = { ( config ) => focus ( Object . assign ( { input : 'cite' } , config ) ) }
123
+ onType = { unselect }
116
124
inline
117
125
single
118
126
/>
0 commit comments