/** * 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"; import ResponsiveMinHeightControl from "../../components/responsive-min-height-control"; import ResponsivePaddingControl from "../../components/responsive-padding-control"; interface SlideInspectorProps { attributes: SlideAttributes; setAttributes: (attrs: Partial) => void; } export default function SlideInspector({ attributes, setAttributes, }: SlideInspectorProps) { const { overlayOpacity, minHeight, tabletMinHeight, mobileMinHeight, 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({ [device === "desktop" ? "minHeight" : `${device}MinHeight`]: value, }) } /> ); }