-
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.
Merge branch 'master' into add/317-gallery-block
- Loading branch information
Showing
196 changed files
with
3,465 additions
and
1,010 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ gutenberg.pot | |
*.log | ||
yarn.lock | ||
gutenberg.zip | ||
storybook-static |
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,2 @@ | ||
import '@storybook/addon-knobs/register'; | ||
import '@storybook/addon-options/register'; |
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,33 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import 'prismjs'; | ||
import { configure, setAddon } from '@storybook/react'; | ||
import infoAddon from '@storybook/addon-info'; | ||
import { setOptions } from '@storybook/addon-options'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import * as element from 'element'; | ||
import './style.scss'; | ||
|
||
function loadStories() { | ||
window.wp = { ...window.wp, element }; | ||
require( '../components/story' ); | ||
require( '../components/button/story' ); | ||
} | ||
|
||
setOptions( { | ||
name: 'Gutenberg', | ||
url: 'https://github.com/WordPress/gutenberg', | ||
goFullScreen: false, | ||
showLeftPanel: true, | ||
showDownPanel: true, | ||
showSearchBox: false, | ||
downPanelInRight: true, | ||
sortStoriesByKind: false, | ||
} ); | ||
setAddon( infoAddon ); | ||
|
||
configure( loadStories, module ); |
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,52 @@ | ||
@import url( 'https://wordpress.org/wp-admin/load-styles.php?c=0&dir=ltr&load%5B%5D=common,buttons,dashicons,forms' ); | ||
|
||
html { | ||
height: auto; | ||
} | ||
|
||
body { | ||
background: none; | ||
padding: 20px; | ||
margin: 0; | ||
} | ||
|
||
p, h1, h2, li { | ||
// Match Info Addon Styling | ||
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif; | ||
color: rgb(68, 68, 68); | ||
-webkit-font-smoothing: antialiased; | ||
font-weight: 400; | ||
line-height: 1.45; | ||
font-size: 15px; | ||
} | ||
|
||
h1 { | ||
font-size: 2em; | ||
margin: .67em 0; | ||
font-weight: 600; | ||
} | ||
|
||
h2 { | ||
margin: 0px 0px 10px; | ||
padding: 0px; | ||
font-weight: 400; | ||
font-size: 22px; | ||
} | ||
|
||
pre { | ||
font-size: 0.88em; | ||
font-family: Menlo, Monaco, "Courier New", monospace; | ||
background-color: rgb(250, 250, 250); | ||
padding: 0.5rem; | ||
line-height: 1.5; | ||
overflow-x: auto !important; // Overrides the Info Addon Styling | ||
|
||
&:before, &:after { | ||
background: red; | ||
} | ||
} | ||
|
||
code { | ||
font-family: Menlo, Monaco, "Courier New", monospace; | ||
background-color: rgb(250, 250, 250); | ||
} |
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,35 @@ | ||
const config = require( '../webpack.config' ); | ||
const webpack = require( 'webpack' ); | ||
config.module.rules = [ | ||
// Exclude the sass loader to override it | ||
...config.module.rules.filter( ( rule ) => ! rule.test.test( '.scss' ) ), | ||
{ | ||
test: /\.md/, | ||
use: 'raw-loader', | ||
}, | ||
{ | ||
test: /\.scss$/, | ||
use: [ | ||
{ loader: 'style-loader' }, | ||
{ loader: 'css-loader' }, | ||
{ loader: 'postcss-loader' }, | ||
{ | ||
loader: 'sass-loader', | ||
query: { | ||
includePaths: [ 'editor/assets/stylesheets' ], | ||
data: '@import "variables"; @import "mixins"; @import "animations";@import "z-index";', | ||
outputStyle: 'production' === process.env.NODE_ENV ? | ||
'compressed' : 'nested', | ||
}, | ||
}, | ||
], | ||
}, | ||
]; | ||
config.externals = []; | ||
|
||
// Exclude Uglify Plugin to avoid breaking the React Components Display Name | ||
config.plugins = config.plugins.filter( plugin => { | ||
return plugin.constructor !== webpack.optimize.UglifyJsPlugin; | ||
} ); | ||
|
||
module.exports = config; |
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,40 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from 'i18n'; | ||
import { Toolbar } from 'components'; | ||
|
||
const ALIGNMENT_CONTROLS = [ | ||
{ | ||
icon: 'editor-alignleft', | ||
title: __( 'Align left' ), | ||
align: 'left', | ||
}, | ||
{ | ||
icon: 'editor-aligncenter', | ||
title: __( 'Align center' ), | ||
align: 'center', | ||
}, | ||
{ | ||
icon: 'editor-alignright', | ||
title: __( 'Align right' ), | ||
align: 'right', | ||
}, | ||
]; | ||
|
||
export default function AlignmentToolbar( { value, onChange } ) { | ||
return ( | ||
<Toolbar | ||
controls={ ALIGNMENT_CONTROLS.map( ( control ) => { | ||
const { align } = control; | ||
const isActive = ( value === align ); | ||
|
||
return { | ||
...control, | ||
isActive, | ||
onClick: () => onChange( isActive ? null : align ), | ||
}; | ||
} ) } | ||
/> | ||
); | ||
} |
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
Oops, something went wrong.