1 | import { createElement } from "@wordpress/element";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import { __ } from '@wordpress/i18n';
|
7 | import { Fragment } from '@wordpress/element';
|
8 | import { IconButton, Toolbar, PanelBody, ToggleControl } from '@wordpress/components';
|
9 | import { BlockControls, InspectorControls } from '@wordpress/block-editor';
|
10 |
|
11 | var EmbedControls = function EmbedControls(props) {
|
12 | var blockSupportsResponsive = props.blockSupportsResponsive,
|
13 | showEditButton = props.showEditButton,
|
14 | themeSupportsResponsive = props.themeSupportsResponsive,
|
15 | allowResponsive = props.allowResponsive,
|
16 | getResponsiveHelp = props.getResponsiveHelp,
|
17 | toggleResponsive = props.toggleResponsive,
|
18 | switchBackToURLInput = props.switchBackToURLInput;
|
19 | return createElement(Fragment, null, createElement(BlockControls, null, createElement(Toolbar, null, showEditButton && createElement(IconButton, {
|
20 | className: "components-toolbar__control",
|
21 | label: __('Edit URL'),
|
22 | icon: "edit",
|
23 | onClick: switchBackToURLInput
|
24 | }))), themeSupportsResponsive && blockSupportsResponsive && createElement(InspectorControls, null, createElement(PanelBody, {
|
25 | title: __('Media Settings'),
|
26 | className: "blocks-responsive"
|
27 | }, createElement(ToggleControl, {
|
28 | label: __('Resize for smaller devices'),
|
29 | checked: allowResponsive,
|
30 | help: getResponsiveHelp,
|
31 | onChange: toggleResponsive
|
32 | }))));
|
33 | };
|
34 |
|
35 | export default EmbedControls;
|
36 |
|
\ | No newline at end of file |