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

Reorganize folders within editor #408

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import classNames from 'classnames';
* Internal dependencies
*/
import './style.scss';
import Dashicon from 'components/dashicon';
import Dashicon from 'dashicon';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't dashicon still be under components?


function Toolbar( { controls } ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere, if we're changing the filename the component name should also change (to BlockToolbar in this case).

if ( ! controls || ! controls.length ) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added components/index.js
Empty file.
2 changes: 1 addition & 1 deletion editor/header/mode-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { connect } from 'react-redux';
* Internal dependencies
*/
import './style.scss';
import Dashicon from 'components/dashicon';
import Dashicon from '../../../components/dashicon';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this should still just be components/dashicon - see #386.


/**
* Set of available mode options.
Expand Down
2 changes: 1 addition & 1 deletion editor/header/saved-state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Internal dependencies
*/
import './style.scss';
import Dashicon from '../../components/dashicon';
import Dashicon from '../../../components/dashicon';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, we shouldn't need these relative paths any more.


function SavedState() {
return (
Expand Down
8 changes: 4 additions & 4 deletions editor/header/tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Internal dependencies
*/
import './style.scss';
import Dashicon from '../../components/dashicon';
import IconButton from '../../components/icon-button';
import Inserter from '../../components/inserter';
import Button from '../../components/button';
import Dashicon from '../../../components/dashicon';
import IconButton from '../../../components/icon-button';
import Inserter from 'inserter';
import Button from '../../../components/button';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, we shouldn't need these relative paths any more. If I'm wrong about that, then it seems like we need to reconsider how the import paths work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was having issues with the entry points, but I also put this together very roughly to communicate the structure.


function Tools() {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Internal dependencies
*/
import InserterMenu from './menu';
import IconButton from 'components/icon-button';
import IconButton from '../../components/icon-button';

class Inserter extends wp.element.Component {
constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Internal dependencies
*/
import './style.scss';
import Dashicon from 'components/dashicon';
import Dashicon from '../../components/dashicon';

function InserterMenu() {
const blocks = wp.blocks.getBlocks();
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions editor/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { connect } from 'react-redux';
* Internal dependencies
*/
import Header from 'header';
import TextEditor from 'modes/text-editor';
import VisualEditor from 'modes/visual-editor';
import TextEditor from 'text-editor';
import VisualEditor from 'visual-editor';

function Layout( { mode } ) {
return (
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import classnames from 'classnames';
/**
* Internal dependencies
*/
import Toolbar from 'components/toolbar';
import Toolbar from '../../components/block-toolbar';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be BlockToolbar here and in other usage as well.


function VisualEditorBlock( props ) {
const { block } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { connect } from 'react-redux';
* Internal dependencies
*/
import './style.scss';
import Inserter from 'components/inserter';
import Inserter from 'inserter';
import VisualEditorBlock from './block';

function VisualEditor( { blocks } ) {
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions languages/gutenberg.pot
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ msgstr ""
msgid "Justify"
msgstr ""

#: editor/components/inserter/index.js:29
msgid "Insert block"
msgstr ""

#: editor/components/inserter/menu.js:40
msgid "Search…"
msgstr ""

#: editor/header/mode-switcher/index.js:20
msgid "Visual"
msgstr ""
Expand Down Expand Up @@ -78,4 +70,12 @@ msgstr ""

#: editor/header/tools/index.js:27
msgid "Publish"
msgstr ""

#: editor/inserter/index.js:29
msgid "Insert block"
msgstr ""

#: editor/inserter/menu.js:40
msgid "Search…"
msgstr ""
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const config = {
entry: {
i18n: './i18n/index.js',
blocks: './blocks/index.js',
components: './components/index.js',
editor: './editor/index.js',
element: './element/index.js'
},
Expand Down