Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b795e9c
move default template types and template part areas to REST API
gigitux Oct 25, 2024
61b90b5
fix logic
gigitux Oct 25, 2024
6aaf160
fix E2E test
gigitux Nov 1, 2024
d141278
move default template types and template part areas to REST API
gigitux Nov 4, 2024
bde1d80
fix error
gigitux Nov 4, 2024
de703b5
remove not necessary file
gigitux Nov 4, 2024
f8962ce
fix naming
gigitux Nov 4, 2024
fc95c3f
remove duplicate code
gigitux Nov 4, 2024
d20b8ad
remove duplicated code
gigitux Nov 5, 2024
d361487
Merge branch 'trunk' of github.com:WordPress/gutenberg into fix/rest-…
gigitux Nov 5, 2024
afe5365
improve logic
gigitux Nov 5, 2024
ac06843
fix naming
gigitux Nov 5, 2024
69c3d6d
fix unit test
gigitux Nov 5, 2024
a5647de
update doc
gigitux Nov 5, 2024
2a04ba1
add unit test for getTemplateInfo function
gigitux Nov 5, 2024
6723634
Merge branch 'trunk' of github.com:WordPress/gutenberg into fix/rest-…
gigitux Nov 14, 2024
7241bad
restore not necessary changes
gigitux Nov 14, 2024
8f47873
fix e2e test
gigitux Nov 14, 2024
6acc708
Merge branch 'trunk' of github.com:WordPress/gutenberg into fix/rest-…
gigitux Nov 25, 2024
7aab231
remove not necessary variable
gigitux Nov 25, 2024
ffdcc1d
replace add_action with add_filter
gigitux Nov 25, 2024
e395bf6
improve readibility code
gigitux Nov 25, 2024
1f47713
make getTemplateInfo private
gigitux Nov 25, 2024
078d2f6
make templateAreas optional
gigitux Nov 25, 2024
fdc291d
add default_template_part_areas and default_template_types
gigitux Nov 25, 2024
b2c0bf5
move code to rest-api.php file
gigitux Nov 25, 2024
8f8649b
Merge branch 'trunk' of github.com:WordPress/gutenberg into fix/rest-…
gigitux Nov 26, 2024
230ba72
remove not used import
gigitux Nov 26, 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
make getTemplateInfo private
  • Loading branch information
gigitux committed Nov 25, 2024
commit 1f47713e10a01561fc78f212a73bfb9f209b6461
11 changes: 0 additions & 11 deletions packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,17 +439,6 @@ getDerivedStateFromError is used to render a fallback UI after an error has been

> **Deprecated** since 5.3, use `wp.blockEditor.getFontSizeClass` instead.

### getTemplateInfo

Helper function to retrieve the corresponding template info for a given template.

_Parameters_

- _params_ `Object`:
- _params.templateTypes_ `Array`:
- _params.templateAreas_ `Array`:
- _params.template_ `Object`:

### getTemplatePartIcon

Helper function to retrieve the corresponding icon by name.
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/document-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { decodeEntities } from '@wordpress/html-entities';
import { TEMPLATE_POST_TYPES } from '../../store/constants';
import { store as editorStore } from '../../store';
import usePageTypeBadge from '../../utils/pageTypeBadge';
import { getTemplateInfo } from '../../utils';
import { getTemplateInfo } from '../../utils/get-template-info';

/** @typedef {import("@wordpress/components").IconType} IconType */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { decodeEntities } from '@wordpress/html-entities';
*/
import { store as editorStore } from '../../store';
import { unlock } from '../../lock-unlock';
import { getTemplateInfo } from '../../utils';
import { getTemplateInfo } from '../../utils/get-template-info';

export default function EntityRecordItem( { record, checked, onChange } ) {
const { name, kind, title, key } = record;
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/post-card-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { unlock } from '../../lock-unlock';
import PostActions from '../post-actions';
import usePageTypeBadge from '../../utils/pageTypeBadge';
import { getTemplateInfo } from '../../utils';
import { getTemplateInfo } from '../../utils/get-template-info';

export default function PostCardPanel( {
postType,
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
GlobalStylesProvider,
} from './components/global-styles-provider';
import { registerCoreBlockBindingsSources } from './bindings/api';
import { getTemplateInfo } from './utils';
import { getTemplateInfo } from './utils/get-template-info';

const { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;

Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ import mediaUpload from './media-upload';
export { mediaUpload };
export { cleanForSlug } from './url.js';
export { getTemplatePartIcon } from './get-template-part-icon';
Copy link
Contributor

Choose a reason for hiding this comment

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

It's funny that we already have a getTemplatePartIcon. It must be something that is very similar no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are the same 😁, but I don't think that we can import getTemplatePartIcon from editor package in block-library package.

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, I think most of these belong in core-data but let's not focus on that for now.

export { getTemplateInfo } from './get-template-info';
Loading