PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 2.2.0
GenerateBlocks v2.2.0
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / blocks / query / components / BlockSettings.jsx
generateblocks / src / blocks / query / components Last commit date
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
71 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 import { useBlockStyles } from '@hooks/useBlockStyles';
10
11 export function BlockSettings( {
12 onStyleChange,
13 getStyleValue,
14 name,
15 attributes,
16 setAttributes,
17 context,
18 } ) {
19 const panelProps = {
20 name,
21 attributes,
22 setAttributes,
23 getStyleValue,
24 onStyleChange,
25 };
26
27 const {
28 tagName,
29 } = attributes;
30
31 const {
32 atRule,
33 } = useBlockStyles();
34
35 return (
36 <ApplyFilters
37 name="generateblocks.editor.blockControls"
38 blockName={ name }
39 onStyleChange={ onStyleChange }
40 getStyleValue={ getStyleValue }
41 attributes={ attributes }
42 setAttributes={ setAttributes }
43 >
44 <OpenPanel
45 { ...panelProps }
46 panelId="query-parameters"
47 >
48 <QueryInspectorControls
49 attributes={ attributes }
50 setAttributes={ setAttributes }
51 context={ context }
52 />
53 </OpenPanel>
54 <OpenPanel
55 { ...panelProps }
56 panelId="settings"
57 >
58 { '' === atRule && (
59 <TagNameControl
60 blockName="generateblocks/query"
61 value={ tagName }
62 onChange={ ( value ) => {
63 setAttributes( { tagName: value } );
64 } }
65 />
66 ) }
67 </OpenPanel>
68 </ApplyFilters>
69 );
70 }
71