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

Move duplicateTemplatePart action to the @wordpress/fields package #65390

Merged
merged 53 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
67ff043
Migrate store and actions from editor package to fields package
gigitux Sep 12, 2024
a71e726
fix documentation
gigitux Sep 12, 2024
0141d8c
fix import
gigitux Sep 12, 2024
f21a974
remove duplicate code
gigitux Sep 12, 2024
7063ee8
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Sep 12, 2024
644dab1
update package-lock
gigitux Sep 12, 2024
3616964
refactor PR
gigitux Sep 12, 2024
f7f1d4d
fix mobile build
gigitux Sep 12, 2024
ae0efeb
update package.json
gigitux Sep 12, 2024
4356a42
migrate actions to @wordpress/fields package
gigitux Sep 12, 2024
bf1462a
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Sep 12, 2024
63adf35
reduce change
gigitux Sep 13, 2024
c938a15
register new action
gigitux Sep 13, 2024
66479da
improve code
gigitux Sep 13, 2024
0bf760d
fix actionId
gigitux Sep 13, 2024
08bb03d
update package-lock.json
gigitux Sep 13, 2024
b599c42
remove comment
gigitux Sep 13, 2024
337b3e5
rename function
gigitux Sep 13, 2024
1016ef8
rename functions
gigitux Sep 13, 2024
39d25d1
improve code
gigitux Sep 13, 2024
dc03f57
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Sep 16, 2024
599c0a4
Migrate duplicate-template-part action to @wordpress/fields package
gigitux Sep 17, 2024
60e7a58
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Sep 17, 2024
81c0980
fix build
gigitux Sep 17, 2024
7b2bb82
restore files
gigitux Sep 17, 2024
d6fcf4a
fix CSS
gigitux Sep 17, 2024
0316536
restore delete post action
gigitux Sep 18, 2024
485237f
fix import order
gigitux Sep 18, 2024
5a4fb59
move to a flat structure
gigitux Sep 18, 2024
0deeed3
remove not necessary file
gigitux Sep 18, 2024
d42430d
Merge branch 'add/action-dataviews-2' of github.com:gigitux/gutenberg…
gigitux Sep 19, 2024
400a67d
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Sep 25, 2024
18d6029
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Oct 1, 2024
ff299b6
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Oct 24, 2024
36adb07
regenerate package-lock.json file
gigitux Oct 24, 2024
47da440
generate documentation
gigitux Oct 24, 2024
64423cf
delete constant file
gigitux Oct 24, 2024
199c313
update class
gigitux Oct 25, 2024
8571360
rename styles.scss to style.scss
gigitux Oct 25, 2024
844a98a
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Oct 28, 2024
0bd24a7
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Nov 1, 2024
00533bd
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Nov 26, 2024
13ea482
restore changes
gigitux Nov 26, 2024
6dede40
fix comment
gigitux Nov 26, 2024
63247d0
fix comment
gigitux Nov 26, 2024
3b6b664
improve documentation
gigitux Nov 26, 2024
8857196
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Nov 27, 2024
084383c
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Dec 2, 2024
4583cf8
export only CreateTemplatePartModal component
gigitux Dec 2, 2024
02da400
Merge branch 'add/action-dataviews-3' of github.com:gigitux/gutenberg…
gigitux Dec 2, 2024
e0f518e
restore not necessary changes
gigitux Dec 2, 2024
b9fb6f3
export only needed types
gigitux Dec 3, 2024
bb1f366
fix fallback value
gigitux Dec 3, 2024
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
Prev Previous commit
Next Next commit
fix build
  • Loading branch information
gigitux committed Sep 17, 2024
commit 81c0980bfc91ab140e4eaf2865b10039413ae8de
24 changes: 24 additions & 0 deletions packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,18 @@ _Returns_

Undocumented declaration.

### registerEntityAction

Registers a new DataViews action.

This is an experimental API and is subject to change. it's only available in the Gutenberg plugin for now.

_Parameters_

- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _config_ `Action`: Action configuration.

### RichText

> **Deprecated** since 5.3, use `wp.blockEditor.RichText` instead.
Expand Down Expand Up @@ -1682,6 +1694,18 @@ _Returns_

Undocumented declaration.

### unregisterEntityAction

Unregisters a DataViews action.

This is an experimental API and is subject to change. it's only available in the Gutenberg plugin for now.

_Parameters_

- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _actionId_ `string`: Action ID.

### UnsavedChangesWarning

Warns the user if there are unsaved changes before leaving the editor. Compatible with Post Editor and Site Editor.
Expand Down
55 changes: 55 additions & 0 deletions packages/editor/src/dataviews/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* WordPress dependencies
*/
import { dispatch } from '@wordpress/data';

/**
* Internal dependencies
*/
import { unlock } from '../lock-unlock';
import { store as editorStore } from '../store';

/**
* @typedef {import('@wordpress/dataviews').Action} Action
*/

/**
* Registers a new DataViews action.
*
* This is an experimental API and is subject to change.
* it's only available in the Gutenberg plugin for now.
*
* @param {string} kind Entity kind.
* @param {string} name Entity name.
* @param {Action} config Action configuration.
*/

export function registerEntityAction( kind, name, config ) {
const { registerEntityAction: _registerEntityAction } = unlock(
dispatch( editorStore )
);

if ( globalThis.IS_GUTENBERG_PLUGIN ) {
_registerEntityAction( kind, name, config );
}
}

/**
* Unregisters a DataViews action.
*
* This is an experimental API and is subject to change.
* it's only available in the Gutenberg plugin for now.
*
* @param {string} kind Entity kind.
* @param {string} name Entity name.
* @param {string} actionId Action ID.
*/
export function unregisterEntityAction( kind, name, actionId ) {
const { unregisterEntityAction: _unregisterEntityAction } = unlock(
dispatch( editorStore )
);

if ( globalThis.IS_GUTENBERG_PLUGIN ) {
_unregisterEntityAction( kind, name, actionId );
}
}
1 change: 1 addition & 0 deletions packages/editor/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export { storeConfig, store } from './store';
export * from './components';
export * from './utils';
export * from './private-apis';
export * from './dataviews/api';

/*
* Backward compatibility
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
@import "./components/autocompleters/style.scss";
@import "./components/block-manager/style.scss";
@import "./components/collapsible-block-toolbar/style.scss";
@import "./components/create-template-part-modal/style.scss";
@import "./components/block-settings-menu/style.scss";
@import "./components/blog-title/style.scss";
@import "./components/document-bar/style.scss";
Expand Down