This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function() { | |
var registerBlockType = wp.blocks.registerBlockType; | |
var el = wp.element.createElement; | |
var InspectorControls = wp.blockEditor.InspectorControls; | |
var TextControl = wp.components.TextControl; | |
registerBlockType( 'test/block', { | |
title: 'Test Block', | |
icon: 'cart', | |
category: 'common', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function() { | |
var registerBlockType = wp.blocks.registerBlockType; | |
var el = wp.element.createElement; | |
var InnerBlocks = wp.editor.InnerBlocks; | |
var TextControl = wp.components.TextControl; | |
var RangeControl = wp.components.RangeControl; | |
var template = [ | |
[ 'test/child' ], | |
]; | |
var parentSelect = wp.data.withSelect( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function() { | |
var registerBlockType = wp.blocks.registerBlockType; | |
var el = wp.element.createElement; | |
var InnerBlocks = wp.editor.InnerBlocks; | |
var withSelect = wp.data.withSelect; | |
var dataSelector = withSelect( function( select, ownProps ) { | |
var getBlockOrder = select( 'core/block-editor' ).getBlockOrder; | |
return { | |
isFirstBlock: getBlockOrder().indexOf( ownProps.clientId ) === 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function() { | |
var registerBlockType = wp.blocks.registerBlockType; | |
var el = wp.element.createElement; | |
var InnerBlocks = wp.editor.InnerBlocks; | |
var __ = wp.i18n.__; | |
var TEMPLATE = [ | |
[ 'core/paragraph', { placeholder: 'Paragraph 1', customFontSize: 76 } ], | |
[ 'core/embed' ], | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( | |
blocks, | |
blockEditor, | |
element, | |
data | |
) { | |
var el = element.createElement; | |
var InnerBlocks = blockEditor.InnerBlocks; | |
blocks.registerBlockType( 'demo/demo-block', { | |
title: 'Demo', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( | |
blocks, | |
blockEditor, | |
element, | |
) { | |
var el = element.createElement; | |
var InnerBlocks = blockEditor.InnerBlocks; | |
blocks.registerBlockType( 'demo/inner-blocks', { | |
title: 'Inner Blocks Demo', | |
category: 'common', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* External dependencies | |
*/ | |
import '@babel/polyfill'; | |
/** | |
* WordPress dependencies | |
*/ | |
import '@wordpress/editor'; // This shouldn't be necessary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* External dependencies | |
*/ | |
import '@babel/polyfill'; | |
/** | |
* WordPress dependencies | |
*/ | |
import '@wordpress/editor'; // This shouldn't be necessary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const { withSelect } = wp.data; | |
const { Component } = wp.element; | |
const { compose } = wp.compose; | |
class HighlightT extends Component { | |
componentDidUpdate(prevProps) { | |
const { isTyping } = this.props; | |
if (!isTyping && prevProps.isTyping) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function() { | |
const { registerBlockType } = wp.blocks; | |
const { createElement: el } = wp.element; | |
const { InnerBlocks } = wp.editor; | |
const { __ } = wp.i18n; | |
const divProps = { className: 'product', style: { outline: '1px solid gray', padding: 5 } }; | |
const template = [ | |
[ 'core/image' ], | |
[ 'core/video' ], | |
[ 'core/cover' ], |
NewerOlder