/**
* WordPress dependencies.
*/
const {
element: {
createElement,
Fragment,
useState,
},
i18n: {
__,
},
components: {
Placeholder,
Disabled,
SandBox,
Button,
ExternalLink,
Spinner,
ToolbarGroup,
ToolbarButton,
},
compose: {
compose,
},
data: {
withSelect,
},
blockEditor: {
RichText,
BlockControls,
}
} = wp;
/**
* BuddyPress dependencies.
*/
const {
blockData: {
embedScriptURL,
}
} = bp;
const EditEmbedActivity = ( {
attributes,
setAttributes,
isSelected,
preview,
fetching
} ) => {
const { url, caption } = attributes;
const label = __( 'BuddyPress Activity URL', 'buddypress' );
const [ value, setURL ] = useState( url );
const [ isEditingURL, setIsEditingURL ] = useState( ! url );
const onSubmit = ( event ) => {
if ( event ) {
event.preventDefault();
}
setIsEditingURL( false );
setAttributes( { url: value } );
};
const switchBackToURLInput = ( event ) => {
if ( event ) {
event.preventDefault();
}
setIsEditingURL( true );
};
const editToolbar = (
{ __( 'Embedding…', 'buddypress' ) }
{ __( 'The URL you provided is not a permalink to a public BuddyPress Activity. Please use another URL.', 'buddypress' ) }