Compare commits
No commits in common. "913fee95772397dbfe2b0c6933e21d34656517eb" and "c032afc07ae3460eddd21337c03ec955bf60dc8a" have entirely different histories.
913fee9577
...
c032afc07a
64
src/index.js
64
src/index.js
|
@ -15,23 +15,12 @@ import {
|
|||
Toolbar,
|
||||
ToolbarButton,
|
||||
PanelBody,
|
||||
PanelRow,
|
||||
} from '@wordpress/components';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
registerBlockType('room-vw/iconify', {
|
||||
title: __('Iconify', 'room-vw'),
|
||||
icon: (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
d="M12 19.5c3.75 0 7.159-3.379 6.768-4.125c-.393-.75-2.268 1.875-6.768 1.875s-6-2.625-6.375-1.875S8.25 19.5 12 19.5zm4.125-12c.623 0 1.125.502 1.125 1.125v1.5c0 .623-.502 1.125-1.125 1.125A1.123 1.123 0 0 1 15 10.125v-1.5c0-.623.502-1.125 1.125-1.125zm-8.25 0C8.498 7.5 9 8.002 9 8.625v1.5c0 .623-.502 1.125-1.125 1.125a1.123 1.123 0 0 1-1.125-1.125v-1.5c0-.623.502-1.125 1.125-1.125zM12 0C5.381 0 0 5.381 0 12s5.381 12 12 12s12-5.381 12-12S18.619 0 12 0zm0 1.5c5.808 0 10.5 4.692 10.5 10.5S17.808 22.5 12 22.5S1.5 17.808 1.5 12S6.192 1.5 12 1.5z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
title: __('Iconify Icon', 'room-vw'),
|
||||
|
||||
category: 'room-vw',
|
||||
|
||||
|
@ -111,7 +100,7 @@ registerBlockType('room-vw/iconify', {
|
|||
return (
|
||||
<Fragment>
|
||||
<InspectorControls>
|
||||
<PanelBody title="Icon size">
|
||||
<PanelBody title="Icon settings">
|
||||
<RangeControl
|
||||
label={`Font size (${attributes.fontUnit})`}
|
||||
value={attributes.fontSize}
|
||||
|
@ -122,31 +111,28 @@ registerBlockType('room-vw/iconify', {
|
|||
setAttributes({ fontSize: value });
|
||||
}}
|
||||
/>
|
||||
<ToggleControl
|
||||
label="Use ems"
|
||||
checked={attributes.fontUnit === 'em'}
|
||||
onChange={(state) => {
|
||||
setAttributes({
|
||||
fontUnit: state ? 'em' : 'px',
|
||||
fontSize: state
|
||||
? attributes.fontSize / 16
|
||||
: attributes.fontSize * 16,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</PanelBody>
|
||||
<PanelBody title="Icon variations">
|
||||
<ToggleControl
|
||||
label="Inline"
|
||||
checked={attributes.isInline}
|
||||
onChange={(state) => {
|
||||
setAttributes({ isInline: state });
|
||||
}}
|
||||
/>
|
||||
<p>Color</p>
|
||||
<p>Rotate</p>
|
||||
<p>Flip</p>
|
||||
<p>Etc</p>
|
||||
<PanelRow></PanelRow>
|
||||
<PanelRow>
|
||||
<ToggleControl
|
||||
label="Is isInline"
|
||||
checked={attributes.isInline}
|
||||
onChange={(state) => {
|
||||
setAttributes({ isInline: state });
|
||||
}}
|
||||
/>
|
||||
<ToggleControl
|
||||
label="Use ems"
|
||||
checked={attributes.fontUnit === 'em'}
|
||||
onChange={(state) => {
|
||||
setAttributes({
|
||||
fontUnit: state ? 'em' : 'px',
|
||||
fontSize: state
|
||||
? attributes.fontSize / 16
|
||||
: attributes.fontSize * 16,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</PanelRow>
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
|
||||
|
|
Loading…
Reference in New Issue