diff --git a/packages/blocks/src/api/registration.js b/packages/blocks/src/api/registration.js index 7770d59bfd46e..0149b91c3929c 100644 --- a/packages/blocks/src/api/registration.js +++ b/packages/blocks/src/api/registration.js @@ -98,7 +98,7 @@ import { DEPRECATED_ENTRY_KEYS } from './constants'; * @property {WPComponent} edit Component rendering an element to * manipulate the attributes of a block * in the context of an editor. - * @property {WPBlockPattern[]} patterns + * @property {WPBlockPattern[]} [patterns] The list of block patterns. */ /** @@ -465,7 +465,7 @@ export const unregisterBlockStyle = ( blockName, styleVariationName ) => { * @param {string} blockName Name of the block (example: “core/columns”). * @param {WPBlockPattern} pattern Object describing a block pattern. */ -export const registerBlockPattern = ( blockName, pattern ) => { +export const __experimentalRegisterBlockPattern = ( blockName, pattern ) => { dispatch( 'core/blocks' ).addBlockPatterns( blockName, pattern ); }; @@ -475,6 +475,6 @@ export const registerBlockPattern = ( blockName, pattern ) => { * @param {string} blockName Name of the block (example: “core/columns”). * @param {string} patternName Name of the pattern defined for the block. */ -export const unregisterBlockPattern = ( blockName, patternName ) => { +export const __experimentalUnregisterBlockPattern = ( blockName, patternName ) => { dispatch( 'core/blocks' ).removeBlockPatterns( blockName, patternName ); }; diff --git a/packages/blocks/src/store/actions.js b/packages/blocks/src/store/actions.js index b321b3beded5b..c7b6ae42cb81b 100644 --- a/packages/blocks/src/store/actions.js +++ b/packages/blocks/src/store/actions.js @@ -71,7 +71,7 @@ export function removeBlockStyles( blockName, styleNames ) { * * @return {Object} Action object. */ -export function addBlockPatterns( blockName, patterns ) { +export function __experimentalAddBlockPatterns( blockName, patterns ) { return { type: 'ADD_BLOCK_PATTERNS', patterns: castArray( patterns ), @@ -87,7 +87,7 @@ export function addBlockPatterns( blockName, patterns ) { * * @return {Object} Action object. */ -export function removeBlockPatterns( blockName, patternNames ) { +export function __experimentalRemoveBlockPatterns( blockName, patternNames ) { return { type: 'REMOVE_BLOCK_PATTERNS', patternNames: castArray( patternNames ), diff --git a/packages/blocks/src/store/selectors.js b/packages/blocks/src/store/selectors.js index 84540bb40c757..bf005a28499bb 100644 --- a/packages/blocks/src/store/selectors.js +++ b/packages/blocks/src/store/selectors.js @@ -60,13 +60,13 @@ export function getBlockStyles( state, name ) { /** * Returns block patterns by block name. * - * @param {Object} state Data state. - * @param {string} name Block type name. + * @param {Object} state Data state. + * @param {string} blockName Block type name. * - * @return {WPBlockPattern[]} Block Styles. + * @return {?(WPBlockPattern[])} Block patterns. */ -export function getBlockPattens( state, name ) { - return state.blockPatterns[ name ]; +export function __experimentalGetBlockPattens( state, blockName ) { + return state.blockPatterns[ blockName ]; } /** diff --git a/packages/blocks/src/store/test/actions.js b/packages/blocks/src/store/test/actions.js index 40cef33ed2911..9e537432f406a 100644 --- a/packages/blocks/src/store/test/actions.js +++ b/packages/blocks/src/store/test/actions.js @@ -2,8 +2,8 @@ * Internal dependencies */ import { - addBlockPatterns, - removeBlockPatterns, + __experimentalAddBlockPatterns, + __experimentalRemoveBlockPatterns, } from '../actions'; describe( 'actions', () => { @@ -19,7 +19,7 @@ describe( 'actions', () => { example: 'foo', }, }; - const result = addBlockPatterns( blockName, pattern ); + const result = __experimentalAddBlockPatterns( blockName, pattern ); expect( result ).toEqual( { type: 'ADD_BLOCK_PATTERNS', patterns: [ @@ -30,7 +30,7 @@ describe( 'actions', () => { } ); it( 'should return the REMOVE_BLOCK_PATTERNS action', () => { - const result = removeBlockPatterns( blockName, patternName ); + const result = __experimentalRemoveBlockPatterns( blockName, patternName ); expect( result ).toEqual( { type: 'REMOVE_BLOCK_PATTERNS', patternNames: [ diff --git a/packages/blocks/src/store/test/reducer.js b/packages/blocks/src/store/test/reducer.js index f7b0f1946daa9..2567903962d14 100644 --- a/packages/blocks/src/store/test/reducer.js +++ b/packages/blocks/src/store/test/reducer.js @@ -7,9 +7,9 @@ import deepFreeze from 'deep-freeze'; * Internal dependencies */ import { - addBlockPatterns, + __experimentalAddBlockPatterns, addBlockTypes, - removeBlockPatterns, + __experimentalRemoveBlockPatterns, } from '../actions'; import { blockPatterns, @@ -168,7 +168,7 @@ describe( 'blockPatterns', () => { const state = blockPatterns( initialState, - addBlockPatterns( blockName, blockPattern ) + __experimentalAddBlockPatterns( blockName, blockPattern ) ); expect( state ).toEqual( { @@ -187,7 +187,7 @@ describe( 'blockPatterns', () => { const state = blockPatterns( initialState, - addBlockPatterns( blockName, secondBlockPattern ), + __experimentalAddBlockPatterns( blockName, secondBlockPattern ), ); expect( state ).toEqual( { @@ -233,7 +233,7 @@ describe( 'blockPatterns', () => { const state = blockPatterns( initialState, - removeBlockPatterns( blockName, blockPatternName ) + __experimentalRemoveBlockPatterns( blockName, blockPatternName ) ); expect( state ).toEqual( { diff --git a/packages/blocks/src/store/test/selectors.js b/packages/blocks/src/store/test/selectors.js index 493cd15af4d1d..05fc5a23040a8 100644 --- a/packages/blocks/src/store/test/selectors.js +++ b/packages/blocks/src/store/test/selectors.js @@ -5,7 +5,6 @@ import { getChildBlockNames, isMatchingSearchTerm, getGroupingBlockName, - } from '../selectors'; describe( 'selectors', () => {