Skip to content
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

Format API #10209

Merged
merged 28 commits into from Oct 26, 2018
Merged

Format API #10209

Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
944d971
Formatting API
ellatrix Oct 12, 2018
578b5e5
Fix image test
ellatrix Oct 12, 2018
a995887
WIP: create format lib
ellatrix Oct 13, 2018
636cd2f
Adjust internal value to use format attributes and name instead of el…
ellatrix Oct 15, 2018
321402d
Add activeAttributes prop
ellatrix Oct 15, 2018
ac81865
Add FillToolbarSlot and Shortcut
ellatrix Oct 15, 2018
449c789
Editor: Add keyboard shortcuts support for formatters
gziolo Oct 16, 2018
dee3216
Fix rebase error
ellatrix Oct 22, 2018
05b4e58
Fix shortcuts
ellatrix Oct 22, 2018
9b6665f
Remove registerCoreFormats
ellatrix Oct 22, 2018
5b533c7
Address feedback
ellatrix Oct 22, 2018
0aef345
Simplify filling slots
ellatrix Oct 22, 2018
ebb6604
Fix typos
ellatrix Oct 22, 2018
ba72e44
Fix inserter, move url function
ellatrix Oct 23, 2018
e9e3530
Fix rebase error
ellatrix Oct 23, 2018
b489b38
Enqueue format library styles
ellatrix Oct 23, 2018
69c1da4
Fix formatting on collapsed selection
ellatrix Oct 23, 2018
acb1ac1
Remove Token API
ellatrix Oct 23, 2018
6587b97
Remove obsolete RichText.Siblings slot
ellatrix Oct 23, 2018
56ed177
Remove all style imports
ellatrix Oct 24, 2018
a5f2f9a
Fix after rebase
ellatrix Oct 24, 2018
63e96ff
Fix dependency issue
ellatrix Oct 24, 2018
c2c9889
Use stable key for list of blocks in the inserter
gziolo Oct 25, 2018
b6dde3e
Fix Eslint issue for unsuded lodash method
gziolo Oct 25, 2018
f2b1fc9
Move Inline Elements to its own component
gziolo Oct 25, 2018
6ac8887
Import rich-text store only in the entry point (follow other modules)
gziolo Oct 25, 2018
35d017d
Rich Text: Expose unregister format type method
gziolo Oct 25, 2018
7fd020f
Don't use index for React element keys
ellatrix Oct 26, 2018
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+4 −4
Diff settings

Always

Just for now

Prev

Don't use index for React element keys

  • Loading branch information...
ellatrix committed Oct 26, 2018
commit 7fd020f9494f757d9ff773ccfe5f7eadab4c1827
@@ -69,7 +69,7 @@ class Shortcut extends Component {
const FormatEdit = ( { onChange, value } ) => {
return (
<Fragment>
{ getFormatTypes().map( ( { name, edit: Edit, keywords }, i ) => {
{ getFormatTypes().map( ( { name, edit: Edit, keywords } ) => {

This comment has been minimized.

Copy link
@gziolo

gziolo Oct 26, 2018

Member

I'm coming to the conclusion that we should be using withSelect to ensure this component re-renders every time someone register/unregisters a format type.

This comment has been minimized.

Copy link
@gziolo

gziolo Oct 26, 2018

Member

I think this is why when I unregister format I need to do some UI interactions before it gets removed.

This comment has been minimized.

Copy link
@gziolo

gziolo Oct 26, 2018

Member

Not a blocker! :)

This comment has been minimized.

Copy link
@ellatrix

ellatrix Oct 26, 2018

Author Member

Sounds good!

if ( ! Edit ) {
return null;
}
@@ -80,7 +80,7 @@ const FormatEdit = ( { onChange, value } ) => {

return (
<Edit
key={ i }
key={ name }
isActive={ isActive }
activeAttributes={ activeAttributes }
value={ value }
@@ -8,8 +8,8 @@ const FormatToolbar = ( { controls } ) => {
return (
<div className="editor-format-toolbar">
<Toolbar>
{ controls.map( ( format, index ) =>
<Slot name={ `RichText.ToolbarControls.${ format }` } key={ index } />
{ controls.map( ( format ) =>
<Slot name={ `RichText.ToolbarControls.${ format }` } key={ format } />
) }
</Toolbar>
</div>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.