How to use the @wordpress/components.withSpokenMessages function in @wordpress/components

To help you get started, we’ve selected a few @wordpress/components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github woocommerce / woocommerce-gutenberg-products-block / assets / js / blocks / reviews / reviews-by-product / edit.js View on Github external
* The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes.
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ReviewsByProductEditor );
github woocommerce / woocommerce-gutenberg-products-block / assets / js / blocks / reviews / reviews-by-category / edit.js View on Github external
* The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes.
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ReviewsByCategoryEditor );
github php4dev / heroku-wordpress / wp-content / plugins / woo-gutenberg-products-block / assets / js / blocks / handpicked-products / block.js View on Github external
* The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ProductsBlock );
github inspireui / mstore / wordpress / wp-content / plugins / woocommerce / packages / woocommerce-blocks / assets / js / blocks / products-by-attribute / block.js View on Github external
* The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ProductsByAttributeBlock );
github DefinitelyTyped / DefinitelyTyped / types / wordpress__components / wordpress__components-tests.tsx View on Github external
(() => {
    interface Props {
        speak: any;
        debouncedSpeak: any;
        foo: string;
    }
    const MyComponentWithSpokenMessages = C.withSpokenMessages(({ speak, debouncedSpeak, foo }: Props) => (
        <div>
            <button> speak('Spoken message')}&gt;Speak</button>
            <button> debouncedSpeak('Delayed message')}&gt;Debounced Speak</button>
        </div>
    ));
    ;
})();
github WordPress / gutenberg / packages / format-library / src / link / index.native.js View on Github external
* Internal dependencies
 */
import ModalLinkUI from './modal';

const name = 'core/link';

export const link = {
	name,
	title: __( 'Link' ),
	tagName: 'a',
	className: null,
	attributes: {
		url: 'href',
		target: 'target',
	},
	edit: withSpokenMessages( class LinkEdit extends Component {
		constructor() {
			super( ...arguments );

			this.addLink = this.addLink.bind( this );
			this.stopAddingLink = this.stopAddingLink.bind( this );
			this.onRemoveFormat = this.onRemoveFormat.bind( this );
			this.state = {
				addingLink: false,
			};
		}

		addLink() {
			const { value, onChange } = this.props;
			const text = getTextContent( slice( value ) );

			if ( text && isURL( text ) ) {
github WordPress / gutenberg / packages / edit-post / src / components / visual-editor / block-inspector-button.js View on Github external
closeGeneralSidebar();
				} else {
					openGeneralSidebar( 'edit-post/block' );
					speakMessage();
					onClick();
				}
			} }
			icon="admin-generic"
			shortcut={ shortcut }
		&gt;
			{ ! small &amp;&amp; label }
		
	);
}

export default withSpokenMessages( BlockInspectorButton );
github inspireui / mstore / wordpress / wp-content / plugins / woocommerce / packages / woocommerce-blocks / assets / js / blocks / product-tag / block.js View on Github external
attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
	/**
	 * From withSpokenMessages
	 */
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ProductsByTagBlock );
github php4dev / heroku-wordpress / wp-content / plugins / woocommerce / packages / woocommerce-blocks / assets / js / blocks / attribute-filter / edit.js View on Github external
headingLevel={ headingLevel }
						heading={ heading }
						onChange={ ( value ) =&gt;
							setAttributes( { heading: value } )
						}
					/&gt;
					
						
					
				
			) }
		
	);
};

export default withSpokenMessages( Edit );
github php4dev / heroku-wordpress / wp-content / plugins / woocommerce / packages / woocommerce-blocks / assets / js / blocks / product-tag / block.js View on Github external
attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
	/**
	 * From withSpokenMessages
	 */
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ProductsByTagBlock );