Skip to content

Commit

Permalink
Framework: Move store files into state directory
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Oct 16, 2017
1 parent 588ccd3 commit 1746b42
Show file tree
Hide file tree
Showing 66 changed files with 95 additions and 95 deletions.
4 changes: 2 additions & 2 deletions editor/autosave-monitor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { Component } from '@wordpress/element';
/**
* Internal dependencies
*/
import { autosave } from '../actions';
import { autosave } from '../state/actions';
import {
isEditedPostDirty,
isEditedPostSaveable,
} from '../selectors';
} from '../state/selectors';

export class AutosaveMonitor extends Component {
componentDidUpdate( prevProps ) {
Expand Down
4 changes: 2 additions & 2 deletions editor/block-mover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { getBlockType } from '@wordpress/blocks';
* Internal dependencies
*/
import './style.scss';
import { isFirstBlock, isLastBlock, getBlockIndex, getBlock } from '../selectors';
import { isFirstBlock, isLastBlock, getBlockIndex, getBlock } from '../state/selectors';
import { getBlockMoverLabel } from './mover-label';
import { selectBlock } from '../actions';
import { selectBlock } from '../state/actions';

function BlockMover( { onMoveUp, onMoveDown, isFirst, isLast, uids, blockType, firstIndex } ) {
// We emulate a disabled state because forcefully applying the `disabled`
Expand Down
4 changes: 2 additions & 2 deletions editor/block-settings-menu/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { IconButton } from '@wordpress/components';
/**
* Internal dependencies
*/
import { isEditorSidebarOpened, getBlockMode } from '../selectors';
import { removeBlocks, toggleSidebar, setActivePanel, toggleBlockMode } from '../actions';
import { isEditorSidebarOpened, getBlockMode } from '../state/selectors';
import { removeBlocks, toggleSidebar, setActivePanel, toggleBlockMode } from '../state/actions';

function BlockSettingsMenuContent( { mode, uids, isSidebarOpened, onDelete, onToggleSidebar, onShowInspector, onToggleMode, onClose } ) {
const count = uids.length;
Expand Down
2 changes: 1 addition & 1 deletion editor/block-settings-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { IconButton, Dropdown } from '@wordpress/components';
*/
import './style.scss';
import BlockSettingsMenuContent from './content';
import { selectBlock } from '../actions';
import { selectBlock } from '../state/actions';

function BlockSettingsMenu( { uids, onSelect } ) {
return (
Expand Down
4 changes: 2 additions & 2 deletions editor/block-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { keycodes } from '@wordpress/utils';
* Internal dependencies
*/
import './style.scss';
import { replaceBlocks } from '../actions';
import { getBlock } from '../selectors';
import { replaceBlocks } from '../state/actions';
import { getBlock } from '../state/selectors';

/**
* Module Constants
Expand Down
4 changes: 2 additions & 2 deletions editor/document-outline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { __ } from '@wordpress/i18n';
*/
import './style.scss';
import DocumentOutlineItem from './item';
import { getBlocks } from '../selectors';
import { selectBlock } from '../actions';
import { getBlocks } from '../state/selectors';
import { selectBlock } from '../state/actions';

/**
* Module constants
Expand Down
2 changes: 1 addition & 1 deletion editor/document-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Component } from 'react';
/**
* Internal dependencies
*/
import { getDocumentTitle } from '../selectors';
import { getDocumentTitle } from '../state/selectors';

class DocumentTitle extends Component {

Expand Down
4 changes: 2 additions & 2 deletions editor/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import PublishWithDropdown from './publish-with-dropdown';
import PreviewButton from './preview-button';
import ModeSwitcher from './mode-switcher';
import Inserter from '../inserter';
import { hasEditorUndo, hasEditorRedo, isEditorSidebarOpened } from '../selectors';
import { toggleSidebar } from '../actions';
import { hasEditorUndo, hasEditorRedo, isEditorSidebarOpened } from '../state/selectors';
import { toggleSidebar } from '../state/actions';

function Header( {
undo,
Expand Down
2 changes: 1 addition & 1 deletion editor/header/mode-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IconButton, Dropdown } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
import { getEditorMode } from '../../selectors';
import { getEditorMode } from '../../state/selectors';

/**
* Set of available mode options.
Expand Down
4 changes: 2 additions & 2 deletions editor/header/preview-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
isEditedPostDirty,
isEditedPostNew,
isEditedPostSaveable,
} from '../../selectors';
import { autosave } from '../../actions';
} from '../../state/selectors';
import { autosave } from '../../state/actions';

export class PreviewButton extends Component {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions editor/header/publish-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import { Button, withAPIData } from '@wordpress/components';
*/
import './style.scss';
import PublishButtonLabel from './label';
import { editPost, savePost } from '../../actions';
import { editPost, savePost } from '../../state/actions';
import {
isSavingPost,
isEditedPostBeingScheduled,
getEditedPostVisibility,
isEditedPostSaveable,
isEditedPostPublishable,
} from '../../selectors';
} from '../../state/selectors';

export function PublishButton( {
isSaving,
Expand Down
2 changes: 1 addition & 1 deletion editor/header/publish-button/label.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import './style.scss';
import {
isCurrentPostPublished,
isEditedPostBeingScheduled,
} from '../../selectors';
} from '../../state/selectors';

export function PublishButtonLabel( {
isPublished,
Expand Down
2 changes: 1 addition & 1 deletion editor/header/publish-with-dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
isSavingPost,
isEditedPostSaveable,
isEditedPostPublishable,
} from '../../selectors';
} from '../../state/selectors';

function PublishWithDropdown( { isSaving, isPublishable, isSaveable } ) {
const isButtonEnabled = ! isSaving && isPublishable && isSaveable;
Expand Down
4 changes: 2 additions & 2 deletions editor/header/saved-state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Dashicon, Button } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
import { editPost, savePost } from '../../actions';
import { editPost, savePost } from '../../state/actions';
import {
isEditedPostNew,
isCurrentPostPublished,
Expand All @@ -23,7 +23,7 @@ import {
isEditedPostSaveable,
getCurrentPost,
getEditedPostAttribute,
} from '../../selectors';
} from '../../state/selectors';

export function SavedState( { isNew, isPublished, isDirty, isSaving, isSaveable, status, onStatusChange, onSave } ) {
const className = 'editor-saved-state';
Expand Down
4 changes: 2 additions & 2 deletions editor/inserter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import { Component } from '@wordpress/element';
* Internal dependencies
*/
import InserterMenu from './menu';
import { getBlockInsertionPoint, getEditorMode } from '../selectors';
import { getBlockInsertionPoint, getEditorMode } from '../state/selectors';
import {
insertBlock,
setBlockInsertionPoint,
clearBlockInsertionPoint,
hideInsertionPoint,
} from '../actions';
} from '../state/actions';

class Inserter extends Component {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions editor/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { getCategories, getBlockTypes, BlockIcon } from '@wordpress/blocks';
* Internal dependencies
*/
import './style.scss';
import { getBlocks, getRecentlyUsedBlocks } from '../selectors';
import { showInsertionPoint, hideInsertionPoint } from '../actions';
import { getBlocks, getRecentlyUsedBlocks } from '../state/selectors';
import { showInsertionPoint, hideInsertionPoint } from '../state/actions';

const { TAB, LEFT, UP, RIGHT, DOWN } = keycodes;

Expand Down
4 changes: 2 additions & 2 deletions editor/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import MetaBoxes from '../meta-boxes';
import UnsavedChangesWarning from '../unsaved-changes-warning';
import DocumentTitle from '../document-title';
import AutosaveMonitor from '../autosave-monitor';
import { removeNotice } from '../actions';
import { removeNotice } from '../state/actions';
import {
getEditorMode,
isEditorSidebarOpened,
getNotices,
} from '../selectors';
} from '../state/selectors';

function Layout( { mode, isSidebarOpened, notices, ...props } ) {
const className = classnames( 'editor-layout', {
Expand Down
4 changes: 2 additions & 2 deletions editor/modes/text-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { parse } from '@wordpress/blocks';
*/
import './style.scss';
import PostTitle from '../../post-title';
import { getEditedPostContent } from '../../selectors';
import { editPost, resetBlocks } from '../../actions';
import { getEditedPostContent } from '../../state/selectors';
import { editPost, resetBlocks } from '../../state/actions';

class TextEditor extends Component {
constructor( props ) {
Expand Down
2 changes: 1 addition & 1 deletion editor/modes/visual-editor/block-drop-zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getBlockTypes } from '@wordpress/blocks';
/**
* Internal dependencies
*/
import { insertBlocks } from '../../actions';
import { insertBlocks } from '../../state/actions';

function BlockDropZone( { index, ...props } ) {
const dropFiles = ( files, position ) => {
Expand Down
4 changes: 2 additions & 2 deletions editor/modes/visual-editor/block-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import TextareaAutosize from 'react-autosize-textarea';
/**
* Internal Dependencies
*/
import { updateBlock } from '../../actions';
import { getBlock } from '../../selectors';
import { updateBlock } from '../../state/actions';
import { getBlock } from '../../state/selectors';

class BlockHTML extends Component {
constructor( props ) {
Expand Down
4 changes: 2 additions & 2 deletions editor/modes/visual-editor/block-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import {
getMultiSelectedBlocks,
getMultiSelectedBlockUids,
getSelectedBlock,
} from '../../selectors';
import { insertBlock, startMultiSelect, stopMultiSelect, multiSelect, selectBlock } from '../../actions';
} from '../../state/selectors';
import { insertBlock, startMultiSelect, stopMultiSelect, multiSelect, selectBlock } from '../../state/actions';

class VisualEditorBlockList extends Component {
constructor( props ) {
Expand Down
4 changes: 2 additions & 2 deletions editor/modes/visual-editor/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
startTyping,
stopTyping,
updateBlockAttributes,
} from '../../actions';
} from '../../state/actions';
import {
getBlock,
getBlockFocus,
Expand All @@ -52,7 +52,7 @@ import {
isFirstMultiSelectedBlock,
isTyping,
getBlockMode,
} from '../../selectors';
} from '../../state/selectors';

const { BACKSPACE, ESCAPE, DELETE, ENTER } = keycodes;

Expand Down
4 changes: 2 additions & 2 deletions editor/modes/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import VisualEditorInserter from './inserter';
import PostTitle from '../../post-title';
import WritingFlow from '../../writing-flow';
import TableOfContents from '../../table-of-contents';
import { getBlockUids, getMultiSelectedBlockUids } from '../../selectors';
import { clearSelectedBlock, multiSelect, redo, undo, removeBlocks } from '../../actions';
import { getBlockUids, getMultiSelectedBlockUids } from '../../state/selectors';
import { clearSelectedBlock, multiSelect, redo, undo, removeBlocks } from '../../state/actions';

class VisualEditor extends Component {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions editor/modes/visual-editor/inserter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { createBlock } from '@wordpress/blocks';
* Internal dependencies
*/
import Inserter from '../../inserter';
import { insertBlock } from '../../actions';
import { getMostFrequentlyUsedBlocks, getBlockCount } from '../../selectors';
import { insertBlock } from '../../state/actions';
import { getMostFrequentlyUsedBlocks, getBlockCount } from '../../state/selectors';

export class VisualEditorInserter extends Component {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion editor/modes/visual-editor/invalid-block-warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
/**
* Internal dependencies
*/
import { replaceBlock } from '../../actions';
import { replaceBlock } from '../../state/actions';

function InvalidBlockWarning( { ignoreInvalid, switchToBlockType } ) {
const htmlBlockName = 'core/html';
Expand Down
2 changes: 1 addition & 1 deletion editor/modes/visual-editor/sibling-inserter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Inserter from '../../inserter';
import {
getBlockInsertionPoint,
isBlockInsertionPointVisible,
} from '../../selectors';
} from '../../state/selectors';

class VisualEditorSiblingInserter extends Component {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion editor/post-permalink/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Dashicon, ClipboardButton, Button } from '@wordpress/components';
* Internal Dependencies
*/
import './style.scss';
import { isEditedPostNew, getEditedPostAttribute } from '../selectors';
import { isEditedPostNew, getEditedPostAttribute } from '../state/selectors';

class PostPermalink extends Component {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions editor/post-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { keycodes } from '@wordpress/utils';
* Internal dependencies
*/
import './style.scss';
import { getEditedPostTitle } from '../selectors';
import { editPost, clearSelectedBlock } from '../actions';
import { getEditedPostTitle } from '../state/selectors';
import { editPost, clearSelectedBlock } from '../state/actions';
import PostPermalink from '../post-permalink';

/**
Expand Down
4 changes: 2 additions & 2 deletions editor/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
/**
* Internal Dependencies
*/
import { setupEditor, undo } from '../actions';
import createReduxStore from '../store';
import { setupEditor, undo } from '../state/actions';
import createReduxStore from '../state';

/**
* The default editor settings
Expand Down
4 changes: 2 additions & 2 deletions editor/sidebar/block-inspector/advanced-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { ClipboardButton, Tooltip, PanelBody } from '@wordpress/components';
/**
* Internal Dependencies
*/
import { updateBlockAttributes } from '../../actions';
import { getSelectedBlock, getCurrentPost } from '../../selectors';
import { updateBlockAttributes } from '../../state/actions';
import { getSelectedBlock, getCurrentPost } from '../../state/selectors';
import { filterURLForDisplay } from '../../utils/url';

/**
Expand Down
2 changes: 1 addition & 1 deletion editor/sidebar/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Panel, PanelBody, Slot } from '@wordpress/components';
*/
import './style.scss';
import BlockInspectorAdvancedControls from './advanced-controls';
import { getSelectedBlock, getSelectedBlockCount } from '../../selectors';
import { getSelectedBlock, getSelectedBlockCount } from '../../state/selectors';

const BlockInspector = ( { selectedBlock, count } ) => {
if ( count > 1 ) {
Expand Down
4 changes: 2 additions & 2 deletions editor/sidebar/discussion-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { PanelBody, PanelRow, FormToggle, withInstanceId } from '@wordpress/comp
/**
* Internal Dependencies
*/
import { getEditedPostAttribute, isEditorSidebarPanelOpened } from '../../selectors';
import { editPost, toggleSidebarPanel } from '../../actions';
import { getEditedPostAttribute, isEditorSidebarPanelOpened } from '../../state/selectors';
import { editPost, toggleSidebarPanel } from '../../state/actions';

/**
* Module Constants
Expand Down
4 changes: 2 additions & 2 deletions editor/sidebar/document-outline-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { PanelBody } from '@wordpress/components';
* Internal dependencies
*/
import DocumentOutline from '../../document-outline';
import { getBlocks, isEditorSidebarPanelOpened } from '../../selectors';
import { toggleSidebarPanel } from '../../actions';
import { getBlocks, isEditorSidebarPanelOpened } from '../../state/selectors';
import { toggleSidebarPanel } from '../../state/actions';

/**
* Module constants
Expand Down
4 changes: 2 additions & 2 deletions editor/sidebar/featured-image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { MediaUploadButton } from '@wordpress/blocks';
* Internal dependencies
*/
import './style.scss';
import { getEditedPostAttribute, isEditorSidebarPanelOpened } from '../../selectors';
import { editPost, toggleSidebarPanel } from '../../actions';
import { getEditedPostAttribute, isEditorSidebarPanelOpened } from '../../state/selectors';
import { editPost, toggleSidebarPanel } from '../../state/actions';

/**
* Module Constants
Expand Down
4 changes: 2 additions & 2 deletions editor/sidebar/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { IconButton } from '@wordpress/components';
/**
* Internal Dependencies
*/
import { getActivePanel, getSelectedBlockCount } from '../selectors';
import { toggleSidebar, setActivePanel } from '../actions';
import { getActivePanel, getSelectedBlockCount } from '../state/selectors';
import { toggleSidebar, setActivePanel } from '../state/actions';

const SidebarHeader = ( { panel, onSetPanel, onToggleSidebar, count } ) => {
// Do not display "0 Blocks".
Expand Down
Loading

0 comments on commit 1746b42

Please sign in to comment.