From ee47c2f2e468f40412f3c2cd037f553ba3d17252 Mon Sep 17 00:00:00 2001 From: Marko Andrijasevic Date: Thu, 4 Apr 2019 16:39:04 +0200 Subject: [PATCH 1/4] DevDocs: remove Gutenberg components and blocks Following the removal of Gutenlypso, it would probably be best to remove these examples to avoid confusion. --- client/devdocs/controller.js | 14 -- .../devdocs/design/component-playground.jsx | 10 +- client/devdocs/design/search-collection.jsx | 13 +- .../design/test/component-playground.js | 9 - client/devdocs/gutenberg-blocks/README.md | 7 - client/devdocs/gutenberg-blocks/example.jsx | 33 --- client/devdocs/gutenberg-blocks/examples.jsx | 237 ------------------ client/devdocs/gutenberg-blocks/index.jsx | 90 ------- client/devdocs/gutenberg-blocks/style.scss | 2 - client/devdocs/gutenberg-blocks/test/index.js | 62 ----- client/devdocs/gutenberg-components/README.md | 8 - .../devdocs/gutenberg-components/example.jsx | 77 ------ .../gutenberg-components/examples.json | 90 ------- client/devdocs/gutenberg-components/index.jsx | 98 -------- .../devdocs/gutenberg-components/style.scss | 6 - .../gutenberg-components/test/example.jsx | 75 ------ .../gutenberg-components/test/index.js | 57 ----- client/devdocs/index.js | 19 -- client/devdocs/sidebar.jsx | 19 -- client/devdocs/style.scss | 6 - client/gutenberg-blocks/README.md | 56 ----- client/gutenberg-blocks/gutenberg-block.jsx | 30 --- client/gutenberg-blocks/index.jsx | 1 - .../__snapshots__/gutenberg-block.js.snap | 7 - .../gutenberg-blocks/test/gutenberg-block.js | 30 --- client/gutenberg-components/README.md | 24 -- config/development.json | 1 - config/test.json | 1 - config/wpcalypso.json | 1 - 29 files changed, 3 insertions(+), 1080 deletions(-) delete mode 100644 client/devdocs/gutenberg-blocks/README.md delete mode 100644 client/devdocs/gutenberg-blocks/example.jsx delete mode 100644 client/devdocs/gutenberg-blocks/examples.jsx delete mode 100644 client/devdocs/gutenberg-blocks/index.jsx delete mode 100644 client/devdocs/gutenberg-blocks/style.scss delete mode 100644 client/devdocs/gutenberg-blocks/test/index.js delete mode 100644 client/devdocs/gutenberg-components/README.md delete mode 100644 client/devdocs/gutenberg-components/example.jsx delete mode 100644 client/devdocs/gutenberg-components/examples.json delete mode 100644 client/devdocs/gutenberg-components/index.jsx delete mode 100644 client/devdocs/gutenberg-components/style.scss delete mode 100644 client/devdocs/gutenberg-components/test/example.jsx delete mode 100644 client/devdocs/gutenberg-components/test/index.js delete mode 100644 client/gutenberg-blocks/README.md delete mode 100644 client/gutenberg-blocks/gutenberg-block.jsx delete mode 100644 client/gutenberg-blocks/index.jsx delete mode 100644 client/gutenberg-blocks/test/__snapshots__/gutenberg-block.js.snap delete mode 100644 client/gutenberg-blocks/test/gutenberg-block.js delete mode 100644 client/gutenberg-components/README.md diff --git a/client/devdocs/controller.js b/client/devdocs/controller.js index 3c587d06f6a22..b9291cf16af2c 100644 --- a/client/devdocs/controller.js +++ b/client/devdocs/controller.js @@ -167,20 +167,6 @@ const devdocs = { context.primary = React.createElement( DevWelcome, {} ); next(); }, - - // Gutenberg Components - gutenbergComponents: function( context, next ) { - context.primary = ( - - ); - next(); - }, - - // Gutenberg Blocks - gutenbergBlocks: function( context, next ) { - context.primary = ; - next(); - }, }; export default devdocs; diff --git a/client/devdocs/design/component-playground.jsx b/client/devdocs/design/component-playground.jsx index 7ddf6947e77a6..afbefd3f88d64 100644 --- a/client/devdocs/design/component-playground.jsx +++ b/client/devdocs/design/component-playground.jsx @@ -41,15 +41,7 @@ class ComponentPlayground extends Component { 'design__component-playground-code': true, 'show-code': toggleCode ? this.state.showCode : true, } ); - const { section } = this.props; - let scope = null; - switch ( section ) { - case 'gutenberg-blocks': - scope = require( 'gutenberg-blocks' ); - break; - default: - scope = require( 'devdocs/design/playground-scope' ); - } + const scope = require( 'devdocs/design/playground-scope' ); return ( { return ! filter || searchPattern.toLowerCase().indexOf( filter ) > -1; }; -const shouldShowEditLink = section => section !== 'gutenberg-components'; - const getReadmeFilePath = ( section, example ) => { switch ( section ) { case 'design': return `/client/components/${ example.props.readmeFilePath }/README.md`; - case 'gutenberg-components': - return `/node_modules/@wordpress/components/src/${ example.props.readmeFilePath }/README.md`; default: return `/client/${ section }/${ example.props.readmeFilePath }/README.md`; } @@ -69,7 +65,6 @@ const Collection = ( { camelCaseToSlug( exampleName ) ) }`; const readmeFilePath = getReadmeFilePath( section, example ); - const showEditLink = shouldShowEditLink( section ); showCounter++; @@ -93,9 +88,7 @@ const Collection = ( { component={ component } section={ section } /> - { component && ( - - ) } + { component && } ); } @@ -105,9 +98,7 @@ const Collection = ( { { example } - { component && ( - - ) } + { component && } ); } ); diff --git a/client/devdocs/design/test/component-playground.js b/client/devdocs/design/test/component-playground.js index c2898b82d6e1f..456b5cae17de3 100644 --- a/client/devdocs/design/test/component-playground.js +++ b/client/devdocs/design/test/component-playground.js @@ -16,7 +16,6 @@ import { LiveProvider } from 'react-live'; import ComponentPlayground from '../component-playground'; jest.mock( 'devdocs/design/playground-scope', () => 'PlaygroundScope' ); -jest.mock( 'gutenberg-blocks', () => 'GutenbergBlocks' ); describe( 'ComponentPlayground', () => { test( 'LiveProvider should use the components scope by default', () => { @@ -26,12 +25,4 @@ describe( 'ComponentPlayground', () => { const liveProvider = wrapper.find( LiveProvider ); expect( liveProvider.props().scope ).toBe( 'PlaygroundScope' ); } ); - - test( 'LiveProvider should use the Gutenberg blocks scope when section is Gutenberg blocks', () => { - const wrapper = shallow( - - ); - const liveProvider = wrapper.find( LiveProvider ); - expect( liveProvider.props().scope ).toBe( 'GutenbergBlocks' ); - } ); } ); diff --git a/client/devdocs/gutenberg-blocks/README.md b/client/devdocs/gutenberg-blocks/README.md deleted file mode 100644 index 5c9e816551217..0000000000000 --- a/client/devdocs/gutenberg-blocks/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Gutenberg Blocks - -Calypso provides all the built-in Gutenberg blocks included in the -[`@wordpress/block-library`](https://www.npmjs.com/package/@wordpress/block-library) package. - -Read the [Gutenberg blocks documentation](/devdocs/client/gutenberg-blocks/README.md) for -more in-depth information. diff --git a/client/devdocs/gutenberg-blocks/example.jsx b/client/devdocs/gutenberg-blocks/example.jsx deleted file mode 100644 index 921d9f8a383d7..0000000000000 --- a/client/devdocs/gutenberg-blocks/example.jsx +++ /dev/null @@ -1,33 +0,0 @@ -/** @format */ - -/** - * External dependencies - */ -import React from 'react'; - -/** - * Internal dependencies - */ -import { GutenbergBlock } from 'gutenberg-blocks'; - -const generateExample = ( { name, attributes, inner, level } ) => { - const innerExamples = inner - ? inner.map( ( innerExample, index ) => { - return generateExample( { - ...innerExample, - level: `${ level || 0 }_${ index }`, - } ); - } ) - : null; - - return ( - - { innerExamples } - - ); -}; - -const GutenbergBlockExample = ( { name, attributes, inner } ) => - generateExample( { name, attributes, inner } ); - -export { generateExample, GutenbergBlockExample }; diff --git a/client/devdocs/gutenberg-blocks/examples.jsx b/client/devdocs/gutenberg-blocks/examples.jsx deleted file mode 100644 index 70393fd545152..0000000000000 --- a/client/devdocs/gutenberg-blocks/examples.jsx +++ /dev/null @@ -1,237 +0,0 @@ -/** @format */ - -/** - * External dependencies - */ -import React from 'react'; - -export default [ - { - name: 'core/audio', - attributes: { - autoplay: false, - caption: 'Cartoon Birds', - loop: false, - preload: 'none', - src: 'http://soundbible.com/mp3/cartoon-birds-2_daniel-simion.mp3', - }, - }, - { - name: 'core/button', - attributes: { - text: 'Click here', - backgroundColor: 'vivid-cyan-blue', - url: 'https://wordpress.com', - title: 'Visit WordPress.com', - }, - }, - { - name: 'core/code', - attributes: { - content: 'export default function MyButton() {\n\treturn ;\n}', - }, - }, - { - name: 'core/columns', - attributes: { - columns: 2, - }, - inner: [ - { - name: 'core/column', - attributes: {}, - inner: [ - { - name: 'core/paragraph', - attributes: { - content: 'Column 1', - }, - }, - ], - }, - { - name: 'core/column', - attributes: {}, - inner: [ - { - name: 'core/paragraph', - attributes: { - content: 'Column 2', - }, - }, - ], - }, - ], - }, - { - name: 'core/cover-image', - attributes: { - url: 'https://cldup.com/Fz-ASbo2s3.jpg', - title: 'My title', - hasParallax: false, - dimRatio: 50, - align: 'center', - contentAlign: 'center', - }, - }, - { - name: 'core/file', - attributes: { - href: 'https://automattic.files.wordpress.com/2018/05/wordpressdotcom_wbadge-blk1.pdf', - fileName: 'WordPress.com Logo', - textLinkHref: - 'https://automattic.files.wordpress.com/2018/05/wordpressdotcom_wbadge-blk1.pdf', - textLinkTarget: '_blank', - showDownloadButton: true, - downloadButtonText: 'Download', - }, - }, - { - name: 'core/gallery', - attributes: { - images: [ - { - url: 'https://cldup.com/n0g6ME5VKC.jpg', - caption: 'Image 1', - }, - { - url: 'https://cldup.com/ZjESfxPI3R.jpg', - caption: 'Image 2', - }, - { - url: 'https://cldup.com/EKNF8xD2UM.jpg', - caption: 'Image 3', - }, - ], - columns: 2, - imageCrop: true, - }, - }, - { - name: 'core/heading', - attributes: { - align: 'center', - level: 2, - content: 'My heading', - }, - }, - { - name: 'core/image', - attributes: { - url: 'https://cldup.com/8lhI-gKnI2.jpg', - alt: 'My image', - caption: 'My image', - align: 'left', - href: 'https://cldup.com/8lhI-gKnI2.jpg', - width: '200', - height: '200', - id: 123, - }, - }, - { - name: 'core/list', - attributes: { - ordered: false, - values: [
  • Item 1
  • ,
  • Item 2
  • ], - }, - }, - { - name: 'core/paragraph', - attributes: { - align: 'center', - content: 'This is a paragraph', - dropCap: false, - }, - }, - { - name: 'core/preformatted', - attributes: { - content: 'Text with\nspacings\n\tand tabs', - }, - }, - { - name: 'core/pullquote', - attributes: { - value: [ - { - children: '

    Code is poetry

    ', - }, - ], - citation: [ 'The WordPress community' ], - }, - }, - { - name: 'core/quote', - attributes: { - value: [ - { - children: '

    Code is poetry

    ', - }, - ], - citation: [ 'The WordPress community' ], - align: 'left', - className: 'is-style-large', - }, - }, - { - name: 'core/separator', - attributes: {}, - }, - { - name: 'core/spacer', - attributes: { - height: 150, - }, - }, - { - name: 'core/subhead', - attributes: { - align: 'center', - content: 'My subhead', - }, - }, - { - name: 'core/table', - attributes: { - content: 'Cell 1Cell 2', - hasFixedLayout: true, - }, - }, - { - name: 'core/text-columns', - attributes: { - content: [ { children: 'Column 1' }, { children: 'Column 2' } ], - columns: 2, - width: 'center', - }, - }, - { - name: 'core/verse', - attributes: { - content: - 'An old silent pond...\n' + - 'A frog jumps into the pond,\n' + - 'splash! Silence again.\n' + - '\n' + - 'Autumn moonlight—\n' + - 'a worm digs silently\n' + - 'into the chestnut.\n' + - '\n' + - 'In the twilight rain\n' + - 'these brilliant-hued hibiscus —\n' + - 'A lovely sunset.', - textAlign: 'center', - }, - }, - { - name: 'core/video', - attributes: { - autoplay: false, - caption: '', - controls: true, - loop: false, - muted: false, - src: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv', - }, - }, -]; diff --git a/client/devdocs/gutenberg-blocks/index.jsx b/client/devdocs/gutenberg-blocks/index.jsx deleted file mode 100644 index 37e65a42d0149..0000000000000 --- a/client/devdocs/gutenberg-blocks/index.jsx +++ /dev/null @@ -1,90 +0,0 @@ -/** @format */ - -/** - * External dependencies - */ -import React from 'react'; -import classnames from 'classnames'; -import { registerCoreBlocks } from '@wordpress/block-library'; -import page from 'page'; -import { trim } from 'lodash'; - -/** - * Internal dependencies - */ -import DocumentHead from 'components/data/document-head'; -import Main from 'components/main'; -import ReadmeViewer from 'components/readme-viewer'; -import { slugToCamelCase } from '../docs-example/util'; -import HeaderCake from 'components/header-cake'; -import SearchCard from 'components/search-card'; -import Collection from 'devdocs/design/search-collection'; -import { GutenbergBlockExample, generateExample } from './example'; -import examples from './examples'; - -/** - * Style dependencies - */ -import './style.scss'; - -registerCoreBlocks(); - -export default class GutenbergBlocks extends React.Component { - state = { filter: '' }; - - backToAll = () => { - page( '/devdocs/gutenberg-blocks/' ); - }; - - onSearch = term => { - this.setState( { filter: trim( term || '' ).toLowerCase() } ); - }; - - render() { - const { block } = this.props; - const { filter } = this.state; - - const className = classnames( 'devdocs', 'devdocs__gutenberg-blocks', { - 'is-single': block, - 'is-list': ! block, - } ); - - return ( -
    - - - { block ? ( - - { slugToCamelCase( block ) } - - ) : ( -
    - - -
    - ) } - - - { examples.map( example => { - const exampleCode = generateExample( example ); - return ( - - ); - } ) } - -
    - ); - } -} diff --git a/client/devdocs/gutenberg-blocks/style.scss b/client/devdocs/gutenberg-blocks/style.scss deleted file mode 100644 index 11a3de7212d93..0000000000000 --- a/client/devdocs/gutenberg-blocks/style.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import '~@wordpress/block-library/build-style/style'; -@import '~@wordpress/block-library/build-style/theme'; diff --git a/client/devdocs/gutenberg-blocks/test/index.js b/client/devdocs/gutenberg-blocks/test/index.js deleted file mode 100644 index 161db2bc4f4c6..0000000000000 --- a/client/devdocs/gutenberg-blocks/test/index.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @format - * @jest-environment jsdom - */ - -/** - * External dependencies - */ -import React from 'react'; -import { shallow } from 'enzyme'; -import page from 'page'; -import { registerCoreBlocks } from '@wordpress/block-library'; - -/** - * Internal dependencies - */ -import GutenbergBlocks from '../'; -import HeaderCake from 'components/header-cake'; -import ReadmeViewer from 'components/readme-viewer'; -import Collection from 'devdocs/design/search-collection'; -import { GutenbergBlockExample } from '../example'; -import examplesList from '../examples'; - -jest.mock( 'page' ); -jest.mock( '@wordpress/block-library', () => ( { - registerCoreBlocks: jest.fn(), -} ) ); - -describe( 'GutenbergBlocks', () => { - test( 'should render all the blocks by default', () => { - const wrapper = shallow( ); - const headerCake = wrapper.find( HeaderCake ); - const readmeViewer = wrapper.find( ReadmeViewer ); - const collection = wrapper.find( Collection ); - const examples = wrapper.find( GutenbergBlockExample ); - expect( wrapper.hasClass( 'is-list' ) ).toBe( true ); - expect( headerCake ).toHaveLength( 0 ); - expect( readmeViewer ).toHaveLength( 1 ); - expect( readmeViewer.props().readmeFilePath ).toBe( - '/client/devdocs/gutenberg-blocks/README.md' - ); - expect( collection.children() ).toEqual( examples ); - expect( examples ).toHaveLength( examplesList.length ); - expect( registerCoreBlocks ).toBeCalled(); - } ); - - test( 'should render a single block when a component is given', () => { - const wrapper = shallow( ); - const headerCake = wrapper.find( HeaderCake ); - const readmeViewer = wrapper.find( ReadmeViewer ); - expect( wrapper.hasClass( 'is-single' ) ).toBe( true ); - expect( headerCake ).toHaveLength( 1 ); - expect( readmeViewer ).toHaveLength( 0 ); - } ); - - test( 'should go back when clicking in HeaderCake', () => { - const wrapper = shallow( ); - const headerCake = wrapper.find( HeaderCake ); - headerCake.simulate( 'click' ); - expect( page ).toBeCalledWith( '/devdocs/gutenberg-blocks/' ); - } ); -} ); diff --git a/client/devdocs/gutenberg-components/README.md b/client/devdocs/gutenberg-components/README.md deleted file mode 100644 index 5b6e69886b21f..0000000000000 --- a/client/devdocs/gutenberg-components/README.md +++ /dev/null @@ -1,8 +0,0 @@ -Gutenberg Components -==== - -Gutenberg components are React components included in the -[`@wordpress/components`](https://www.npmjs.com/package/@wordpress/components) package. - -Read the [Gutenberg components documentation](/devdocs/client/gutenberg-components/README.md) for -more in-depth information. diff --git a/client/devdocs/gutenberg-components/example.jsx b/client/devdocs/gutenberg-components/example.jsx deleted file mode 100644 index c1c2179e0684d..0000000000000 --- a/client/devdocs/gutenberg-components/example.jsx +++ /dev/null @@ -1,77 +0,0 @@ -/** @format */ - -/** - * External dependencies - */ -import React from 'react'; -import * as components from '@wordpress/components'; -import { withState } from '@wordpress/compose'; -import { __experimentalGetSettings } from '@wordpress/date'; -import { addFilter } from '@wordpress/hooks'; -import { LiveError, LivePreview, LiveProvider } from 'react-live'; -import request from 'superagent'; -import codeBlocks from 'gfm-code-blocks'; -import classnames from 'classnames'; -import { kebabCase } from 'lodash'; -import PropTypes from 'prop-types'; - -class Example extends React.Component { - state = { - code: null, - }; - - componentDidMount() { - this.getCode(); - } - - async getReadme() { - const readmeFilePath = `/node_modules/@wordpress/components/src/${ - this.props.readmeFilePath - }/README.md`; - - const { text } = await request.get( '/devdocs/service/content' ).query( { - path: readmeFilePath, - format: 'markdown', - } ); - return text; - } - - async getCode() { - const readme = await this.getReadme(); - - // Example to render is the first jsx code block that appears in the readme - let code = codeBlocks( readme ).find( block => 'jsx' === block.lang ).code; - - // react-live cannot resolve imports in real time, so we get rid of them - // (dependencies will be injected via the scope property). - code = code.replace( /^.*import.*$/gm, '' ); - - code = `${ code } render( <${ this.props.render } /> );`; - - this.setState( { code } ); - } - - render() { - const { code } = this.state; - const scope = { - ...components, - withState, - __experimentalGetSettings, - PropTypes, - addFilter, - }; - const className = classnames( - 'devdocs__gutenberg-components-example', - `devdocs__gutenberg-components-example--${ kebabCase( this.props.component ) }` - ); - - return code ? ( - - - - - ) : null; - } -} - -export default Example; diff --git a/client/devdocs/gutenberg-components/examples.json b/client/devdocs/gutenberg-components/examples.json deleted file mode 100644 index b0e171c3b4e12..0000000000000 --- a/client/devdocs/gutenberg-components/examples.json +++ /dev/null @@ -1,90 +0,0 @@ -[ - { "component": "Autocomplete" }, - { "component": "BaseControl" }, - { "component": "Button" }, - { "component": "ButtonGroup" }, - { "component": "CheckboxControl" }, - { "component": "ClipboardButton" }, - { "component": "ColorIndicator" }, - { "component": "ColorPalette" }, - { "component": "Dashicon" }, - { "component": "DateTimePicker", "readmeFilePath": "date-time" }, - { "component": "Disabled" }, - { "component": "Draggable" }, - { "component": "DropZone" }, - { "component": "Dropdown" }, - { "component": "DropdownMenu" }, - { "component": "ExternalLink" }, - { "component": "FocusableIframe" }, - { "component": "FontSizePicker" }, - { "component": "FormFileUpload" }, - { "component": "FormToggle" }, - { "component": "FormTokenField" }, - { "component": "IconButton" }, - { "component": "KeyboardShortcuts" }, - { "component": "MenuGroup" }, - { "component": "MenuItem" }, - { "component": "MenuItemsChoice" }, - { "component": "Modal" }, - { - "component": "navigateRegions", - "readmeFilePath": "higher-order/navigate-regions", - "render": "MyComponentWithNavigateRegions" - }, - { "component": "NavigableContainer" }, - { "component": "Notice" }, - { "component": "Panel" }, - { "component": "Placeholder" }, - { "component": "Popover" }, - { "component": "QueryControls" }, - { "component": "RadioControl" }, - { "component": "RangeControl" }, - { "component": "ResponsiveWrapper" }, - { "component": "SandBox", "readmeFilePath": "sandbox" }, - { "component": "ScrollLock" }, - { "component": "SelectControl" }, - { "component": "SlotFillProvider", "readmeFilePath": "slot-fill" }, - { "component": "Spinner" }, - { "component": "TabPanel" }, - { "component": "TextControl" }, - { "component": "TextareaControl" }, - { "component": "ToggleControl" }, - { "component": "Toolbar" }, - { "component": "Tooltip" }, - { "component": "TreeSelect" }, - { - "component": "withConstrainedTabbing", - "readmeFilePath": "higher-order/with-constrained-tabbing", - "render": "MyComponentWithConstrainedTabbing" - }, - { - "component": "withFallbackStyles", - "readmeFilePath": "higher-order/with-fallback-styles", - "render": "MyComponentWithFallbackStyles" - }, - { - "component": "withFilters", - "readmeFilePath": "higher-order/with-filters", - "render": "MyComponentWithFilters" - }, - { - "component": "withFocusOutside", - "readmeFilePath": "higher-order/with-focus-outside", - "render": "MyComponentWithFocusOutside" - }, - { - "component": "withFocusReturn", - "readmeFilePath": "higher-order/with-focus-return", - "render": "MyComponentWithFocusReturn" - }, - { - "component": "withNotices", - "readmeFilePath": "higher-order/with-notices", - "render": "MyComponentWithNotices" - }, - { - "component": "withSpokenMessages", - "readmeFilePath": "higher-order/with-spoken-messages", - "render": "MyComponentWithSpokenMessages" - } -] diff --git a/client/devdocs/gutenberg-components/index.jsx b/client/devdocs/gutenberg-components/index.jsx deleted file mode 100644 index 6ca316ea1062b..0000000000000 --- a/client/devdocs/gutenberg-components/index.jsx +++ /dev/null @@ -1,98 +0,0 @@ -/** @format */ - -/** - * External dependencies - */ -import React from 'react'; -import classnames from 'classnames'; -import page from 'page'; -import { get, trim } from 'lodash'; - -/** - * Internal dependencies - */ -import Collection from 'devdocs/design/search-collection'; -import DocumentHead from 'components/data/document-head'; -import HeaderCake from 'components/header-cake'; -import Main from 'components/main'; -import ReadmeViewer from 'components/readme-viewer'; -import SearchCard from 'components/search-card'; -import { camelCaseToSlug, slugToCamelCase } from 'devdocs/docs-example/util'; -import GutenbergComponentExample from './example'; -import examples from './examples.json'; - -/** - * Style dependencies - */ -import './style.scss'; - -const getExampleData = example => { - const componentName = get( example, 'component' ); - const readmeFilePath = get( example, 'readmeFilePath', camelCaseToSlug( componentName ) ); - const render = get( example, 'render', `My${ componentName }` ); - - return { - componentName, - readmeFilePath, - render, - }; -}; - -export default class extends React.Component { - state = { filter: '' }; - - backToAll = () => { - page( '/devdocs/gutenberg-components/' ); - }; - - onSearch = term => { - this.setState( { filter: trim( term || '' ).toLowerCase() } ); - }; - - render() { - const { component } = this.props; - const { filter } = this.state; - - const className = classnames( 'devdocs', 'devdocs__gutenberg-components', { - 'is-single': component, - 'is-list': ! component, - } ); - - return ( -
    - - - { component ? ( - - { slugToCamelCase( component ) } - - ) : ( -
    - - -
    - ) } - - - { examples.map( example => { - const { componentName, readmeFilePath, render } = getExampleData( example ); - return ( - - ); - } ) } - -
    - ); - } -} diff --git a/client/devdocs/gutenberg-components/style.scss b/client/devdocs/gutenberg-components/style.scss deleted file mode 100644 index 8936c8e62fee9..0000000000000 --- a/client/devdocs/gutenberg-components/style.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import '~@wordpress/components/build-style/style'; - -// Styles the contenteditable div included in the Gutenberg Autocomplete component example as an input -.devdocs__gutenberg-components-example--autocomplete [contenteditable] { - @extend %form-field; -} diff --git a/client/devdocs/gutenberg-components/test/example.jsx b/client/devdocs/gutenberg-components/test/example.jsx deleted file mode 100644 index b7075178e35e5..0000000000000 --- a/client/devdocs/gutenberg-components/test/example.jsx +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @format - * @jest-environment jsdom - */ - -/** - * External dependencies - */ -import React from 'react'; -import { shallow } from 'enzyme'; -import request from 'superagent'; - -/** - * Internal dependencies - */ -import GutenbergComponentExample from '../example'; - -jest.mock( 'superagent', () => ( { - get: jest.fn().mockReturnThis(), - query: jest.fn().mockResolvedValue( { text: 'foo' } ), -} ) ); - -describe( 'GutenbergComponentExample', () => { - test( 'should retrieve the code when mounted', () => { - const wrapper = shallow( , { - disableLifecycleMethods: true, - } ); - wrapper.instance().getCode = jest.fn(); - wrapper.instance().componentDidMount(); - expect( wrapper.instance().getCode ).toHaveBeenCalled(); - } ); - - test( 'should retrieve the README file from node_modules', async () => { - const wrapper = shallow( , { - disableLifecycleMethods: true, - } ); - await wrapper.instance().getReadme(); - expect( request.get ).toHaveBeenCalledWith( '/devdocs/service/content' ); - expect( request.query ).toHaveBeenCalledWith( { - path: '/node_modules/@wordpress/components/src/bar/README.md', - format: 'markdown', - } ); - } ); - - test( 'should get the code from the first jsx block', async () => { - const wrapper = shallow( , { - disableLifecycleMethods: true, - } ); - const mockedReadme = '# test\n```jsx\nmy code\n```\n```jsx\ntest\n```'; - wrapper.instance().getReadme = jest.fn().mockResolvedValue( mockedReadme ); - await wrapper.instance().getCode(); - expect( wrapper.state().code ).toContain( 'my code' ); - expect( wrapper.state().code ).not.toContain( 'test' ); - } ); - - test( 'should remove the imports from the example', async () => { - const wrapper = shallow( , { - disableLifecycleMethods: true, - } ); - const mockedReadme = '```jsx\nimport test\nmy code\n```'; - wrapper.instance().getReadme = jest.fn().mockResolvedValue( mockedReadme ); - await wrapper.instance().getCode(); - expect( wrapper.state().code ).not.toContain( 'import test' ); - } ); - - test( 'should render the given component', async () => { - const wrapper = shallow( , { - disableLifecycleMethods: true, - } ); - const mockedReadme = '```jsx\nmy code\n```'; - wrapper.instance().getReadme = jest.fn().mockResolvedValue( mockedReadme ); - await wrapper.instance().getCode(); - expect( wrapper.state().code ).toContain( 'render( )' ); - } ); -} ); diff --git a/client/devdocs/gutenberg-components/test/index.js b/client/devdocs/gutenberg-components/test/index.js deleted file mode 100644 index 4de95c2657cfe..0000000000000 --- a/client/devdocs/gutenberg-components/test/index.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @format - * @jest-environment jsdom - */ - -/** - * External dependencies - */ -import React from 'react'; -import { shallow } from 'enzyme'; -import page from 'page'; - -/** - * Internal dependencies - */ -import GutenbergComponents from '../'; -import HeaderCake from 'components/header-cake'; -import ReadmeViewer from 'components/readme-viewer'; -import Collection from 'devdocs/design/search-collection'; -import GutenbergComponentExample from '../example'; -import examplesList from '../examples.json'; - -jest.mock( 'page' ); - -describe( 'GutenbergComponents', () => { - test( 'should render all the components by default', () => { - const wrapper = shallow( ); - const headerCake = wrapper.find( HeaderCake ); - const readmeViewer = wrapper.find( ReadmeViewer ); - const collection = wrapper.find( Collection ); - const examples = wrapper.find( GutenbergComponentExample ); - expect( wrapper.hasClass( 'is-list' ) ).toBe( true ); - expect( headerCake ).toHaveLength( 0 ); - expect( readmeViewer ).toHaveLength( 1 ); - expect( readmeViewer.props().readmeFilePath ).toBe( - '/client/devdocs/gutenberg-components/README.md' - ); - expect( collection.children() ).toEqual( examples ); - expect( examples ).toHaveLength( examplesList.length ); - } ); - - test( 'should render a single component when a component is given', () => { - const wrapper = shallow( ); - const headerCake = wrapper.find( HeaderCake ); - const readmeViewer = wrapper.find( ReadmeViewer ); - expect( wrapper.hasClass( 'is-single' ) ).toBe( true ); - expect( headerCake ).toHaveLength( 1 ); - expect( readmeViewer ).toHaveLength( 0 ); - } ); - - test( 'should go back when clicking in HeaderCake', () => { - const wrapper = shallow( ); - const headerCake = wrapper.find( HeaderCake ); - headerCake.simulate( 'click' ); - expect( page ).toBeCalledWith( '/devdocs/gutenberg-components/' ); - } ); -} ); diff --git a/client/devdocs/index.js b/client/devdocs/index.js index 334b71be0bb79..eefbcfd63473d 100644 --- a/client/devdocs/index.js +++ b/client/devdocs/index.js @@ -71,25 +71,6 @@ export default function() { ); page( '/devdocs/start', controller.pleaseLogIn, makeLayout, clientRender ); page( '/devdocs/welcome', controller.sidebar, controller.welcome, makeLayout, clientRender ); - - if ( config.isEnabled( 'devdocs/gutenberg-blocks' ) ) { - page( - '/devdocs/gutenberg-components/:component?', - controller.sidebar, - controller.gutenbergComponents, - makeLayout, - clientRender - ); - - page( - '/devdocs/gutenberg-blocks/:block*', - controller.sidebar, - controller.gutenbergBlocks, - makeLayout, - clientRender - ); - } - page( '/devdocs/:path*', controller.sidebar, controller.singleDoc, makeLayout, clientRender ); } } diff --git a/client/devdocs/sidebar.jsx b/client/devdocs/sidebar.jsx index dfa516de102f1..f2b209df221d6 100644 --- a/client/devdocs/sidebar.jsx +++ b/client/devdocs/sidebar.jsx @@ -13,7 +13,6 @@ import Sidebar from 'layout/sidebar'; import SidebarHeading from 'layout/sidebar/heading'; import SidebarMenu from 'layout/sidebar/menu'; import SidebarItem from 'layout/sidebar/item'; -import { isEnabled } from 'config'; export default class DevdocsSidebar extends React.PureComponent { static displayName = 'DevdocsSidebar'; @@ -104,24 +103,6 @@ export default class DevdocsSidebar extends React.PureComponent { link="/devdocs/blocks" selected={ this.isItemSelected( '/devdocs/blocks', false ) } /> - { isEnabled( 'devdocs/gutenberg-blocks' ) && ( - - ) } - { isEnabled( 'devdocs/gutenberg-blocks' ) && ( - - ) } ( - -); -``` - -The previous example is equivalent to: - -```jsx -import { createBlock, serialize } from '@wordpress/blocks'; -import { RawHTML } from '@wordpress/element'; - -const MyButton = ( ) => { - const block = createBlock( 'core/button', { - text: 'Click here', - backgroundColor: 'vivid-cyan-blue', - url: 'https://wordpress.com', - }, [] ); - - return { serialize( block ) }; -}; -``` - -Some of these blocks can be seen in action in our -[DevDocs: Gutenberg Blocks](/devdocs/gutenberg-blocks) section. diff --git a/client/gutenberg-blocks/gutenberg-block.jsx b/client/gutenberg-blocks/gutenberg-block.jsx deleted file mode 100644 index 7e2100ea1ace4..0000000000000 --- a/client/gutenberg-blocks/gutenberg-block.jsx +++ /dev/null @@ -1,30 +0,0 @@ -/** @format */ - -/** - * External dependencies - */ -import React from 'react'; -import { createBlock, serialize } from '@wordpress/blocks'; -import { RawHTML } from '@wordpress/element'; - -const createBlockWithInnerBlocks = ( name, attributes, children ) => { - const innerBlocks = children - ? React.Children.map( children, innerBlock => - createBlockWithInnerBlocks( - innerBlock.props.name, - innerBlock.props.attributes, - innerBlock.props.children - ) - ) - : []; - return createBlock( name, attributes, innerBlocks ); -}; - -const GutenbergBlock = ( { name, attributes, children } ) => { - const block = createBlockWithInnerBlocks( name, attributes, children ); - return { serialize( block ) }; -}; - -GutenbergBlock.displayName = 'GutenbergBlock'; - -export default GutenbergBlock; diff --git a/client/gutenberg-blocks/index.jsx b/client/gutenberg-blocks/index.jsx deleted file mode 100644 index 6f42a03bb30cb..0000000000000 --- a/client/gutenberg-blocks/index.jsx +++ /dev/null @@ -1 +0,0 @@ -export GutenbergBlock from './gutenberg-block'; diff --git a/client/gutenberg-blocks/test/__snapshots__/gutenberg-block.js.snap b/client/gutenberg-blocks/test/__snapshots__/gutenberg-block.js.snap deleted file mode 100644 index 5a5ad6d724069..0000000000000 --- a/client/gutenberg-blocks/test/__snapshots__/gutenberg-block.js.snap +++ /dev/null @@ -1,7 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`GutenbergBlock should render correctly 1`] = ` - - serialize-foo - -`; diff --git a/client/gutenberg-blocks/test/gutenberg-block.js b/client/gutenberg-blocks/test/gutenberg-block.js deleted file mode 100644 index 0dde7b1ba5f40..0000000000000 --- a/client/gutenberg-blocks/test/gutenberg-block.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @format - * @jest-environment jsdom - */ - -/** - * External dependencies - */ -import React from 'react'; -import { shallow } from 'enzyme'; -import { createBlock, serialize } from '@wordpress/blocks'; - -/** - * Internal dependencies - */ -import { GutenbergBlock } from '../'; - -jest.mock( '@wordpress/blocks', () => ( { - createBlock: jest.fn( () => 'block-foo' ), - serialize: jest.fn( () => 'serialize-foo' ), -} ) ); - -describe( 'GutenbergBlock', () => { - test( 'should render correctly', () => { - const wrapper = shallow( ); - expect( wrapper ).toMatchSnapshot(); - expect( createBlock ).toBeCalledWith( 'foo', 'bar', [] ); - expect( serialize ).toBeCalledWith( 'block-foo' ); - } ); -} ); diff --git a/client/gutenberg-components/README.md b/client/gutenberg-components/README.md deleted file mode 100644 index b8abef7bd37a8..0000000000000 --- a/client/gutenberg-components/README.md +++ /dev/null @@ -1,24 +0,0 @@ -Gutenberg Components -==== - -These are components maintained by [Gutenberg](https://wordpress.org/gutenberg/), the new publish -experience for WordPress. They are generic WordPress components to be used for creating common UI -elements shared between screens and features of the WordPress dashboard. - -These components can be accessed by importing from the -[`@wordpress/components`](https://www.npmjs.com/package/@wordpress/components) package, which is -available in Calypso. - -```jsx -/** - * External dependencies - */ -import { Button } from '@wordpress/components'; - -export default function MyButton() { - return ; -} -``` - -Some of these components can be seen in action in our -[DevDocs: Gutenberg Components](/devdocs/gutenberg-components) section. diff --git a/config/development.json b/config/development.json index 62c8b7aaa4f60..7c678e29018d3 100644 --- a/config/development.json +++ b/config/development.json @@ -50,7 +50,6 @@ "devdocs": true, "devdocs/redirect-loggedout-homepage": true, "devdocs/components-usage-stats": false, - "devdocs/gutenberg-blocks": true, "devdocs/color-scheme-picker": true, "dev/test-helper": true, "dev/preferences-helper": true, diff --git a/config/test.json b/config/test.json index b413a9358fbb9..38926cac69b8e 100644 --- a/config/test.json +++ b/config/test.json @@ -40,7 +40,6 @@ "devdocs": true, "devdocs/redirect-loggedout-homepage": true, "devdocs/components-usage-stats": false, - "devdocs/gutenberg-blocks": true, "gdpr-banner": false, "google-analytics": false, "google-my-business": false, diff --git a/config/wpcalypso.json b/config/wpcalypso.json index 445c063c942b5..0e5465fa4dc2f 100644 --- a/config/wpcalypso.json +++ b/config/wpcalypso.json @@ -31,7 +31,6 @@ "devdocs": true, "devdocs/redirect-loggedout-homepage": false, "devdocs/components-usage-stats": false, - "devdocs/gutenberg-blocks": true, "devdocs/color-scheme-picker": true, "dev/test-helper": true, "dev/preferences-helper": true, From 2bcb8ecc6972d9ff7b3433232265f146376b4812 Mon Sep 17 00:00:00 2001 From: Marko Andrijasevic Date: Thu, 4 Apr 2019 17:36:30 +0200 Subject: [PATCH 2/4] Package removal --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index 7dc9d1bfeedbe..b86b4e336cc42 100644 --- a/package.json +++ b/package.json @@ -47,15 +47,12 @@ "@babel/polyfill": "7.4.0", "@babel/preset-env": "7.4.2", "@babel/runtime": "7.4.2", - "@wordpress/block-library": "2.2.16", "@wordpress/blocks": "6.0.7", "@wordpress/browserslist-config": "2.3.0", "@wordpress/components": "7.0.8", "@wordpress/compose": "3.0.1", - "@wordpress/date": "3.0.1", "@wordpress/edit-post": "3.1.11", "@wordpress/element": "2.1.9", - "@wordpress/hooks": "2.0.5", "@wordpress/i18n": "3.1.1", "@wordpress/url": "2.3.3", "acorn": "6.1.1", From a079c5781e898d77bb80fc2fd5ede6af95c57e56 Mon Sep 17 00:00:00 2001 From: Marko Andrijasevic Date: Tue, 9 Apr 2019 10:57:02 +0200 Subject: [PATCH 3/4] Restore deleted CSS --- client/devdocs/style.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/devdocs/style.scss b/client/devdocs/style.scss index d0a4099d71c80..f17c639b06a83 100644 --- a/client/devdocs/style.scss +++ b/client/devdocs/style.scss @@ -48,7 +48,11 @@ $devdocs-max-width: 720px; // Block and Component examples .main.devdocs.devdocs__blocks, -.main.devdocs.devdocs__components, +.main.devdocs.devdocs__components { + // Make way for showing big components and multiple columns + max-width: 100%; +} + .design__collection { // Use multiple columns when listing components .main.devdocs.is-list & { From 7f1567751872c6e339b39b7837a281f97957a84c Mon Sep 17 00:00:00 2001 From: Marko Andrijasevic Date: Tue, 9 Apr 2019 11:00:26 +0200 Subject: [PATCH 4/4] Update deps --- npm-shrinkwrap.json | 259 +++++++++++++++++++++++++++++--------------- 1 file changed, 172 insertions(+), 87 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 69d5daa14493b..ffd2abd351164 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2915,14 +2915,6 @@ "react-dom": "^16.8.4" } }, - "@wordpress/hooks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.2.0.tgz", - "integrity": "sha512-pzLDgcQOPCU4xSN0yuGoPd9xeNW2MnB2o7O52qaFZ2DSmf9tN+OkPDg7lKsg7SEds0J7GngBS8tu+a4Lqywy/w==", - "requires": { - "@babel/runtime": "^7.3.1" - } - }, "@wordpress/i18n": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.3.0.tgz", @@ -2948,29 +2940,169 @@ } }, "@wordpress/block-library": { - "version": "2.2.16", - "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-2.2.16.tgz", - "integrity": "sha512-7HoqV7myTdmClOQZ3MXPQs8FXflqK6krU4Nkx8kyl6/b/gbZSaqJhbeDpZ+w56wOrTTaNi7OrPDH9t2M18nBdA==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-2.4.2.tgz", + "integrity": "sha512-AN1kwaFfZIPQpLJMkOEpyeYvOuA+SdTC9CX3PBuq6KHOKobJL9DIF006lqfL+aVEtxCURCvotPId5xUToF4Yww==", "requires": { - "@babel/runtime": "^7.0.0", - "@wordpress/autop": "^2.0.2", - "@wordpress/blob": "^2.1.0", - "@wordpress/blocks": "^6.0.7", - "@wordpress/components": "^7.0.8", - "@wordpress/compose": "^3.0.1", - "@wordpress/core-data": "^2.0.17", - "@wordpress/data": "^4.2.1", - "@wordpress/deprecated": "^2.0.5", - "@wordpress/editor": "^9.0.11", - "@wordpress/element": "^2.1.9", - "@wordpress/html-entities": "^2.0.4", - "@wordpress/i18n": "^3.1.1", - "@wordpress/keycodes": "^2.0.6", - "@wordpress/viewport": "^2.1.1", + "@babel/runtime": "^7.3.1", + "@wordpress/autop": "^2.2.0", + "@wordpress/blob": "^2.3.0", + "@wordpress/block-editor": "^1.1.2", + "@wordpress/blocks": "^6.2.2", + "@wordpress/components": "^7.2.2", + "@wordpress/compose": "^3.2.0", + "@wordpress/core-data": "^2.2.2", + "@wordpress/data": "^4.4.0", + "@wordpress/deprecated": "^2.2.0", + "@wordpress/editor": "^9.2.2", + "@wordpress/element": "^2.3.0", + "@wordpress/html-entities": "^2.2.0", + "@wordpress/i18n": "^3.3.0", + "@wordpress/keycodes": "^2.2.0", + "@wordpress/viewport": "^2.3.0", "classnames": "^2.2.5", - "lodash": "^4.17.10", + "fast-average-color": "4.3.0", + "lodash": "^4.17.11", "memize": "^1.0.5", "url": "^0.11.0" + }, + "dependencies": { + "@wordpress/api-fetch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-3.1.2.tgz", + "integrity": "sha512-QgvgNrFwCgKBoY7/1aNyYFV9lcKdI9RStVkQAitdhvpNKom8mydVf0Tm2zmC/rAx+NMZ65Gn8FoOMCMV5l/Yng==", + "requires": { + "@babel/runtime": "^7.3.1", + "@wordpress/i18n": "^3.3.0", + "@wordpress/url": "^2.5.0" + } + }, + "@wordpress/block-serialization-default-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-3.1.0.tgz", + "integrity": "sha512-SmxvnZ5N4L+H/lpq/orJetdK98Ij9BHWhcbBu5+NCfRho0RcErmVxj107VSpcP5s4METEvVRpmGcxG+Xr4aWtw==", + "requires": { + "@babel/runtime": "^7.3.1" + } + }, + "@wordpress/block-serialization-spec-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-spec-parser/-/block-serialization-spec-parser-3.0.0.tgz", + "integrity": "sha512-G2rjbECdR5yMfWpezhT/5TzqnGbhkaCBeHrBC949ii+cH9RfljX+8HiiCWmc8uCTX/oT9ORxYI68FWmAVxS5vQ==", + "requires": { + "pegjs": "^0.10.0" + } + }, + "@wordpress/blocks": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-6.2.2.tgz", + "integrity": "sha512-6wA+wlJ7bnnGuefURWDrqgWNx8mkqLJ8xcsQ9jJ+/XrGyi9IcxaBONHQJe+S5zpxMXf9NKzf7Vzc2K1aJh40+A==", + "requires": { + "@babel/runtime": "^7.3.1", + "@wordpress/autop": "^2.2.0", + "@wordpress/blob": "^2.3.0", + "@wordpress/block-serialization-default-parser": "^3.1.0", + "@wordpress/block-serialization-spec-parser": "^3.0.0", + "@wordpress/data": "^4.4.0", + "@wordpress/dom": "^2.2.2", + "@wordpress/element": "^2.3.0", + "@wordpress/hooks": "^2.2.0", + "@wordpress/html-entities": "^2.2.0", + "@wordpress/i18n": "^3.3.0", + "@wordpress/is-shallow-equal": "^1.2.0", + "@wordpress/shortcode": "^2.2.0", + "hpq": "^1.3.0", + "lodash": "^4.17.11", + "rememo": "^3.0.0", + "showdown": "^1.8.6", + "simple-html-tokenizer": "^0.4.1", + "tinycolor2": "^1.4.1", + "uuid": "^3.3.2" + } + }, + "@wordpress/components": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-7.2.2.tgz", + "integrity": "sha512-EChv0PPWia8+OXq9m4zRaKRgc1mvC1wl24jRxqJ2sfn3OFlnCn5oBo77VZcDfdQiRK2Sn+nfMbA+4pbgCS38Mg==", + "requires": { + "@babel/runtime": "^7.3.1", + "@wordpress/a11y": "^2.2.0", + "@wordpress/api-fetch": "^3.1.2", + "@wordpress/compose": "^3.2.0", + "@wordpress/dom": "^2.2.2", + "@wordpress/element": "^2.3.0", + "@wordpress/hooks": "^2.2.0", + "@wordpress/i18n": "^3.3.0", + "@wordpress/is-shallow-equal": "^1.2.0", + "@wordpress/keycodes": "^2.2.0", + "@wordpress/rich-text": "^3.2.2", + "@wordpress/url": "^2.5.0", + "classnames": "^2.2.5", + "clipboard": "^2.0.1", + "diff": "^3.5.0", + "dom-scroll-into-view": "^1.2.1", + "lodash": "^4.17.11", + "memize": "^1.0.5", + "moment": "^2.22.1", + "mousetrap": "^1.6.2", + "re-resizable": "^4.7.1", + "react-click-outside": "^3.0.0", + "react-dates": "^17.1.1", + "rememo": "^3.0.0", + "tinycolor2": "^1.4.1", + "uuid": "^3.3.2" + } + }, + "@wordpress/compose": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.2.0.tgz", + "integrity": "sha512-bwDSMABvTi3AXqsNNi29h3T4nCtiwuBm4XO4svp6nRTFnVgxrfZXjqHrnuv0qimg1UP35WSXKO6hrO/QqTkW8g==", + "requires": { + "@babel/runtime": "^7.3.1", + "@wordpress/element": "^2.3.0", + "@wordpress/is-shallow-equal": "^1.2.0", + "lodash": "^4.17.11" + } + }, + "@wordpress/element": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.3.0.tgz", + "integrity": "sha512-L/s1n6pqVUlo09uMdhnlarW7ZzTWlvKo6zQzoxZSLEMne/6Hr3sw2DbxE2AuijcJv/n9VzmV7/MNBQMEIPL7OA==", + "requires": { + "@babel/runtime": "^7.3.1", + "@wordpress/escape-html": "^1.2.0", + "lodash": "^4.17.11", + "react": "^16.8.4", + "react-dom": "^16.8.4" + } + }, + "@wordpress/i18n": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.3.0.tgz", + "integrity": "sha512-fQLltl+WKOesjNNmxVg0BBfRoDRpFgs2oxG/e9u+jjRq55vN591P05sOLlxqVolZ5r5aSZmuL593yAhUqJW09Q==", + "requires": { + "@babel/runtime": "^7.3.1", + "gettext-parser": "^1.3.1", + "lodash": "^4.17.11", + "memize": "^1.0.5", + "sprintf-js": "^1.1.1", + "tannin": "^1.0.1" + } + }, + "@wordpress/url": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.5.0.tgz", + "integrity": "sha512-DADAoSMHHheeanC12KF3MhAJCqp0Y3ZQBqWVIEwW2VH9EmRUY4mIdfOHoCXhu+1SU7LmMjvWvzb0j778C0mwlw==", + "requires": { + "@babel/runtime": "^7.3.1", + "qs": "^6.5.2" + } + }, + "sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" + } } }, "@wordpress/block-serialization-default-parser": { @@ -3155,11 +3287,11 @@ } }, "@wordpress/date": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-3.0.1.tgz", - "integrity": "sha512-LOOwZM0A5OeElWgdyuR3LJQ7sJJZ5oHdXnNTs3LEB5GH7FUoozF6B6KY5Qm13pizzWX018C8vggsHrsltuLo3A==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-3.2.0.tgz", + "integrity": "sha512-dV9b2ObyX6I5Harl7tt3eN+yWSQu0DwLyj/hflVYUR6qlFVfg0fjDGuMa+ZxI0T1UhblP+EyGDXX8wS680JOsQ==", "requires": { - "@babel/runtime": "^7.0.0", + "@babel/runtime": "^7.3.1", "moment": "^2.22.1", "moment-timezone": "^0.5.16" } @@ -3171,16 +3303,6 @@ "requires": { "@babel/runtime": "^7.3.1", "@wordpress/hooks": "^2.2.0" - }, - "dependencies": { - "@wordpress/hooks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.2.0.tgz", - "integrity": "sha512-pzLDgcQOPCU4xSN0yuGoPd9xeNW2MnB2o7O52qaFZ2DSmf9tN+OkPDg7lKsg7SEds0J7GngBS8tu+a4Lqywy/w==", - "requires": { - "@babel/runtime": "^7.3.1" - } - } } }, "@wordpress/dom": { @@ -3364,16 +3486,6 @@ "lodash": "^4.17.11" } }, - "@wordpress/date": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-3.2.0.tgz", - "integrity": "sha512-dV9b2ObyX6I5Harl7tt3eN+yWSQu0DwLyj/hflVYUR6qlFVfg0fjDGuMa+ZxI0T1UhblP+EyGDXX8wS680JOsQ==", - "requires": { - "@babel/runtime": "^7.3.1", - "moment": "^2.22.1", - "moment-timezone": "^0.5.16" - } - }, "@wordpress/element": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.3.0.tgz", @@ -3386,14 +3498,6 @@ "react-dom": "^16.8.4" } }, - "@wordpress/hooks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.2.0.tgz", - "integrity": "sha512-pzLDgcQOPCU4xSN0yuGoPd9xeNW2MnB2o7O52qaFZ2DSmf9tN+OkPDg7lKsg7SEds0J7GngBS8tu+a4Lqywy/w==", - "requires": { - "@babel/runtime": "^7.3.1" - } - }, "@wordpress/i18n": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.3.0.tgz", @@ -3520,14 +3624,6 @@ "react-dom": "^16.8.4" } }, - "@wordpress/hooks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.2.0.tgz", - "integrity": "sha512-pzLDgcQOPCU4xSN0yuGoPd9xeNW2MnB2o7O52qaFZ2DSmf9tN+OkPDg7lKsg7SEds0J7GngBS8tu+a4Lqywy/w==", - "requires": { - "@babel/runtime": "^7.3.1" - } - }, "@wordpress/i18n": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.3.0.tgz", @@ -3553,11 +3649,11 @@ } }, "@wordpress/hooks": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.0.5.tgz", - "integrity": "sha512-EcE7lm5p6f3qB6nJClY3LPejFpbjo66b6j4ihgLLgrWMKqs4lLPGS2OzK4KyP0O52cofKj+Tv/wBaAiYSufFcA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.2.0.tgz", + "integrity": "sha512-pzLDgcQOPCU4xSN0yuGoPd9xeNW2MnB2o7O52qaFZ2DSmf9tN+OkPDg7lKsg7SEds0J7GngBS8tu+a4Lqywy/w==", "requires": { - "@babel/runtime": "^7.0.0" + "@babel/runtime": "^7.3.1" } }, "@wordpress/html-entities": { @@ -3706,14 +3802,6 @@ "react-dom": "^16.8.4" } }, - "@wordpress/hooks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.2.0.tgz", - "integrity": "sha512-pzLDgcQOPCU4xSN0yuGoPd9xeNW2MnB2o7O52qaFZ2DSmf9tN+OkPDg7lKsg7SEds0J7GngBS8tu+a4Lqywy/w==", - "requires": { - "@babel/runtime": "^7.3.1" - } - }, "@wordpress/i18n": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.3.0.tgz", @@ -3772,14 +3860,6 @@ "react": "^16.8.4", "react-dom": "^16.8.4" } - }, - "@wordpress/hooks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.2.0.tgz", - "integrity": "sha512-pzLDgcQOPCU4xSN0yuGoPd9xeNW2MnB2o7O52qaFZ2DSmf9tN+OkPDg7lKsg7SEds0J7GngBS8tu+a4Lqywy/w==", - "requires": { - "@babel/runtime": "^7.3.1" - } } } }, @@ -8648,6 +8728,11 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, + "fast-average-color": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/fast-average-color/-/fast-average-color-4.3.0.tgz", + "integrity": "sha512-k8FXd6+JeXoItmdNqB3hMwFgArryjdYBLuzEM8fRY/oztd/051yhSHU6GUrMOfIQU9dDHyFDcIAkGrQKlYtpDA==" + }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",