Skip to content

Commit

Permalink
Framework: rename editor/api to editor/block-api and `editor/libr…
Browse files Browse the repository at this point in the history
…ary` to `editor/blocks`
  • Loading branch information
youknowriad committed Oct 4, 2017
1 parent 66b1264 commit c2683df
Show file tree
Hide file tree
Showing 152 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion bin/build-plugin-zip.sh
Expand Up @@ -94,7 +94,7 @@ status "Creating archive..."
zip -r gutenberg.zip \
gutenberg.php \
lib/*.php \
editor/library/*/*.php \
editor/blocks/*/*.php \
post-content.js \
$vendor_scripts \
components/build/*.{js,map} \
Expand Down
2 changes: 1 addition & 1 deletion bin/create-php-parser.js
Expand Up @@ -5,7 +5,7 @@ const phpegjs = require( 'phpegjs' );
const fs = require( 'fs' );
const path = require( 'path' );

const peg = fs.readFileSync( 'editor/api/post.pegjs', 'utf8' );
const peg = fs.readFileSync( 'editor/block-api/post.pegjs', 'utf8' );

const parser = pegjs.generate(
peg,
Expand Down
2 changes: 1 addition & 1 deletion bin/get-server-block-attributes.php
Expand Up @@ -31,7 +31,7 @@ function register_block_type( $name, $args = array() ) {
}

// Register server-side code for individual blocks.
foreach ( glob( dirname( dirname( __FILE__ ) ) . '/editor/library/*/index.php' ) as $block_logic ) {
foreach ( glob( dirname( dirname( __FILE__ ) ) . '/editor/blocks/*/index.php' ) as $block_logic ) {
require_once $block_logic;
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -8,7 +8,7 @@ import path from 'path';
/**
* Internal dependencies
*/
import '../../../../library';
import '../../../../blocks';
import paste from '../../index';
import serialize from '../../../serializer';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion editor/block-autocomplete/index.js
Expand Up @@ -8,7 +8,7 @@ import { Autocomplete } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
import { createBlock, getBlockTypes } from '../api';
import { createBlock, getBlockTypes } from '../block-api';
import BlockIcon from '../block-icon';

class BlockAutocomplete extends Component {
Expand Down
2 changes: 1 addition & 1 deletion editor/block-autocomplete/test/index.js
Expand Up @@ -10,7 +10,7 @@ import BlockIcon from '../../block-icon';
import {
registerBlockType,
unregisterBlockType,
} from '../../api';
} from '../../block-api';
import BlockAutocomplete from '../';

describe( 'BlockAutocomplete', () => {
Expand Down
2 changes: 1 addition & 1 deletion editor/block-mover/index.js
Expand Up @@ -14,7 +14,7 @@ import { IconButton } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
import { getBlockType } from '../api';
import { getBlockType } from '../block-api';
import { isFirstBlock, isLastBlock, getBlockIndex, getBlock } from '../selectors';
import { getBlockMoverLabel } from './mover-label';

Expand Down
2 changes: 1 addition & 1 deletion editor/block-switcher/index.js
Expand Up @@ -16,7 +16,7 @@ import { Dashicon, IconButton } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
import { getBlockType, getBlockTypes, switchToBlockType } from '../api';
import { getBlockType, getBlockTypes, switchToBlockType } from '../block-api';
import { replaceBlocks } from '../actions';
import { getBlock } from '../selectors';

Expand Down
Expand Up @@ -13,7 +13,7 @@ import { Component } from '@wordpress/element';
* Internal dependencies
*/
import './style.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import MediaUploadButton from '../../media-upload-button';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -9,7 +9,7 @@ import { IconButton } from '@wordpress/components';
*/
import './editor.scss';
import './style.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import Editable from '../../editable';
import UrlInput from '../../url-input';
import BlockControls from '../../block-controls';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -11,7 +11,7 @@ import { times, unescape } from 'lodash';
*/
import './editor.scss';
import './style.scss';
import { registerBlockType } from '../../api';
import { registerBlockType } from '../../block-api';
import { getCategories } from './data.js';
import InspectorControls from '../../inspector-controls';
import ToggleControl from '../../inspector-controls/toggle-control';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -12,7 +12,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
import { registerBlockType, source, createBlock } from '../../api';
import { registerBlockType, source, createBlock } from '../../block-api';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';

Expand Down
File renamed without changes.
Expand Up @@ -10,7 +10,7 @@ import classnames from 'classnames';
*/
import './editor.scss';
import './style.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import Editable from '../../editable';
import MediaUploadButton from '../../media-upload-button';
import BlockControls from '../../block-controls';
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -17,7 +17,7 @@ import { addQueryArgs } from '@wordpress/url';
*/
import './style.scss';
import './editor.scss';
import { registerBlockType, source, createBlock } from '../../api';
import { registerBlockType, source, createBlock } from '../../block-api';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
import { registerBlockType, source, setUnknownTypeHandlerName } from '../../api';
import { registerBlockType, source, setUnknownTypeHandlerName } from '../../block-api';
import OldEditor from './old-editor';

const { prop } = source;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
*/
import './editor.scss';
import './style.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import GalleryImage from './gallery-image';
import { default as GalleryBlock, defaultColumnsNumber } from './block';

Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -9,7 +9,7 @@ import { Toolbar } from '@wordpress/components';
* Internal dependencies
*/
import './editor.scss';
import { registerBlockType, createBlock, source } from '../../api';
import { registerBlockType, createBlock, source } from '../../block-api';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
import InspectorControls from '../../inspector-controls';
Expand Down
File renamed without changes.
Expand Up @@ -13,7 +13,7 @@ import { Component } from '@wordpress/element';
* Internal dependencies
*/
import './editor.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import BlockControls from '../../block-controls';

const { html } = source;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -9,7 +9,7 @@ import { createMediaFromFile } from '@wordpress/utils';
*/
import './style.scss';
import './editor.scss';
import { registerBlockType, source, createBlock } from '../../api';
import { registerBlockType, source, createBlock } from '../../block-api';
import ImageBlock from './block';

const { attr, children } = source;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -13,7 +13,7 @@ import classnames from 'classnames';
*/
import './editor.scss';
import './style.scss';
import { registerBlockType } from '../../api';
import { registerBlockType } from '../../block-api';
import { getLatestPosts } from './data.js';
import InspectorControls from '../../inspector-controls';
import TextControl from '../../inspector-controls/text-control';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
import { registerBlockType, source, createBlock } from '../../api';
import { registerBlockType, source, createBlock } from '../../block-api';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
import InspectorControls from '../../inspector-controls';
Expand Down
File renamed without changes.
Expand Up @@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
import { registerBlockType } from '../../api';
import { registerBlockType } from '../../block-api';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';
import ToggleControl from '../../inspector-controls/toggle-control';
Expand Down
Expand Up @@ -14,7 +14,7 @@ import { PanelBody } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
import { registerBlockType, createBlock, source, setDefaultBlockName } from '../../api';
import { registerBlockType, createBlock, source, setDefaultBlockName } from '../../block-api';
import AlignmentToolbar from '../../alignment-toolbar';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
import BlockControls from '../../block-controls';
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
import { registerBlockType, createBlock, source } from '../../api';
import { registerBlockType, createBlock, source } from '../../block-api';
import Editable from '../../editable';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';
Expand Down
File renamed without changes.
Expand Up @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
*/
import './editor.scss';
import './style.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -13,7 +13,7 @@ import { Toolbar } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
import { registerBlockType, createBlock, source } from '../../api';
import { registerBlockType, createBlock, source } from '../../block-api';
import AlignmentToolbar from '../../alignment-toolbar';
import BlockControls from '../../block-controls';
import Editable from '../../editable';
Expand Down
File renamed without changes.
Expand Up @@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './style.scss';
import { registerBlockType, createBlock } from '../../api';
import { registerBlockType, createBlock } from '../../block-api';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';

Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -8,7 +8,7 @@ import { withInstanceId, Dashicon } from '@wordpress/components';
* Internal dependencies
*/
import './editor.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';

Expand Down
File renamed without changes.
Expand Up @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
*/
import './editor.scss';
import './style.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import TableBlock from './table-block';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n';
*/
import './style.scss';
import './editor.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
import RangeControl from '../../inspector-controls/range-control';
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
import { registerBlockType, createBlock, source } from '../../api';
import { registerBlockType, createBlock, source } from '../../block-api';
import Editable from '../../editable';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';
Expand Down
Expand Up @@ -12,7 +12,7 @@ import { Placeholder, Toolbar, Dashicon } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
import { registerBlockType, source } from '../../api';
import { registerBlockType, source } from '../../block-api';
import MediaUploadButton from '../../media-upload-button';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion editor/editable/index.js
Expand Up @@ -28,7 +28,7 @@ import { keycodes } from '@wordpress/utils';
* Internal dependencies
*/
import './style.scss';
import { pasteHandler } from '../api';
import { pasteHandler } from '../block-api';
import FormatToolbar from './format-toolbar';
import TinyMCE from './tinymce';
import patterns from './patterns';
Expand Down
2 changes: 1 addition & 1 deletion editor/editable/patterns.js
Expand Up @@ -12,7 +12,7 @@ import { keycodes } from '@wordpress/utils';
/**
* Internal dependencies
*/
import { getBlockTypes } from '../api/registration';
import { getBlockTypes } from '../block-api/registration';

/**
* Browser dependencies
Expand Down
2 changes: 1 addition & 1 deletion editor/effects.js
Expand Up @@ -12,7 +12,7 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import { parse, getBlockType, switchToBlockType } from './api';
import { parse, getBlockType, switchToBlockType } from './block-api';
import { getGutenbergURL, getWPAdminURL } from './utils/url';
import {
resetPost,
Expand Down
4 changes: 2 additions & 2 deletions editor/index.js
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
import './library';
import './blocks';

// A "block" is the abstract term used to describe units of markup that,
// when composed together, form the content or layout of a page.
Expand All @@ -12,7 +12,7 @@ import './library';
//
// Blocks are inferred from the HTML source of a post through a parsing mechanism
// and then stored as objects in state, from which it is then rendered for editing.
export * from './api';
export * from './block-api';

// Reusable Editor Components
export { default as AlignmentToolbar } from './alignment-toolbar';
Expand Down
2 changes: 1 addition & 1 deletion editor/inserter/index.js
Expand Up @@ -14,7 +14,7 @@ import { Popover, IconButton } from '@wordpress/components';
* Internal dependencies
*/
import InserterMenu from './menu';
import { createBlock } from '../api';
import { createBlock } from '../block-api';
import { getBlockInsertionPoint, getEditorMode } from '../selectors';
import { insertBlock, hideInsertionPoint } from '../actions';

Expand Down
2 changes: 1 addition & 1 deletion editor/inserter/menu.js
Expand Up @@ -16,7 +16,7 @@ import { keycodes } from '@wordpress/utils';
* Internal dependencies
*/
import './style.scss';
import { getCategories, getBlockTypes } from '../api';
import { getCategories, getBlockTypes } from '../block-api';
import BlockIcon from '../block-icon';
import { getBlocks, getRecentlyUsedBlocks } from '../selectors';
import { showInsertionPoint, hideInsertionPoint } from '../actions';
Expand Down
2 changes: 1 addition & 1 deletion editor/inserter/test/menu.js
Expand Up @@ -7,7 +7,7 @@ import { noop } from 'lodash';
/**
* Internal dependencies
*/
import { registerBlockType, unregisterBlockType, getBlockTypes } from '../../api';
import { registerBlockType, unregisterBlockType, getBlockTypes } from '../../block-api';
import { InserterMenu, searchBlocks } from '../menu';

const textBlock = {
Expand Down
2 changes: 1 addition & 1 deletion editor/modes/text-editor/index.js
Expand Up @@ -14,7 +14,7 @@ import { Component } from '@wordpress/element';
* Internal dependencies
*/
import './style.scss';
import { parse } from '../../api';
import { parse } from '../../block-api';
import PostTitle from '../../post-title';
import { getEditedPostContent } from '../../selectors';
import { editPost, resetBlocks } from '../../actions';
Expand Down
2 changes: 1 addition & 1 deletion editor/modes/visual-editor/block-drop-zone.js
Expand Up @@ -12,7 +12,7 @@ import { DropZone } from '@wordpress/components';
/**
* Internal dependencies
*/
import { getBlockTypes } from '../../api';
import { getBlockTypes } from '../../block-api';
import { insertBlocks } from '../../actions';

function BlockDropZone( { index, ...props } ) {
Expand Down
2 changes: 1 addition & 1 deletion editor/modes/visual-editor/block-list.js
Expand Up @@ -13,7 +13,7 @@ import { Component } from '@wordpress/element';
/**
* Internal dependencies
*/
import { serialize, getDefaultBlockName, createBlock } from '../../api';
import { serialize, getDefaultBlockName, createBlock } from '../../block-api';
import VisualEditorBlock from './block';
import BlockDropZone from './block-drop-zone';
import {
Expand Down
2 changes: 1 addition & 1 deletion editor/modes/visual-editor/block.js
Expand Up @@ -18,7 +18,7 @@ import { __, sprintf } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import { getBlockType, getBlockDefaultClassname, createBlock } from '../../api';
import { getBlockType, getBlockDefaultClassname, createBlock } from '../../block-api';
import InvalidBlockWarning from './invalid-block-warning';
import BlockCrashWarning from './block-crash-warning';
import BlockCrashBoundary from './block-crash-boundary';
Expand Down

0 comments on commit c2683df

Please sign in to comment.