[Product Block editor]: rename component edit function (#41741)
This commit is contained in:
commit
bc9e2118c7
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: tweak
|
||||||
|
|
||||||
|
[Product Block editor]: rename component edit function
|
|
@ -18,11 +18,12 @@ import { sanitizeHTML } from '../../../utils/sanitize-html';
|
||||||
import { SectionBlockAttributes } from './types';
|
import { SectionBlockAttributes } from './types';
|
||||||
import { ProductEditorBlockEditProps } from '../../../types';
|
import { ProductEditorBlockEditProps } from '../../../types';
|
||||||
|
|
||||||
export function Edit( {
|
export function SectionBlockEdit( {
|
||||||
attributes,
|
attributes,
|
||||||
clientId,
|
clientId,
|
||||||
}: ProductEditorBlockEditProps< SectionBlockAttributes > ) {
|
}: ProductEditorBlockEditProps< SectionBlockAttributes > ) {
|
||||||
const { description, title, blockGap } = attributes;
|
const { description, title, blockGap } = attributes;
|
||||||
|
|
||||||
const blockProps = useWooBlockProps( attributes );
|
const blockProps = useWooBlockProps( attributes );
|
||||||
const innerBlockProps = useInnerBlocksProps(
|
const innerBlockProps = useInnerBlocksProps(
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { registerProductEditorBlockType } from '../../../utils';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import blockConfiguration from './block.json';
|
import blockConfiguration from './block.json';
|
||||||
import { Edit } from './edit';
|
import { SectionBlockEdit } from './edit';
|
||||||
|
|
||||||
const { name, ...metadata } = blockConfiguration;
|
const { name, ...metadata } = blockConfiguration;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ export { metadata, name };
|
||||||
|
|
||||||
export const settings = {
|
export const settings = {
|
||||||
example: {},
|
example: {},
|
||||||
edit: Edit,
|
edit: SectionBlockEdit,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function init() {
|
export function init() {
|
||||||
|
|
|
@ -19,7 +19,7 @@ export interface TabBlockAttributes extends BlockAttributes {
|
||||||
isSelected?: boolean;
|
isSelected?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Edit( {
|
export function TabBlockEdit( {
|
||||||
setAttributes,
|
setAttributes,
|
||||||
attributes,
|
attributes,
|
||||||
context,
|
context,
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { registerProductEditorBlockType } from '../../../utils';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import blockConfiguration from './block.json';
|
import blockConfiguration from './block.json';
|
||||||
import { Edit } from './edit';
|
import { TabBlockEdit } from './edit';
|
||||||
|
|
||||||
const { name, ...metadata } = blockConfiguration;
|
const { name, ...metadata } = blockConfiguration;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ export { metadata, name };
|
||||||
|
|
||||||
export const settings = {
|
export const settings = {
|
||||||
example: {},
|
example: {},
|
||||||
edit: Edit,
|
edit: TabBlockEdit,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function init() {
|
export function init() {
|
||||||
|
|
|
@ -46,7 +46,7 @@ function clearDescriptionIfEmpty( blocks: BlockInstance[] ) {
|
||||||
return blocks;
|
return blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Edit( {
|
export function DescriptionBlockEdit( {
|
||||||
attributes,
|
attributes,
|
||||||
}: ProductEditorBlockEditProps< BlockAttributes > ) {
|
}: ProductEditorBlockEditProps< BlockAttributes > ) {
|
||||||
const blockProps = useWooBlockProps( attributes );
|
const blockProps = useWooBlockProps( attributes );
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import blockConfiguration from './block.json';
|
import blockConfiguration from './block.json';
|
||||||
import { Edit } from './edit';
|
import { DescriptionBlockEdit } from './edit';
|
||||||
import { registerProductEditorBlockType } from '../../../utils';
|
import { registerProductEditorBlockType } from '../../../utils';
|
||||||
|
|
||||||
const { name, ...metadata } = blockConfiguration;
|
const { name, ...metadata } = blockConfiguration;
|
||||||
|
@ -11,7 +11,7 @@ export { metadata, name };
|
||||||
|
|
||||||
export const settings = {
|
export const settings = {
|
||||||
example: {},
|
example: {},
|
||||||
edit: Edit,
|
edit: DescriptionBlockEdit,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const init = () =>
|
export const init = () =>
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { useState } from '@wordpress/element';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { Tabs } from '../';
|
import { Tabs } from '../';
|
||||||
import { Edit as Tab } from '../../../blocks/generic/tab/edit';
|
import { TabBlockEdit as Tab } from '../../../blocks/generic/tab/edit';
|
||||||
|
|
||||||
jest.mock( '@woocommerce/block-templates', () => ( {
|
jest.mock( '@woocommerce/block-templates', () => ( {
|
||||||
...jest.requireActual( '@woocommerce/block-templates' ),
|
...jest.requireActual( '@woocommerce/block-templates' ),
|
||||||
|
|
Loading…
Reference in New Issue