-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TinyMCE per Block: Adding the align images controls
- Loading branch information
1 parent
99a6a58
commit ac7bfee
Showing
20 changed files
with
232 additions
and
168 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,50 @@ | ||
.image-block__display { | ||
display: block; | ||
max-width: 100%; | ||
.image-caption-block { | ||
position: relative; | ||
|
||
&.align-full-width { | ||
margin-left: calc(50% - 50vw); | ||
width: 100vw; | ||
max-width: none; | ||
padding-left: 0; | ||
padding-right: 0; | ||
|
||
img { | ||
width: 100%; | ||
} | ||
} | ||
|
||
&.align-left { | ||
float: left; | ||
width: 340px; | ||
z-index: 1; | ||
} | ||
|
||
&.align-right { | ||
float: right; | ||
width: 340px; | ||
z-index: 1; | ||
} | ||
|
||
|
||
.image-caption-block__display { | ||
display: block; | ||
max-width: 100%; | ||
} | ||
|
||
.image-caption-block__caption textarea, | ||
.image-caption-block__caption .textarea-mirror { | ||
margin-top: 10px; | ||
width: 100%; | ||
border: none; | ||
font: inherit; | ||
font-family: "Merriweather", serif; | ||
font-weight: 300; | ||
font-size: 14px; | ||
color: $gray-dark-300; | ||
resize: none; | ||
|
||
&:focus { | ||
outline: 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
tinymce-per-block/src/blocks/image-caption-block/_style.scss
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { createElement } from 'wp-elements'; | ||
import { getBlock } from 'wp-blocks'; | ||
import { ArrowDownAlt2Icon, ArrowUpAlt2Icon } from 'dashicons'; | ||
|
||
export default function BlockArrangement( { block } ) { | ||
const blockDefinition = getBlock( block.blockType ); | ||
const Icon = blockDefinition.icon; | ||
|
||
return ( | ||
<div className="block-list__block-arrangement"> | ||
<div className="block-list__movement-controls"> | ||
<button className="block-list__block-arrange-control"> | ||
<ArrowUpAlt2Icon /> | ||
</button> | ||
<button className="block-list__block-arrange-control"> | ||
<ArrowDownAlt2Icon /> | ||
</button> | ||
</div> | ||
{ Icon && ( | ||
<div className="block-list__type-controls"> | ||
<button className="block-list__block-arrange-control"> | ||
<Icon /> | ||
</button> | ||
</div> | ||
) } | ||
</div> | ||
); | ||
} |
7 changes: 7 additions & 0 deletions
7
tinymce-per-block/src/external/dashicons/icons/image-align-left.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { createElement } from 'wp-elements'; | ||
|
||
// This is a gridicon | ||
export default () => <svg className="dashicon" height="24" width="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M3 5h18v2H3V5zm0 14h18v-2H3v2zm0-4h8V9H3v6zm10 0h8v-2h-8v2zm0-4h8V9h-8v2z"></path></g></svg>; |
7 changes: 7 additions & 0 deletions
7
tinymce-per-block/src/external/dashicons/icons/image-align-right.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { createElement } from 'wp-elements'; | ||
|
||
// This is a gridicon | ||
export default () => <svg className="dashicon" height="24" width="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M21 7H3V5h18v2zm0 10H3v2h18v-2zm0-8h-8v6h8V9zm-10 4H3v2h8v-2zm0-4H3v2h8V9z"></path></g></svg>; |
Oops, something went wrong.