AddQueryParameterButton.jsx
1 year ago
BlockSettings.jsx
1 year ago
ControlBuilder.jsx
1 year ago
DateQueryControl.jsx
1 year ago
DateTimeControl.jsx
1 year ago
ParameterControl.jsx
1 year ago
ParameterList.jsx
1 year ago
QueryInspectorControls.jsx
1 year ago
SelectQueryParameter.jsx
1 year ago
TaxonomyParameterControl.jsx
1 year ago
editor.scss
1 year ago
BlockSettings.jsx
60 lines
| 1 | import { OpenPanel } from '@edge22/components'; |
| 2 | |
| 3 | import { |
| 4 | ApplyFilters, |
| 5 | TagNameControl, |
| 6 | } from '@components/index.js'; |
| 7 | |
| 8 | import { QueryInspectorControls } from './QueryInspectorControls'; |
| 9 | |
| 10 | export function BlockSettings( { |
| 11 | onStyleChange, |
| 12 | name, |
| 13 | attributes, |
| 14 | setAttributes, |
| 15 | context, |
| 16 | } ) { |
| 17 | const panelProps = { |
| 18 | name, |
| 19 | attributes, |
| 20 | setAttributes, |
| 21 | }; |
| 22 | |
| 23 | const { |
| 24 | tagName, |
| 25 | } = attributes; |
| 26 | |
| 27 | return ( |
| 28 | <ApplyFilters |
| 29 | name="generateblocks.editor.blockControls" |
| 30 | blockName={ name } |
| 31 | onStyleChange={ onStyleChange } |
| 32 | attributes={ attributes } |
| 33 | setAttributes={ setAttributes } |
| 34 | > |
| 35 | <OpenPanel |
| 36 | { ...panelProps } |
| 37 | panelId="query-parameters" |
| 38 | > |
| 39 | <QueryInspectorControls |
| 40 | attributes={ attributes } |
| 41 | setAttributes={ setAttributes } |
| 42 | context={ context } |
| 43 | /> |
| 44 | </OpenPanel> |
| 45 | <OpenPanel |
| 46 | { ...panelProps } |
| 47 | panelId="settings" |
| 48 | > |
| 49 | <TagNameControl |
| 50 | blockName="generateblocks/query" |
| 51 | value={ tagName } |
| 52 | onChange={ ( value ) => { |
| 53 | setAttributes( { tagName: value } ); |
| 54 | } } |
| 55 | /> |
| 56 | </OpenPanel> |
| 57 | </ApplyFilters> |
| 58 | ); |
| 59 | } |
| 60 |