PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.3
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.3
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / extend / display / index.js

index.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.3, at gutenberg/extend/display/index.js

66 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import './screenSize';
2
3 import { InspectorControls } from '@wordpress/block-editor';
4 import { hasBlockSupport } from '@wordpress/blocks';
5 import {
6 __experimentalToolsPanel as ExperimentalToolsPanel,
7 __stableToolsPanel as StableToolsPanel,
8 } from '@wordpress/components';
9 import { addFilter } from '@wordpress/hooks';
10 import { __ } from '@wordpress/i18n';
11
12 import ApplyFilters from '../../components/apply-filters';
13 import getIcon from '../../utils/get-icon';
14
15 const ToolsPanel = StableToolsPanel || ExperimentalToolsPanel;
16
17 /**
18 * Add inspector controls.
19 *
20 * @param original
21 * @param root0
22 * @param root0.props
23 */
24 function GhostKitExtensionDisplayInspector(original, { props }) {
25 const { name } = props;
26
27 const hasDisplaySupport = hasBlockSupport(name, ['ghostkit', 'display']);
28
29 if (!hasDisplaySupport) {
30 return original;
31 }
32
33 return (
34 <>
35 {original}
36 <InspectorControls group="styles">
37 <ToolsPanel
38 label={
39 <>
40 <span className="ghostkit-ext-icon">
41 {getIcon('extension-display')}
42 </span>
43 <span>{__('Display Conditions', 'ghostkit')}</span>
44 </>
45 }
46 >
47 <div className="ghostkit-tools-panel-display">
48 <ApplyFilters
49 name="ghostkit.extension.display.tools"
50 props={props}
51 />
52 </div>
53 </ToolsPanel>
54 </InspectorControls>
55 </>
56 );
57 }
58
59 // Init filters.
60 addFilter(
61 'ghostkit.editor.extensions',
62 'ghostkit/extension/display/inspector',
63 GhostKitExtensionDisplayInspector,
64 17
65 );
66