UNPKG

@wordpress/components

Version:
8 lines (7 loc) 1.15 kB
{ "version": 3, "sources": ["../../../src/higher-order/with-spoken-messages/index.tsx"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * A Higher Order Component used to provide speak and debounced speak functions.\n *\n * @see https://developer.wordpress.org/block-editor/packages/packages-a11y/#speak\n *\n * @param {React.ComponentType} Component The component to be wrapped.\n *\n * @return {React.ComponentType} The wrapped component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createHigherOrderComponent(Component => function WithSpokenMessages(props) {\n return /*#__PURE__*/_jsx(Component, {\n ...props,\n speak: speak,\n debouncedSpeak: useDebounce(speak, 500)\n });\n}, 'withSpokenMessages');"], "mappings": ";AAGA,SAAS,4BAA4B,mBAAmB;AACxD,SAAS,aAAa;AAWtB,SAAS,OAAO,YAAY;AAC5B,IAAO,+BAAQ,2BAA2B,eAAa,SAAS,mBAAmB,OAAO;AACxF,SAAoB,qBAAK,WAAW;AAAA,IAClC,GAAG;AAAA,IACH;AAAA,IACA,gBAAgB,YAAY,OAAO,GAAG;AAAA,EACxC,CAAC;AACH,GAAG,oBAAoB;", "names": [] }