Skip to content

Commit

Permalink
Migrate store and actions from editor package to fields package #2 (#…
Browse files Browse the repository at this point in the history
…65289)

Co-authored-by: gigitux <gigitux@git.wordpress.org>
Co-authored-by: louwie17 <louwie17@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>
  • Loading branch information
5 people authored Sep 25, 2024
1 parent 69e00bd commit cb44f51
Show file tree
Hide file tree
Showing 31 changed files with 755 additions and 326 deletions.
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 0 additions & 109 deletions packages/editor/src/dataviews/actions/delete-post.tsx

This file was deleted.

147 changes: 0 additions & 147 deletions packages/editor/src/dataviews/actions/reset-post.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions packages/editor/src/dataviews/fields/index.ts

This file was deleted.

14 changes: 7 additions & 7 deletions packages/editor/src/dataviews/store/private-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import { doAction } from '@wordpress/hooks';
/**
* Internal dependencies
*/
import duplicateTemplatePart from '../actions/duplicate-template-part';
import resetPost from '../actions/reset-post';
import trashPost from '../actions/trash-post';
import renamePost from '../actions/rename-post';
import restorePost from '../actions/restore-post';
import type { PostType } from '../types';
import { store as editorStore } from '../../store';
import { unlock } from '../../lock-unlock';
Expand All @@ -24,8 +19,13 @@ import {
reorderPage,
exportPattern,
permanentlyDeletePost,
restorePost,
trashPost,
renamePost,
resetPost,
deletePost,
} from '@wordpress/fields';
import deletePost from '../actions/delete-post';
import duplicateTemplatePart from '../actions/duplicate-template-part';

export function registerEntityAction< Item >(
kind: string,
Expand Down Expand Up @@ -117,8 +117,8 @@ export const registerPostTypeActions =
? reorderPage
: undefined,
postTypeConfig.slug === 'wp_block' ? exportPattern : undefined,
resetPost,
restorePost,
resetPost,
deletePost,
trashPost,
permanentlyDeletePost,
Expand Down
20 changes: 20 additions & 0 deletions packages/fields/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ npm install @wordpress/fields --save

<!-- START TOKEN(Autogenerated API docs) -->

### deletePost

Undocumented declaration.

### duplicatePattern

Undocumented declaration.
Expand Down Expand Up @@ -42,6 +46,10 @@ Undocumented declaration.

Undocumented declaration.

### renamePost

Undocumented declaration.

### reorderPage

Undocumented declaration.
Expand All @@ -50,10 +58,22 @@ Undocumented declaration.

Undocumented declaration.

### resetPost

Undocumented declaration.

### restorePost

Undocumented declaration.

### titleField

Undocumented declaration.

### trashPost

Undocumented declaration.

### viewPost

Undocumented declaration.
Expand Down
1 change: 1 addition & 0 deletions packages/fields/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
],
"dependencies": {
"@babel/runtime": "^7.16.0",
"@wordpress/api-fetch": "file:../api-fetch",
"@wordpress/blob": "file:../blob",
"@wordpress/blocks": "file:../blocks",
"@wordpress/components": "file:../components",
Expand Down
5 changes: 0 additions & 5 deletions packages/fields/src/actions/base-post/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/fields/src/actions/common/index.ts

This file was deleted.

Loading

0 comments on commit cb44f51

Please sign in to comment.