From 21b307f76086c6f230d36ae83e2282661cbb3d07 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Thu, 16 Nov 2017 14:57:54 -0500 Subject: [PATCH] Framework: Move store files into state directory --- editor/components/autosave-monitor/index.js | 4 ++-- editor/components/block-inspector/index.js | 2 +- editor/components/block-mover/index.js | 4 ++-- editor/components/block-settings-menu/block-delete-button.js | 2 +- .../components/block-settings-menu/block-inspector-button.js | 4 ++-- editor/components/block-settings-menu/block-mode-toggle.js | 4 ++-- editor/components/block-settings-menu/index.js | 2 +- editor/components/block-settings-menu/unknown-converter.js | 4 ++-- editor/components/block-switcher/index.js | 4 ++-- editor/components/block-toolbar/index.js | 2 +- editor/components/document-outline/index.js | 4 ++-- editor/components/error-boundary/index.js | 2 +- editor/components/inserter/index.js | 4 ++-- editor/components/inserter/menu.js | 4 ++-- editor/components/meta-boxes/index.js | 2 +- editor/components/meta-boxes/meta-boxes-area/index.js | 4 ++-- editor/components/page-attributes/check.js | 2 +- editor/components/page-attributes/index.js | 4 ++-- editor/components/post-author/index.js | 4 ++-- editor/components/post-comments/index.js | 4 ++-- editor/components/post-excerpt/index.js | 4 ++-- editor/components/post-featured-image/index.js | 4 ++-- editor/components/post-format/check.js | 2 +- editor/components/post-format/index.js | 4 ++-- editor/components/post-last-revision/check.js | 2 +- editor/components/post-last-revision/index.js | 2 +- editor/components/post-pending-status/check.js | 2 +- editor/components/post-pending-status/index.js | 4 ++-- editor/components/post-permalink/index.js | 2 +- editor/components/post-pingbacks/index.js | 4 ++-- editor/components/post-preview-button/index.js | 4 ++-- editor/components/post-publish-button/index.js | 4 ++-- editor/components/post-publish-button/label.js | 2 +- editor/components/post-saved-state/index.js | 4 ++-- editor/components/post-schedule/index.js | 4 ++-- editor/components/post-schedule/label.js | 2 +- editor/components/post-sticky/check.js | 2 +- editor/components/post-sticky/index.js | 4 ++-- editor/components/post-taxonomies/flat-term-selector.js | 4 ++-- .../components/post-taxonomies/hierarchical-term-selector.js | 4 ++-- editor/components/post-taxonomies/index.js | 2 +- editor/components/post-text-editor/index.js | 4 ++-- editor/components/post-title/index.js | 4 ++-- editor/components/post-trash/index.js | 4 ++-- editor/components/post-visibility/index.js | 4 ++-- editor/components/post-visibility/label.js | 2 +- editor/components/provider/index.js | 4 ++-- editor/components/unsaved-changes-warning/index.js | 2 +- editor/components/word-count/index.js | 2 +- editor/components/writing-flow/index.js | 4 ++-- editor/document-title/index.js | 2 +- editor/header/fixed-toolbar-toggle/index.js | 4 ++-- editor/header/header-toolbar/index.js | 2 +- editor/header/index.js | 4 ++-- editor/header/mode-switcher/index.js | 2 +- editor/header/publish-with-dropdown/index.js | 2 +- editor/index.js | 2 +- editor/layout/index.js | 4 ++-- editor/modes/visual-editor/block-contextual-toolbar.js | 2 +- editor/modes/visual-editor/block-drop-zone.js | 2 +- editor/modes/visual-editor/block-html.js | 4 ++-- editor/modes/visual-editor/block-list.js | 4 ++-- editor/modes/visual-editor/block.js | 4 ++-- editor/modes/visual-editor/index.js | 4 ++-- editor/modes/visual-editor/inserter.js | 4 ++-- editor/modes/visual-editor/invalid-block-warning.js | 2 +- editor/modes/visual-editor/multi-controls.js | 2 +- editor/modes/visual-editor/sibling-inserter.js | 2 +- editor/sidebar/discussion-panel/index.js | 4 ++-- editor/sidebar/document-outline-panel/index.js | 4 ++-- editor/sidebar/featured-image/index.js | 4 ++-- editor/sidebar/header.js | 4 ++-- editor/sidebar/index.js | 2 +- editor/sidebar/page-attributes/index.js | 4 ++-- editor/sidebar/post-excerpt/index.js | 4 ++-- editor/sidebar/post-status/index.js | 4 ++-- editor/sidebar/post-taxonomies/index.js | 4 ++-- editor/sidebar/post-trash/index.js | 2 +- editor/{ => state}/actions.js | 0 editor/{ => state}/effects.js | 2 +- editor/{store.js => state/index.js} | 0 editor/{ => state}/reducer.js | 4 ++-- editor/{ => state}/selectors.js | 0 editor/{ => state}/store-defaults.js | 0 editor/{ => state}/store-persist.js | 0 editor/{ => state}/test/actions.js | 0 editor/{ => state}/test/effects.js | 0 editor/{test/store.js => state/test/index.js} | 2 +- editor/{ => state}/test/reducer.js | 0 editor/{ => state}/test/selectors.js | 0 editor/{ => state}/test/store-persist.js | 0 editor/table-of-contents/index.js | 4 ++-- 92 files changed, 131 insertions(+), 131 deletions(-) rename editor/{ => state}/actions.js (100%) rename editor/{ => state}/effects.js (99%) rename editor/{store.js => state/index.js} (100%) rename editor/{ => state}/reducer.js (99%) rename editor/{ => state}/selectors.js (100%) rename editor/{ => state}/store-defaults.js (100%) rename editor/{ => state}/store-persist.js (100%) rename editor/{ => state}/test/actions.js (100%) rename editor/{ => state}/test/effects.js (100%) rename editor/{test/store.js => state/test/index.js} (94%) rename editor/{ => state}/test/reducer.js (100%) rename editor/{ => state}/test/selectors.js (100%) rename editor/{ => state}/test/store-persist.js (100%) diff --git a/editor/components/autosave-monitor/index.js b/editor/components/autosave-monitor/index.js index ad54653afa5e21..09f9cdbcc3f3f3 100644 --- a/editor/components/autosave-monitor/index.js +++ b/editor/components/autosave-monitor/index.js @@ -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 ) { diff --git a/editor/components/block-inspector/index.js b/editor/components/block-inspector/index.js index 60316b571dbe3d..c1ecf0d2b2fa57 100644 --- a/editor/components/block-inspector/index.js +++ b/editor/components/block-inspector/index.js @@ -13,7 +13,7 @@ import { Slot } from '@wordpress/components'; * Internal Dependencies */ import './style.scss'; -import { getSelectedBlock, getSelectedBlockCount } from '../../selectors'; +import { getSelectedBlock, getSelectedBlockCount } from '../../state/selectors'; const BlockInspector = ( { selectedBlock, count } ) => { if ( count > 1 ) { diff --git a/editor/components/block-mover/index.js b/editor/components/block-mover/index.js index 0d3430f26b4376..cd6467e2de92da 100644 --- a/editor/components/block-mover/index.js +++ b/editor/components/block-mover/index.js @@ -16,8 +16,8 @@ import { getBlockType } from '@wordpress/blocks'; */ import './style.scss'; import { getBlockMoverLabel } from './mover-label'; -import { isFirstBlock, isLastBlock, getBlockIndex, getBlock } from '../../selectors'; -import { selectBlock } from '../../actions'; +import { isFirstBlock, isLastBlock, getBlockIndex, getBlock } from '../../state/selectors'; +import { selectBlock } from '../../state/actions'; export function BlockMover( { onMoveUp, onMoveDown, isFirst, isLast, uids, blockType, firstIndex } ) { // We emulate a disabled state because forcefully applying the `disabled` diff --git a/editor/components/block-settings-menu/block-delete-button.js b/editor/components/block-settings-menu/block-delete-button.js index 57ed7e0d3f8a30..fe06657683e9ec 100644 --- a/editor/components/block-settings-menu/block-delete-button.js +++ b/editor/components/block-settings-menu/block-delete-button.js @@ -13,7 +13,7 @@ import { IconButton } from '@wordpress/components'; /** * Internal dependencies */ -import { removeBlocks } from '../../actions'; +import { removeBlocks } from '../../state/actions'; export function BlockDeleteButton( { onDelete, onClick = noop, small = false } ) { const label = __( 'Delete' ); diff --git a/editor/components/block-settings-menu/block-inspector-button.js b/editor/components/block-settings-menu/block-inspector-button.js index 0f95035b5b35e6..c437e717e83c5f 100644 --- a/editor/components/block-settings-menu/block-inspector-button.js +++ b/editor/components/block-settings-menu/block-inspector-button.js @@ -13,8 +13,8 @@ import { IconButton } from '@wordpress/components'; /** * Internal dependencies */ -import { isEditorSidebarOpened } from '../../selectors'; -import { toggleSidebar, setActivePanel } from '../../actions'; +import { isEditorSidebarOpened } from '../../state/selectors'; +import { toggleSidebar, setActivePanel } from '../../state/actions'; export function BlockInspectorButton( { isSidebarOpened, diff --git a/editor/components/block-settings-menu/block-mode-toggle.js b/editor/components/block-settings-menu/block-mode-toggle.js index 18d8b7d234bc2b..eba24445117b8a 100644 --- a/editor/components/block-settings-menu/block-mode-toggle.js +++ b/editor/components/block-settings-menu/block-mode-toggle.js @@ -14,8 +14,8 @@ import { getBlockType } from '@wordpress/blocks'; /** * Internal dependencies */ -import { getBlockMode, getBlock } from '../../selectors'; -import { toggleBlockMode } from '../../actions'; +import { getBlockMode, getBlock } from '../../state/selectors'; +import { toggleBlockMode } from '../../state/actions'; export function BlockModeToggle( { blockType, mode, onToggleMode, small = false } ) { if ( ! blockType || blockType.supportHTML === false ) { diff --git a/editor/components/block-settings-menu/index.js b/editor/components/block-settings-menu/index.js index c8d3b5a72c3373..b51d4fe8844e68 100644 --- a/editor/components/block-settings-menu/index.js +++ b/editor/components/block-settings-menu/index.js @@ -18,7 +18,7 @@ import BlockInspectorButton from './block-inspector-button'; import BlockModeToggle from './block-mode-toggle'; import BlockDeleteButton from './block-delete-button'; import UnknownConverter from './unknown-converter'; -import { selectBlock } from '../../actions'; +import { selectBlock } from '../../state/actions'; function BlockSettingsMenu( { uids, onSelect, focus } ) { const count = uids.length; diff --git a/editor/components/block-settings-menu/unknown-converter.js b/editor/components/block-settings-menu/unknown-converter.js index be8e2124c1f068..a18651ab164e00 100644 --- a/editor/components/block-settings-menu/unknown-converter.js +++ b/editor/components/block-settings-menu/unknown-converter.js @@ -13,8 +13,8 @@ import { getUnknownTypeHandlerName, rawHandler, serialize } from '@wordpress/blo /** * Internal dependencies */ -import { getBlock } from '../../selectors'; -import { replaceBlocks } from '../../actions'; +import { getBlock } from '../../state/selectors'; +import { replaceBlocks } from '../../state/actions'; export function UnknownConverter( { block, convertToBlocks, small } ) { if ( ! block || getUnknownTypeHandlerName() !== block.name ) { diff --git a/editor/components/block-switcher/index.js b/editor/components/block-switcher/index.js index 54be221ea1e9ec..f850dd315ef6f8 100644 --- a/editor/components/block-switcher/index.js +++ b/editor/components/block-switcher/index.js @@ -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 diff --git a/editor/components/block-toolbar/index.js b/editor/components/block-toolbar/index.js index 845121bcd88463..5c7bf909c55876 100644 --- a/editor/components/block-toolbar/index.js +++ b/editor/components/block-toolbar/index.js @@ -21,7 +21,7 @@ import BlockInspectorButton from '../block-settings-menu/block-inspector-button' import BlockModeToggle from '../block-settings-menu/block-mode-toggle'; import BlockDeleteButton from '../block-settings-menu/block-delete-button'; import UnknownConverter from '../block-settings-menu/unknown-converter'; -import { getBlockMode, getSelectedBlock } from '../../selectors'; +import { getBlockMode, getSelectedBlock } from '../../state/selectors'; class BlockToolbar extends Component { constructor() { diff --git a/editor/components/document-outline/index.js b/editor/components/document-outline/index.js index db8fdcd8eae2ce..39a1a5f8eb7349 100644 --- a/editor/components/document-outline/index.js +++ b/editor/components/document-outline/index.js @@ -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 diff --git a/editor/components/error-boundary/index.js b/editor/components/error-boundary/index.js index 240674e5368b4c..445ad610a9b1e2 100644 --- a/editor/components/error-boundary/index.js +++ b/editor/components/error-boundary/index.js @@ -14,7 +14,7 @@ import { Button, ClipboardButton } from '@wordpress/components'; * Internal dependencies */ import { Warning } from '../'; -import { getEditedPostContent } from '../../selectors'; +import { getEditedPostContent } from '../../state/selectors'; class ErrorBoundary extends Component { constructor() { diff --git a/editor/components/inserter/index.js b/editor/components/inserter/index.js index 16282bce808cdb..b5951ea49645d6 100644 --- a/editor/components/inserter/index.js +++ b/editor/components/inserter/index.js @@ -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() { diff --git a/editor/components/inserter/menu.js b/editor/components/inserter/menu.js index 005944dde38b6d..2690bf231d2c58 100644 --- a/editor/components/inserter/menu.js +++ b/editor/components/inserter/menu.js @@ -33,8 +33,8 @@ import { keycodes } from '@wordpress/utils'; */ 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'; import { default as InserterGroup } from './group'; export const searchBlocks = ( blocks, searchTerm ) => { diff --git a/editor/components/meta-boxes/index.js b/editor/components/meta-boxes/index.js index 09f8f0008453a5..6921fd3d79b268 100644 --- a/editor/components/meta-boxes/index.js +++ b/editor/components/meta-boxes/index.js @@ -8,7 +8,7 @@ import { connect } from 'react-redux'; */ import MetaBoxesArea from './meta-boxes-area'; import MetaBoxesPanel from './meta-boxes-panel'; -import { getMetaBox } from '../../selectors'; +import { getMetaBox } from '../../state/selectors'; function MetaBoxes( { location, isActive, usePanel = false } ) { if ( ! isActive ) { diff --git a/editor/components/meta-boxes/meta-boxes-area/index.js b/editor/components/meta-boxes/meta-boxes-area/index.js index 26a6002a0b9466..4058d9bb4e4edf 100644 --- a/editor/components/meta-boxes/meta-boxes-area/index.js +++ b/editor/components/meta-boxes/meta-boxes-area/index.js @@ -16,8 +16,8 @@ import { Spinner } from '@wordpress/components'; * Internal dependencies */ import './style.scss'; -import { handleMetaBoxReload, metaBoxStateChanged, metaBoxLoaded } from '../../../actions'; -import { getMetaBox, isSavingPost } from '../../../selectors'; +import { handleMetaBoxReload, metaBoxStateChanged, metaBoxLoaded } from '../../../state/actions'; +import { getMetaBox, isSavingPost } from '../../../state/selectors'; class MetaBoxesArea extends Component { constructor() { diff --git a/editor/components/page-attributes/check.js b/editor/components/page-attributes/check.js index 760705f91d46d9..93a0207224a0f4 100644 --- a/editor/components/page-attributes/check.js +++ b/editor/components/page-attributes/check.js @@ -12,7 +12,7 @@ import { withAPIData } from '@wordpress/components'; /** * Internal dependencies */ -import { getCurrentPostType } from '../../selectors'; +import { getCurrentPostType } from '../../state/selectors'; export function PageAttributesCheck( { postType, children } ) { const supportsPageAttributes = get( postType.data, [ diff --git a/editor/components/page-attributes/index.js b/editor/components/page-attributes/index.js index 2b28f2bfea72c6..8a712f57005672 100644 --- a/editor/components/page-attributes/index.js +++ b/editor/components/page-attributes/index.js @@ -14,8 +14,8 @@ import { withInstanceId } from '@wordpress/components'; * Internal dependencies */ import PageAttributesCheck from './check'; -import { editPost } from '../../actions'; -import { getEditedPostAttribute } from '../../selectors'; +import { editPost } from '../../state/actions'; +import { getEditedPostAttribute } from '../../state/selectors'; export function PageAttributes( { onUpdateOrder, instanceId, order } ) { const setUpdatedOrder = ( event ) => { diff --git a/editor/components/post-author/index.js b/editor/components/post-author/index.js index 68ed59e208389a..4b8377a258567e 100644 --- a/editor/components/post-author/index.js +++ b/editor/components/post-author/index.js @@ -15,8 +15,8 @@ import { Component } from '@wordpress/element'; * Internal dependencies */ import PostAuthorCheck from './check'; -import { getEditedPostAttribute } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute } from '../../state/selectors'; +import { editPost } from '../../state/actions'; export class PostAuthor extends Component { constructor() { diff --git a/editor/components/post-comments/index.js b/editor/components/post-comments/index.js index 46bf3657ca94bb..f1737b127cfc37 100644 --- a/editor/components/post-comments/index.js +++ b/editor/components/post-comments/index.js @@ -12,8 +12,8 @@ import { FormToggle, withInstanceId } from '@wordpress/components'; /** * Internal Dependencies */ -import { getEditedPostAttribute } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute } from '../../state/selectors'; +import { editPost } from '../../state/actions'; function PostComments( { commentStatus = 'open', instanceId, ...props } ) { const onToggleComments = () => props.editPost( { comment_status: commentStatus === 'open' ? 'closed' : 'open' } ); diff --git a/editor/components/post-excerpt/index.js b/editor/components/post-excerpt/index.js index ffc82d6ba81d6e..65dc16e70ab0d8 100644 --- a/editor/components/post-excerpt/index.js +++ b/editor/components/post-excerpt/index.js @@ -13,8 +13,8 @@ import { ExternalLink } from '@wordpress/components'; * Internal Dependencies */ import './style.scss'; -import { getEditedPostExcerpt } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostExcerpt } from '../../state/selectors'; +import { editPost } from '../../state/actions'; function PostExcerpt( { excerpt, onUpdateExcerpt } ) { const onChange = ( event ) => onUpdateExcerpt( event.target.value ); diff --git a/editor/components/post-featured-image/index.js b/editor/components/post-featured-image/index.js index 1c473659c8e977..66324fa451471e 100644 --- a/editor/components/post-featured-image/index.js +++ b/editor/components/post-featured-image/index.js @@ -15,8 +15,8 @@ import { MediaUploadButton } from '@wordpress/blocks'; * Internal dependencies */ import './style.scss'; -import { getEditedPostAttribute } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute } from '../../state/selectors'; +import { editPost } from '../../state/actions'; function PostFeaturedImage( { featuredImageId, onUpdateImage, onRemoveImage, media } ) { return ( diff --git a/editor/components/post-format/check.js b/editor/components/post-format/check.js index 7d2894b7524a01..eb138267966cdb 100644 --- a/editor/components/post-format/check.js +++ b/editor/components/post-format/check.js @@ -12,7 +12,7 @@ import { withAPIData } from '@wordpress/components'; /** * Internal dependencies */ -import { getCurrentPostType } from '../../selectors'; +import { getCurrentPostType } from '../../state/selectors'; function PostFormatCheck( { postType, children } ) { if ( ! get( postType.data, [ 'supports', 'post-formats' ] ) ) { diff --git a/editor/components/post-format/index.js b/editor/components/post-format/index.js index 307c4df2432ff4..b20e7f882c3f21 100644 --- a/editor/components/post-format/index.js +++ b/editor/components/post-format/index.js @@ -15,8 +15,8 @@ import { withInstanceId } from '@wordpress/components'; */ import './style.scss'; import PostFormatCheck from './check'; -import { getEditedPostAttribute, getSuggestedPostFormat } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute, getSuggestedPostFormat } from '../../state/selectors'; +import { editPost } from '../../state/actions'; const POST_FORMATS = [ { id: 'aside', caption: __( 'Aside' ) }, diff --git a/editor/components/post-last-revision/check.js b/editor/components/post-last-revision/check.js index 04f83227f3916e..0c0a8187fe3798 100644 --- a/editor/components/post-last-revision/check.js +++ b/editor/components/post-last-revision/check.js @@ -6,7 +6,7 @@ import { connect } from 'react-redux'; /** * Internal dependencies */ -import { getCurrentPostLastRevisionId } from '../../selectors'; +import { getCurrentPostLastRevisionId } from '../../state/selectors'; function PostLastRevisionCheck( { lastRevisionId, children } ) { if ( ! lastRevisionId ) { diff --git a/editor/components/post-last-revision/index.js b/editor/components/post-last-revision/index.js index f6cf3248d230f7..2f272ac677ec93 100644 --- a/editor/components/post-last-revision/index.js +++ b/editor/components/post-last-revision/index.js @@ -17,7 +17,7 @@ import PostLastRevisionCheck from './check'; import { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount, -} from '../../selectors'; +} from '../../state/selectors'; import { getWPAdminURL } from '../../utils/url'; function LastRevision( { lastRevisionId, revisionsCount } ) { diff --git a/editor/components/post-pending-status/check.js b/editor/components/post-pending-status/check.js index 937252ccf6bda7..c8599d1bb2baab 100644 --- a/editor/components/post-pending-status/check.js +++ b/editor/components/post-pending-status/check.js @@ -12,7 +12,7 @@ import { withAPIData } from '@wordpress/components'; /** * Internal dependencies */ -import { isCurrentPostPublished } from '../../selectors'; +import { isCurrentPostPublished } from '../../state/selectors'; export function PostPendingStatusCheck( { isPublished, children, user } ) { if ( isPublished || ! user.data || ! user.data.capabilities.publish_posts ) { diff --git a/editor/components/post-pending-status/index.js b/editor/components/post-pending-status/index.js index 986d01ec42fbe3..b397ec350562ef 100644 --- a/editor/components/post-pending-status/index.js +++ b/editor/components/post-pending-status/index.js @@ -14,8 +14,8 @@ import { FormToggle, withInstanceId } from '@wordpress/components'; * Internal dependencies */ import PostPendingStatusCheck from './check'; -import { getEditedPostAttribute } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute } from '../../state/selectors'; +import { editPost } from '../../state/actions'; export function PostPendingStatus( { instanceId, status, onUpdateStatus } ) { const pendingId = 'pending-toggle-' + instanceId; diff --git a/editor/components/post-permalink/index.js b/editor/components/post-permalink/index.js index d5132d8bde6c23..7a40db52b60e42 100644 --- a/editor/components/post-permalink/index.js +++ b/editor/components/post-permalink/index.js @@ -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() { diff --git a/editor/components/post-pingbacks/index.js b/editor/components/post-pingbacks/index.js index d213d5fa50db11..90cb6f3ac0d498 100644 --- a/editor/components/post-pingbacks/index.js +++ b/editor/components/post-pingbacks/index.js @@ -12,8 +12,8 @@ import { FormToggle, withInstanceId } from '@wordpress/components'; /** * Internal Dependencies */ -import { getEditedPostAttribute } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute } from '../../state/selectors'; +import { editPost } from '../../state/actions'; function PostPingbacks( { pingStatus = 'open', instanceId, ...props } ) { const onTogglePingback = () => props.editPost( { ping_status: pingStatus === 'open' ? 'closed' : 'open' } ); diff --git a/editor/components/post-preview-button/index.js b/editor/components/post-preview-button/index.js index 6bcbc3e011eece..25753f0c39732f 100644 --- a/editor/components/post-preview-button/index.js +++ b/editor/components/post-preview-button/index.js @@ -19,8 +19,8 @@ import { isEditedPostDirty, isEditedPostNew, isEditedPostSaveable, -} from '../../selectors'; -import { autosave } from '../../actions'; +} from '../../state/selectors'; +import { autosave } from '../../state/actions'; export class PostPreviewButton extends Component { constructor() { diff --git a/editor/components/post-publish-button/index.js b/editor/components/post-publish-button/index.js index ff9d8c21af68e7..029c18e99647ce 100644 --- a/editor/components/post-publish-button/index.js +++ b/editor/components/post-publish-button/index.js @@ -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 PostPublishButton( { isSaving, diff --git a/editor/components/post-publish-button/label.js b/editor/components/post-publish-button/label.js index 17f3bd861f9c35..78cd9781c2a9c7 100644 --- a/editor/components/post-publish-button/label.js +++ b/editor/components/post-publish-button/label.js @@ -17,7 +17,7 @@ import './style.scss'; import { isCurrentPostPublished, isEditedPostBeingScheduled, -} from '../../selectors'; +} from '../../state/selectors'; export function PublishButtonLabel( { isPublished, diff --git a/editor/components/post-saved-state/index.js b/editor/components/post-saved-state/index.js index 7cc7331c87588b..dff53684b7dbb4 100644 --- a/editor/components/post-saved-state/index.js +++ b/editor/components/post-saved-state/index.js @@ -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, @@ -23,7 +23,7 @@ import { isEditedPostSaveable, getCurrentPost, getEditedPostAttribute, -} from '../../selectors'; +} from '../../state/selectors'; export function PostSavedState( { isNew, isPublished, isDirty, isSaving, isSaveable, status, onStatusChange, onSave } ) { const className = 'editor-post-saved-state'; diff --git a/editor/components/post-schedule/index.js b/editor/components/post-schedule/index.js index 1d0d7b34954561..80d2c3cfe3258b 100644 --- a/editor/components/post-schedule/index.js +++ b/editor/components/post-schedule/index.js @@ -15,8 +15,8 @@ import { settings } from '@wordpress/date'; */ import './style.scss'; import PostScheduleClock from './clock'; -import { getEditedPostAttribute } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute } from '../../state/selectors'; +import { editPost } from '../../state/actions'; export function PostSchedule( { date, onUpdateDate } ) { const momentDate = date ? moment( date ) : moment(); diff --git a/editor/components/post-schedule/label.js b/editor/components/post-schedule/label.js index 1f143ee3e29ab5..3794240c02f155 100644 --- a/editor/components/post-schedule/label.js +++ b/editor/components/post-schedule/label.js @@ -12,7 +12,7 @@ import { dateI18n, settings } from '@wordpress/date'; /** * Internal dependencies */ -import { getEditedPostAttribute } from '../../selectors'; +import { getEditedPostAttribute } from '../../state/selectors'; function PostScheduleLabel( { date } ) { return date ? diff --git a/editor/components/post-sticky/check.js b/editor/components/post-sticky/check.js index 9cb9ecc3b184fc..755f3002d5cfa9 100644 --- a/editor/components/post-sticky/check.js +++ b/editor/components/post-sticky/check.js @@ -12,7 +12,7 @@ import { withAPIData } from '@wordpress/components'; /** * Internal dependencies */ -import { getCurrentPostType } from '../../selectors'; +import { getCurrentPostType } from '../../state/selectors'; export function PostStickyCheck( { postType, children, user } ) { if ( diff --git a/editor/components/post-sticky/index.js b/editor/components/post-sticky/index.js index 1fbdb1e552df79..92f0585ec76201 100644 --- a/editor/components/post-sticky/index.js +++ b/editor/components/post-sticky/index.js @@ -13,8 +13,8 @@ import { FormToggle, withInstanceId } from '@wordpress/components'; /** * Internal dependencies */ -import { getEditedPostAttribute } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute } from '../../state/selectors'; +import { editPost } from '../../state/actions'; import PostStickyCheck from './check'; export function PostSticky( { onUpdateSticky, postSticky = false, instanceId } ) { diff --git a/editor/components/post-taxonomies/flat-term-selector.js b/editor/components/post-taxonomies/flat-term-selector.js index 72df24181b021e..f9b4c73aa069be 100644 --- a/editor/components/post-taxonomies/flat-term-selector.js +++ b/editor/components/post-taxonomies/flat-term-selector.js @@ -14,8 +14,8 @@ import { FormTokenField } from '@wordpress/components'; /** * Internal dependencies */ -import { getEditedPostAttribute } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute } from '../../state/selectors'; +import { editPost } from '../../state/actions'; const DEFAULT_QUERY = { per_page: 100, diff --git a/editor/components/post-taxonomies/hierarchical-term-selector.js b/editor/components/post-taxonomies/hierarchical-term-selector.js index 88334d8db10f4e..7b084eca668dc6 100644 --- a/editor/components/post-taxonomies/hierarchical-term-selector.js +++ b/editor/components/post-taxonomies/hierarchical-term-selector.js @@ -14,8 +14,8 @@ import { withInstanceId } from '@wordpress/components'; /** * Internal dependencies */ -import { getEditedPostAttribute } from '../../selectors'; -import { editPost } from '../../actions'; +import { getEditedPostAttribute } from '../../state/selectors'; +import { editPost } from '../../state/actions'; const DEFAULT_QUERY = { per_page: 100, diff --git a/editor/components/post-taxonomies/index.js b/editor/components/post-taxonomies/index.js index 730854a4502ee5..2557f8503b9be6 100644 --- a/editor/components/post-taxonomies/index.js +++ b/editor/components/post-taxonomies/index.js @@ -15,7 +15,7 @@ import { withAPIData } from '@wordpress/components'; import './style.scss'; import HierarchicalTermSelector from './hierarchical-term-selector'; import FlatTermSelector from './flat-term-selector'; -import { getCurrentPostType } from '../../selectors'; +import { getCurrentPostType } from '../../state/selectors'; function PostTaxonomies( { postType, taxonomies } ) { const availableTaxonomies = filter( taxonomies.data, ( taxonomy ) => taxonomy.types.indexOf( postType ) !== -1 ); diff --git a/editor/components/post-text-editor/index.js b/editor/components/post-text-editor/index.js index 5fa40bad6386ff..5d300a4f5add79 100644 --- a/editor/components/post-text-editor/index.js +++ b/editor/components/post-text-editor/index.js @@ -14,8 +14,8 @@ import { parse } from '@wordpress/blocks'; * Internal dependencies */ import './style.scss'; -import { getEditedPostContent } from '../../selectors'; -import { editPost, resetBlocks } from '../../actions'; +import { getEditedPostContent } from '../../state/selectors'; +import { editPost, resetBlocks } from '../../state/actions'; class PostTextEditor extends Component { constructor( props ) { diff --git a/editor/components/post-title/index.js b/editor/components/post-title/index.js index cd93582ec9a9a4..7bcae7fea22f97 100644 --- a/editor/components/post-title/index.js +++ b/editor/components/post-title/index.js @@ -18,8 +18,8 @@ import { createBlock, getDefaultBlockName } from '@wordpress/blocks'; */ import './style.scss'; import PostPermalink from '../post-permalink'; -import { getEditedPostTitle } from '../../selectors'; -import { insertBlock, editPost, clearSelectedBlock } from '../../actions'; +import { getEditedPostTitle } from '../../state/selectors'; +import { insertBlock, editPost, clearSelectedBlock } from '../../state/actions'; /** * Constants diff --git a/editor/components/post-trash/index.js b/editor/components/post-trash/index.js index 864e7f264e058b..bb92e06a364ac4 100644 --- a/editor/components/post-trash/index.js +++ b/editor/components/post-trash/index.js @@ -17,8 +17,8 @@ import { isEditedPostNew, getCurrentPostId, getCurrentPostType, -} from '../../selectors'; -import { trashPost } from '../../actions'; +} from '../../state/selectors'; +import { trashPost } from '../../state/actions'; function PostTrash( { isNew, postId, postType, ...props } ) { if ( isNew || ! postId ) { diff --git a/editor/components/post-visibility/index.js b/editor/components/post-visibility/index.js index 05e08581428d6e..91eee213fea8c6 100644 --- a/editor/components/post-visibility/index.js +++ b/editor/components/post-visibility/index.js @@ -18,8 +18,8 @@ import { visibilityOptions } from './utils'; import { getEditedPostAttribute, getEditedPostVisibility, -} from '../../selectors'; -import { editPost, savePost } from '../../actions'; +} from '../../state/selectors'; +import { editPost, savePost } from '../../state/actions'; export class PostVisibility extends Component { constructor( props ) { diff --git a/editor/components/post-visibility/label.js b/editor/components/post-visibility/label.js index a57376901a17e5..96729b64a0b9a7 100644 --- a/editor/components/post-visibility/label.js +++ b/editor/components/post-visibility/label.js @@ -7,7 +7,7 @@ import { find } from 'lodash'; /** * Internal Dependencies */ -import { getEditedPostVisibility } from '../../selectors'; +import { getEditedPostVisibility } from '../../state/selectors'; import { visibilityOptions } from './utils'; function PostVisibilityLabel( { visibility } ) { diff --git a/editor/components/provider/index.js b/editor/components/provider/index.js index b9b0b3e99816ca..06319e3234bc7a 100644 --- a/editor/components/provider/index.js +++ b/editor/components/provider/index.js @@ -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 diff --git a/editor/components/unsaved-changes-warning/index.js b/editor/components/unsaved-changes-warning/index.js index 4676d83b5b3c78..fdda766cc472bc 100644 --- a/editor/components/unsaved-changes-warning/index.js +++ b/editor/components/unsaved-changes-warning/index.js @@ -12,7 +12,7 @@ import { Component } from '@wordpress/element'; /** * Internal dependencies */ -import { isEditedPostDirty } from '../../selectors'; +import { isEditedPostDirty } from '../../state/selectors'; class UnsavedChangesWarning extends Component { constructor() { diff --git a/editor/components/word-count/index.js b/editor/components/word-count/index.js index 680aa53c46ce67..a85290d23efdbe 100644 --- a/editor/components/word-count/index.js +++ b/editor/components/word-count/index.js @@ -11,7 +11,7 @@ import { serialize } from '@wordpress/blocks'; /** * Internal dependencies */ -import { getBlocks } from '../../selectors'; +import { getBlocks } from '../../state/selectors'; function WordCount( { content } ) { const wordCount = wp.utils.WordCounter.prototype.count( content ); diff --git a/editor/components/writing-flow/index.js b/editor/components/writing-flow/index.js index 12a870c2e4cc47..9d010ddaa0fd82 100644 --- a/editor/components/writing-flow/index.js +++ b/editor/components/writing-flow/index.js @@ -26,8 +26,8 @@ import { getMultiSelectedBlocksEndUid, getMultiSelectedBlocks, getSelectedBlock, -} from '../../selectors'; -import { multiSelect } from '../../actions'; +} from '../../state/selectors'; +import { multiSelect } from '../../state/actions'; /** * Module Constants diff --git a/editor/document-title/index.js b/editor/document-title/index.js index 4119c0abda49fb..96a39b8e173996 100644 --- a/editor/document-title/index.js +++ b/editor/document-title/index.js @@ -7,7 +7,7 @@ import { Component } from 'react'; /** * Internal dependencies */ -import { getDocumentTitle } from '../selectors'; +import { getDocumentTitle } from '../state/selectors'; class DocumentTitle extends Component { constructor( props ) { diff --git a/editor/header/fixed-toolbar-toggle/index.js b/editor/header/fixed-toolbar-toggle/index.js index 3b91ad9a0b1004..08edb8b7daf22b 100644 --- a/editor/header/fixed-toolbar-toggle/index.js +++ b/editor/header/fixed-toolbar-toggle/index.js @@ -13,8 +13,8 @@ import { IconButton, withInstanceId } from '@wordpress/components'; * Internal Dependencies */ import './style.scss'; -import { isFeatureActive } from '../../selectors'; -import { toggleFeature } from '../../actions'; +import { isFeatureActive } from '../../state/selectors'; +import { toggleFeature } from '../../state/actions'; function FeatureToggle( { onToggle, active } ) { return ( diff --git a/editor/header/header-toolbar/index.js b/editor/header/header-toolbar/index.js index dae2e84fe5c06e..1f540cb72260e2 100644 --- a/editor/header/header-toolbar/index.js +++ b/editor/header/header-toolbar/index.js @@ -17,7 +17,7 @@ import { Inserter, BlockToolbar } from '../../components'; import BlockSwitcher from '../../components/block-switcher'; import NavigableToolbar from '../../navigable-toolbar'; import TableOfContents from '../../table-of-contents'; -import { getMultiSelectedBlockUids, hasEditorUndo, hasEditorRedo, isFeatureActive } from '../../selectors'; +import { getMultiSelectedBlockUids, hasEditorUndo, hasEditorRedo, isFeatureActive } from '../../state/selectors'; function HeaderToolbar( { hasUndo, hasRedo, hasFixedToolbar, undo, redo, isMultiBlockSelection, selectedBlockUids } ) { return ( diff --git a/editor/header/index.js b/editor/header/index.js index 8ed8f6477a6f13..05457e8f790802 100644 --- a/editor/header/index.js +++ b/editor/header/index.js @@ -17,8 +17,8 @@ import PublishWithDropdown from './publish-with-dropdown'; import { PostPreviewButton, PostSavedState } from '../components'; import EllipsisMenu from './ellipsis-menu'; import HeaderToolbar from './header-toolbar'; -import { isEditorSidebarOpened } from '../selectors'; -import { toggleSidebar } from '../actions'; +import { isEditorSidebarOpened } from '../state/selectors'; +import { toggleSidebar } from '../state/actions'; function Header( { onToggleSidebar, isSidebarOpened } ) { return ( diff --git a/editor/header/mode-switcher/index.js b/editor/header/mode-switcher/index.js index 593baab919d4be..48be04c6b6917c 100644 --- a/editor/header/mode-switcher/index.js +++ b/editor/header/mode-switcher/index.js @@ -13,7 +13,7 @@ import { IconButton } from '@wordpress/components'; * Internal dependencies */ import './style.scss'; -import { getEditorMode } from '../../selectors'; +import { getEditorMode } from '../../state/selectors'; /** * Set of available mode options. diff --git a/editor/header/publish-with-dropdown/index.js b/editor/header/publish-with-dropdown/index.js index 1ea81baea33e03..cd2031de1e60e0 100644 --- a/editor/header/publish-with-dropdown/index.js +++ b/editor/header/publish-with-dropdown/index.js @@ -18,7 +18,7 @@ import { isSavingPost, isEditedPostSaveable, isEditedPostPublishable, -} from '../../selectors'; +} from '../../state/selectors'; function PublishWithDropdown( { isSaving, isPublishable, isSaveable } ) { const isButtonEnabled = ! isSaving && isPublishable && isSaveable; diff --git a/editor/index.js b/editor/index.js index a1e05bdeba28c6..1672d7973f84d9 100644 --- a/editor/index.js +++ b/editor/index.js @@ -16,7 +16,7 @@ import { settings as dateSettings } from '@wordpress/date'; import './assets/stylesheets/main.scss'; import Layout from './layout'; import { EditorProvider, ErrorBoundary } from './components'; -import { initializeMetaBoxState } from './actions'; +import { initializeMetaBoxState } from './state/actions'; export * from './components'; diff --git a/editor/layout/index.js b/editor/layout/index.js index ed030d25f2162b..878cb212a211ae 100644 --- a/editor/layout/index.js +++ b/editor/layout/index.js @@ -19,13 +19,13 @@ import Sidebar from '../sidebar'; import TextEditor from '../modes/text-editor'; import VisualEditor from '../modes/visual-editor'; import DocumentTitle from '../document-title'; -import { removeNotice } from '../actions'; +import { removeNotice } from '../state/actions'; import { MetaBoxes, AutosaveMonitor, UnsavedChangesWarning } from '../components'; import { getEditorMode, isEditorSidebarOpened, getNotices, -} from '../selectors'; +} from '../state/selectors'; function Layout( { mode, isSidebarOpened, notices, ...props } ) { const className = classnames( 'editor-layout', { diff --git a/editor/modes/visual-editor/block-contextual-toolbar.js b/editor/modes/visual-editor/block-contextual-toolbar.js index 8f28fc6f51339c..07b8dfe5877796 100644 --- a/editor/modes/visual-editor/block-contextual-toolbar.js +++ b/editor/modes/visual-editor/block-contextual-toolbar.js @@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n'; */ import NavigableToolbar from '../../navigable-toolbar'; import { BlockToolbar } from '../../components'; -import { isFeatureActive } from '../../selectors'; +import { isFeatureActive } from '../../state/selectors'; function BlockContextualToolbar( { hasFixedToolbar } ) { if ( hasFixedToolbar ) { diff --git a/editor/modes/visual-editor/block-drop-zone.js b/editor/modes/visual-editor/block-drop-zone.js index ef8da49f0e459d..4e0a127935687b 100644 --- a/editor/modes/visual-editor/block-drop-zone.js +++ b/editor/modes/visual-editor/block-drop-zone.js @@ -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 ) => { diff --git a/editor/modes/visual-editor/block-html.js b/editor/modes/visual-editor/block-html.js index 4a6e62271d2393..8d3327f799d699 100644 --- a/editor/modes/visual-editor/block-html.js +++ b/editor/modes/visual-editor/block-html.js @@ -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 ) { diff --git a/editor/modes/visual-editor/block-list.js b/editor/modes/visual-editor/block-list.js index 3a4fd2bfb951b8..0b6bd22ef8ef04 100644 --- a/editor/modes/visual-editor/block-list.js +++ b/editor/modes/visual-editor/block-list.js @@ -35,8 +35,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 ) { diff --git a/editor/modes/visual-editor/block.js b/editor/modes/visual-editor/block.js index b61b9ec90aadb9..7b5fd42e3e5c03 100644 --- a/editor/modes/visual-editor/block.js +++ b/editor/modes/visual-editor/block.js @@ -37,7 +37,7 @@ import { startTyping, stopTyping, updateBlockAttributes, -} from '../../actions'; +} from '../../state/actions'; import { getBlock, getBlockFocus, @@ -52,7 +52,7 @@ import { isFirstMultiSelectedBlock, isTyping, getBlockMode, -} from '../../selectors'; +} from '../../state/selectors'; const { BACKSPACE, ESCAPE, DELETE, ENTER, UP, RIGHT, DOWN, LEFT } = keycodes; diff --git a/editor/modes/visual-editor/index.js b/editor/modes/visual-editor/index.js index e6280fcf9671fe..8d41140c5fa71a 100644 --- a/editor/modes/visual-editor/index.js +++ b/editor/modes/visual-editor/index.js @@ -17,8 +17,8 @@ import './style.scss'; import VisualEditorBlockList from './block-list'; import VisualEditorInserter from './inserter'; import { PostTitle, WritingFlow } from '../../components'; -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() { diff --git a/editor/modes/visual-editor/inserter.js b/editor/modes/visual-editor/inserter.js index 9c186f219cc6a1..22b4f8665122f2 100644 --- a/editor/modes/visual-editor/inserter.js +++ b/editor/modes/visual-editor/inserter.js @@ -16,8 +16,8 @@ import { createBlock, BlockIcon } from '@wordpress/blocks'; * Internal dependencies */ import { Inserter } from '../../components'; -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() { diff --git a/editor/modes/visual-editor/invalid-block-warning.js b/editor/modes/visual-editor/invalid-block-warning.js index 2ac3b64a65046d..fbff42871be251 100644 --- a/editor/modes/visual-editor/invalid-block-warning.js +++ b/editor/modes/visual-editor/invalid-block-warning.js @@ -22,7 +22,7 @@ import { /** * Internal dependencies */ -import { replaceBlock } from '../../actions'; +import { replaceBlock } from '../../state/actions'; function InvalidBlockWarning( { ignoreInvalid, switchToBlockType } ) { const htmlBlockName = 'core/html'; diff --git a/editor/modes/visual-editor/multi-controls.js b/editor/modes/visual-editor/multi-controls.js index e1f5933584c244..e2cac789fbf6b1 100644 --- a/editor/modes/visual-editor/multi-controls.js +++ b/editor/modes/visual-editor/multi-controls.js @@ -11,7 +11,7 @@ import BlockSettingsMenu from '../../components/block-settings-menu'; import { getMultiSelectedBlockUids, isMultiSelecting, -} from '../../selectors'; +} from '../../state/selectors'; function VisualEditorBlockMultiControls( { multiSelectedBlockUids, isSelecting } ) { if ( isSelecting ) { diff --git a/editor/modes/visual-editor/sibling-inserter.js b/editor/modes/visual-editor/sibling-inserter.js index 5ebea979d87895..7eed02d5a59025 100644 --- a/editor/modes/visual-editor/sibling-inserter.js +++ b/editor/modes/visual-editor/sibling-inserter.js @@ -19,7 +19,7 @@ import { getBlockInsertionPoint, isBlockInsertionPointVisible, isBlockWithinSelection, -} from '../../selectors'; +} from '../../state/selectors'; class VisualEditorSiblingInserter extends Component { constructor() { diff --git a/editor/sidebar/discussion-panel/index.js b/editor/sidebar/discussion-panel/index.js index b334a8f234e599..9f36d88e3762b3 100644 --- a/editor/sidebar/discussion-panel/index.js +++ b/editor/sidebar/discussion-panel/index.js @@ -13,8 +13,8 @@ import { PanelBody, PanelRow } from '@wordpress/components'; * Internal Dependencies */ import { PostComments, PostPingbacks } from '../../components'; -import { isEditorSidebarPanelOpened } from '../../selectors'; -import { toggleSidebarPanel } from '../../actions'; +import { isEditorSidebarPanelOpened } from '../../state/selectors'; +import { toggleSidebarPanel } from '../../state/actions'; /** * Module Constants diff --git a/editor/sidebar/document-outline-panel/index.js b/editor/sidebar/document-outline-panel/index.js index 0b1dc2a8c91c23..324bd1b22b951c 100644 --- a/editor/sidebar/document-outline-panel/index.js +++ b/editor/sidebar/document-outline-panel/index.js @@ -14,8 +14,8 @@ import { PanelBody } from '@wordpress/components'; * Internal dependencies */ import { DocumentOutline } from '../../components'; -import { getBlocks, isEditorSidebarPanelOpened } from '../../selectors'; -import { toggleSidebarPanel } from '../../actions'; +import { getBlocks, isEditorSidebarPanelOpened } from '../../state/selectors'; +import { toggleSidebarPanel } from '../../state/actions'; /** * Module constants diff --git a/editor/sidebar/featured-image/index.js b/editor/sidebar/featured-image/index.js index 25105df8b5fd93..2f35d70134cf83 100644 --- a/editor/sidebar/featured-image/index.js +++ b/editor/sidebar/featured-image/index.js @@ -13,8 +13,8 @@ import { PanelBody } from '@wordpress/components'; * Internal dependencies */ import { PostFeaturedImage } from '../../components'; -import { isEditorSidebarPanelOpened } from '../../selectors'; -import { toggleSidebarPanel } from '../../actions'; +import { isEditorSidebarPanelOpened } from '../../state/selectors'; +import { toggleSidebarPanel } from '../../state/actions'; /** * Module Constants diff --git a/editor/sidebar/header.js b/editor/sidebar/header.js index d2788cf4a1f7db..fa4ffec8071c1d 100644 --- a/editor/sidebar/header.js +++ b/editor/sidebar/header.js @@ -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". diff --git a/editor/sidebar/index.js b/editor/sidebar/index.js index 22ccb6800d0f6d..3f9f77edd4bf97 100644 --- a/editor/sidebar/index.js +++ b/editor/sidebar/index.js @@ -17,7 +17,7 @@ import PostSettings from './post-settings'; import BlockInspectorPanel from './block-inspector-panel'; import Header from './header'; -import { getActivePanel } from '../selectors'; +import { getActivePanel } from '../state/selectors'; const Sidebar = ( { panel } ) => { return ( diff --git a/editor/sidebar/page-attributes/index.js b/editor/sidebar/page-attributes/index.js index bbcbb643bf9bd6..130f1f26254f3d 100644 --- a/editor/sidebar/page-attributes/index.js +++ b/editor/sidebar/page-attributes/index.js @@ -13,8 +13,8 @@ import { PanelBody, PanelRow } from '@wordpress/components'; * Internal dependencies */ import { PageAttributes as PageAttributesForm, PageAttributesCheck } from '../../components'; -import { toggleSidebarPanel } from '../../actions'; -import { isEditorSidebarPanelOpened } from '../../selectors'; +import { toggleSidebarPanel } from '../../state/actions'; +import { isEditorSidebarPanelOpened } from '../../state/selectors'; /** * Module Constants diff --git a/editor/sidebar/post-excerpt/index.js b/editor/sidebar/post-excerpt/index.js index c24e0663dc7478..aafdf3aaa84a3d 100644 --- a/editor/sidebar/post-excerpt/index.js +++ b/editor/sidebar/post-excerpt/index.js @@ -13,8 +13,8 @@ import { PanelBody } from '@wordpress/components'; * Internal Dependencies */ import { PostExcerpt as PostExcerptForm } from '../../components'; -import { isEditorSidebarPanelOpened } from '../../selectors'; -import { toggleSidebarPanel } from '../../actions'; +import { isEditorSidebarPanelOpened } from '../../state/selectors'; +import { toggleSidebarPanel } from '../../state/actions'; /** * Module Constants diff --git a/editor/sidebar/post-status/index.js b/editor/sidebar/post-status/index.js index 31361b5a7dba0c..f25604201a69d7 100644 --- a/editor/sidebar/post-status/index.js +++ b/editor/sidebar/post-status/index.js @@ -21,8 +21,8 @@ import PostFormat from '../post-format'; import PostPendingStatus from '../post-pending-status'; import { isEditorSidebarPanelOpened, -} from '../../selectors'; -import { toggleSidebarPanel } from '../../actions'; +} from '../../state/selectors'; +import { toggleSidebarPanel } from '../../state/actions'; /** * Module Constants diff --git a/editor/sidebar/post-taxonomies/index.js b/editor/sidebar/post-taxonomies/index.js index 8592a70388b250..a8ad558f410daa 100644 --- a/editor/sidebar/post-taxonomies/index.js +++ b/editor/sidebar/post-taxonomies/index.js @@ -13,8 +13,8 @@ import { PanelBody } from '@wordpress/components'; * Internal dependencies */ import { PostTaxonomies as PostTaxonomiesForm } from '../../components'; -import { isEditorSidebarPanelOpened } from '../../selectors'; -import { toggleSidebarPanel } from '../../actions'; +import { isEditorSidebarPanelOpened } from '../../state/selectors'; +import { toggleSidebarPanel } from '../../state/actions'; /** * Module Constants diff --git a/editor/sidebar/post-trash/index.js b/editor/sidebar/post-trash/index.js index 922ae0b6a8c3d1..6d296f9393b216 100644 --- a/editor/sidebar/post-trash/index.js +++ b/editor/sidebar/post-trash/index.js @@ -13,7 +13,7 @@ import { PanelRow } from '@wordpress/components'; */ import './style.scss'; import { PostTrash as PostTrashLink } from '../../components'; -import { isEditedPostNew, getCurrentPostId } from '../../selectors'; +import { isEditedPostNew, getCurrentPostId } from '../../state/selectors'; function PostTrash( { isNew, postId } ) { if ( isNew || ! postId ) { diff --git a/editor/actions.js b/editor/state/actions.js similarity index 100% rename from editor/actions.js rename to editor/state/actions.js diff --git a/editor/effects.js b/editor/state/effects.js similarity index 99% rename from editor/effects.js rename to editor/state/effects.js index be9a6be2e11304..e59804334d4d96 100644 --- a/editor/effects.js +++ b/editor/state/effects.js @@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { getPostEditUrl, getWPAdminURL } from './utils/url'; +import { getPostEditUrl, getWPAdminURL } from '../utils/url'; import { resetPost, setupNewPost, diff --git a/editor/store.js b/editor/state/index.js similarity index 100% rename from editor/store.js rename to editor/state/index.js diff --git a/editor/reducer.js b/editor/state/reducer.js similarity index 99% rename from editor/reducer.js rename to editor/state/reducer.js index 145dbcdc969de7..6ea20a035fcffd 100644 --- a/editor/reducer.js +++ b/editor/state/reducer.js @@ -28,8 +28,8 @@ import { getBlockTypes, getBlockType } from '@wordpress/blocks'; /** * Internal dependencies */ -import withHistory from './utils/with-history'; -import withChangeDetection from './utils/with-change-detection'; +import withHistory from '../utils/with-history'; +import withChangeDetection from '../utils/with-change-detection'; import { PREFERENCES_DEFAULTS } from './store-defaults'; /*** diff --git a/editor/selectors.js b/editor/state/selectors.js similarity index 100% rename from editor/selectors.js rename to editor/state/selectors.js diff --git a/editor/store-defaults.js b/editor/state/store-defaults.js similarity index 100% rename from editor/store-defaults.js rename to editor/state/store-defaults.js diff --git a/editor/store-persist.js b/editor/state/store-persist.js similarity index 100% rename from editor/store-persist.js rename to editor/state/store-persist.js diff --git a/editor/test/actions.js b/editor/state/test/actions.js similarity index 100% rename from editor/test/actions.js rename to editor/state/test/actions.js diff --git a/editor/test/effects.js b/editor/state/test/effects.js similarity index 100% rename from editor/test/effects.js rename to editor/state/test/effects.js diff --git a/editor/test/store.js b/editor/state/test/index.js similarity index 94% rename from editor/test/store.js rename to editor/state/test/index.js index 50fc4e43efb2a7..6a9ca29e444e85 100644 --- a/editor/test/store.js +++ b/editor/state/test/index.js @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import createReduxStore from '../store'; +import createReduxStore from '../'; describe( 'store', () => { describe( 'createReduxStore()', () => { diff --git a/editor/test/reducer.js b/editor/state/test/reducer.js similarity index 100% rename from editor/test/reducer.js rename to editor/state/test/reducer.js diff --git a/editor/test/selectors.js b/editor/state/test/selectors.js similarity index 100% rename from editor/test/selectors.js rename to editor/state/test/selectors.js diff --git a/editor/test/store-persist.js b/editor/state/test/store-persist.js similarity index 100% rename from editor/test/store-persist.js rename to editor/state/test/store-persist.js diff --git a/editor/table-of-contents/index.js b/editor/table-of-contents/index.js index 15f1b5804e204f..14cab734b1c7bb 100644 --- a/editor/table-of-contents/index.js +++ b/editor/table-of-contents/index.js @@ -15,8 +15,8 @@ import { Dropdown, IconButton } from '@wordpress/components'; */ import './style.scss'; import { WordCount, DocumentOutline } from '../components'; -import { getBlocks } from '../selectors'; -import { selectBlock } from '../actions'; +import { getBlocks } from '../state/selectors'; +import { selectBlock } from '../state/actions'; function TableOfContents( { blocks } ) { const headings = filter( blocks, ( block ) => block.name === 'core/heading' );