/** * WordPress dependencies */ import { CheckboxControl } from '@safe-wordpress/components'; import { useState } from '@safe-wordpress/element'; import { _x } from '@safe-wordpress/i18n'; import { select as doSelect, useDispatch, useSelect, } from '@safe-wordpress/data'; /** * External dependencies */ import clsx from 'clsx'; import { filter, map } from 'lodash'; import { PostSearcher } from '@nab/components'; import { createAlternative } from '@nab/utils'; import type { PostSearcherProps } from '@nab/components'; import type { Alternative, ExperimentEditProps } from '@nab/types'; // NOTE. Dependency loop with @nab package. import type { store as editorStore } from '@nab/editor'; const NAB_EDITOR = 'nab/editor' as unknown as typeof editorStore; /** * Internal dependencies */ import './style.scss'; import type { ControlAttributes as Attributes } from '../../types'; export type OriginalProps = ExperimentEditProps< Attributes > & { readonly disableExistingContentSelect?: boolean; readonly validPostFilter?: PostSearcherProps[ 'filter' ]; }; export const Original = ( { attributes, setAttributes, disableExistingContentSelect, validPostFilter, }: OriginalProps ): JSX.Element => { const isPaused = useIsPaused(); const toggleExistingContent = useExistingContentToggler( setAttributes ); return (