Skip to content

Commit

Permalink
Convert all public APIs to experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Nov 5, 2019
1 parent 1f1e2c7 commit 2cc172b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
6 changes: 3 additions & 3 deletions packages/blocks/src/api/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

/**
Expand Down Expand Up @@ -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 );
};

Expand All @@ -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 );
};
4 changes: 2 additions & 2 deletions packages/blocks/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand All @@ -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 ),
Expand Down
10 changes: 5 additions & 5 deletions packages/blocks/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
}

/**
Expand Down
8 changes: 4 additions & 4 deletions packages/blocks/src/store/test/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Internal dependencies
*/
import {
addBlockPatterns,
removeBlockPatterns,
__experimentalAddBlockPatterns,
__experimentalRemoveBlockPatterns,
} from '../actions';

describe( 'actions', () => {
Expand All @@ -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: [
Expand All @@ -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: [
Expand Down
10 changes: 5 additions & 5 deletions packages/blocks/src/store/test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import deepFreeze from 'deep-freeze';
* Internal dependencies
*/
import {
addBlockPatterns,
__experimentalAddBlockPatterns,
addBlockTypes,
removeBlockPatterns,
__experimentalRemoveBlockPatterns,
} from '../actions';
import {
blockPatterns,
Expand Down Expand Up @@ -168,7 +168,7 @@ describe( 'blockPatterns', () => {

const state = blockPatterns(
initialState,
addBlockPatterns( blockName, blockPattern )
__experimentalAddBlockPatterns( blockName, blockPattern )
);

expect( state ).toEqual( {
Expand All @@ -187,7 +187,7 @@ describe( 'blockPatterns', () => {

const state = blockPatterns(
initialState,
addBlockPatterns( blockName, secondBlockPattern ),
__experimentalAddBlockPatterns( blockName, secondBlockPattern ),
);

expect( state ).toEqual( {
Expand Down Expand Up @@ -233,7 +233,7 @@ describe( 'blockPatterns', () => {

const state = blockPatterns(
initialState,
removeBlockPatterns( blockName, blockPatternName )
__experimentalRemoveBlockPatterns( blockName, blockPatternName )
);

expect( state ).toEqual( {
Expand Down
1 change: 0 additions & 1 deletion packages/blocks/src/store/test/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
getChildBlockNames,
isMatchingSearchTerm,
getGroupingBlockName,

} from '../selectors';

describe( 'selectors', () => {
Expand Down

0 comments on commit 2cc172b

Please sign in to comment.