Skip to content

Commit 117b7a0

Browse files
committed
Move duotone to duotone-filter
1 parent 930da5c commit 117b7a0

File tree

8 files changed

+14
-12
lines changed

8 files changed

+14
-12
lines changed
File renamed without changes.
File renamed without changes.

blocks/duotone/index.php renamed to blocks/duotone-filter/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
add_action( 'init', function() {
4-
register_block_type( 'a8c/duotone', [
4+
register_block_type( 'a8c/duotone-filter', [
55
'editor_script' => 'block-experiments',
66
'style' => 'block-experiments',
77
'editor_style' => 'block-experiments-editor',

blocks/duotone/src/index.js renamed to blocks/duotone-filter/src/index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,26 @@ const withDuotoneEditorControls = createHigherOrderComponent(
6666
const duotoneLight = parseColor( attributes.duotoneLight );
6767

6868
useEffect( () => {
69-
setAttributes( { duotoneId: `a8c-duotone-${ instanceId }` } );
69+
setAttributes( {
70+
duotoneId: `a8c-duotone-filter-${ instanceId }`,
71+
} );
7072
}, [ instanceId ] );
7173

7274
return (
7375
<>
7476
<InspectorControls>
7577
<PanelColorSettings
76-
title={ __( 'Duotone', 'duotone' ) }
78+
title={ __( 'Duotone', 'block-experiments' ) }
7779
initialOpen
7880
colorSettings={ [
7981
{
80-
label: __( 'Dark Color', 'duotone' ),
82+
label: __( 'Dark Color', 'block-experiments' ),
8183
value: attributes.duotoneDark,
8284
onChange: ( duotoneDark ) =>
8385
setAttributes( { duotoneDark } ),
8486
},
8587
{
86-
label: __( 'Light Color', 'duotone' ),
88+
label: __( 'Light Color', 'block-experiments' ),
8789
value: attributes.duotoneLight,
8890
onChange: ( duotoneLight ) =>
8991
setAttributes( { duotoneLight } ),
@@ -151,17 +153,17 @@ function addDuotoneFilterStyle( props, block, attributes ) {
151153
export function registerBlock() {
152154
addFilter(
153155
'editor.BlockEdit',
154-
'a8c/duotone/with-editor-controls',
156+
'a8c/duotone-filter/with-editor-controls',
155157
withDuotoneEditorControls
156158
);
157159
addFilter(
158160
'blocks.registerBlockType',
159-
'a8c/duotone/add-attributes',
161+
'a8c/duotone-filter/add-attributes',
160162
withDuotoneAttributes
161163
);
162164
addFilter(
163165
'blocks.getSaveContent.extraProps',
164-
'a8c/duotone/add-filter-style',
166+
'a8c/duotone-filter/add-filter-style',
165167
addDuotoneFilterStyle
166168
);
167169
}
File renamed without changes.

editor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Import editor styles for blocks
22
@import './blocks/bauhaus-centenary/editor.scss';
3-
@import './blocks/duotone/editor.scss';
3+
@import './blocks/duotone-filter/editor.scss';
44
@import './blocks/event/editor.scss';
55
@import './blocks/layout-grid/editor.scss';
66
@import './blocks/motion-background/editor.scss';

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ setCategories( [
2323
* Load all our blocks
2424
*/
2525
import * as bauhausCentenaryBlock from '../blocks/bauhaus-centenary/src';
26-
import * as duotoneBlock from '../blocks/duotone/src';
26+
import * as duotoneFilter from '../blocks/duotone-filter/src';
2727
import * as eventBlock from '../blocks/event/src';
2828
import * as layoutGridBlock from '../blocks/layout-grid/src';
2929
import * as motionBackgroundBlock from '../blocks/motion-background/src';
@@ -32,7 +32,7 @@ import * as wavesBlock from '../blocks/waves/src';
3232

3333
// Instantiate the blocks, adding them to our block category
3434
bauhausCentenaryBlock.registerBlock();
35-
duotoneBlock.registerBlock();
35+
duotoneFilter.registerBlock();
3636
eventBlock.registerBlock();
3737
layoutGridBlock.registerBlock();
3838
motionBackgroundBlock.registerBlock();

style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Import front end styles for blocks */
22
@import './blocks/bauhaus-centenary/style.scss';
3-
@import './blocks/duotone/style.scss';
3+
@import './blocks/duotone-filter/style.scss';
44
@import './blocks/event/style.scss';
55
@import './blocks/layout-grid/style.scss';
66
@import './blocks/motion-background/style.scss';

0 commit comments

Comments
 (0)