/** * Slide Inspector Controls Component * Matches the original SlideInspector using shared components. */ import { InspectorControls } from "@wordpress/block-editor"; import { __ } from "@wordpress/i18n"; import { PanelBody, RangeControl, TextControl, ToggleControl, } from "@wordpress/components"; import { ColorSettingsWithGradientWithToolsPanel, ColorSettingsWithToolsPanel, BackgroundImageControl, BorderControlWithToolsPanel, } from "@sliderberg/shared"; import type { SlideAttributes } from "./constants"; interface SlideInspectorProps { attributes: SlideAttributes; setAttributes: (attrs: Partial) => void; } export default function SlideInspector({ attributes, setAttributes, }: SlideInspectorProps) { const { overlayOpacity, minHeight, slideLink, slideLinkNewTab } = attributes; return ( <> setAttributes({ overlayOpacity: value ?? 0.5, }) } min={0} max={1} step={0.1} /> setAttributes({ slideLink: value })} help={__( "Clicking the slide background opens this URL. Interactive elements inside the slide are unaffected.", "sliderberg", )} /> {slideLink && ( setAttributes({ slideLinkNewTab: value })} /> )} setAttributes({ minHeight: value ?? 400, }) } min={100} max={1000} step={10} /> ); }