/** * Copyright 2022 Design Barn Inc. */ import { Panel, PanelBody, SelectControl } from '@wordpress/components'; import * as React from 'react'; import { InputLabel } from '../../../components/input-label'; import { SwitchLabel } from '../../../components/switch-label'; import { IHostAppProps } from '../../../interfaces/index'; import { CURSOR_TYPES, Mode, SCROLL_TYPES } from '../../../utils/enums'; import { PanelRowWrapper } from './animation-settings'; export const InteractivitySettings: React.FC = ({ attributes, setAttributes }: IHostAppProps) => { const onChangeMode = (val: string): void => { if (val === Mode.SCROLL) { setAttributes({ interactivitymode: val, interactivitytype: 'seek' }); } else { setAttributes({ interactivitymode: val, interactivitytype: Mode.NONE }); } }; return ( onChangeMode(val)} options={[ { value: 'none', label: 'None' }, { value: 'cursor', label: 'Cursor' }, { value: 'scroll', label: 'Scroll' }, ]} /> setAttributes({ interactivitytype: val })} options={attributes.interactivitymode === Mode.SCROLL ? SCROLL_TYPES : CURSOR_TYPES} /> {attributes.interactivitymode === Mode.SCROLL && ( <> { /** */ }} /> { if (value !== '') { setAttributes({ visibilitystart: value }); } }} /> { if (value !== '') { setAttributes({ visibilityend: value }); } }} /> { if (value !== '') { setAttributes({ framesstart: value }); } }} /> { if (value !== '') { setAttributes({ framesend: value }); } }} /> )} setAttributes({ forceflag: value })} /> ); };