@@ -99,7 +109,7 @@ function ShadowsEditor({label, placeholder, shadows: savedShadows, canCreate, on
{ __( 'Done' ) }
) }
- {canCreate &&
}
@@ -178,19 +188,22 @@ function ShadowIndicator( { label, isActive, onSelect, shadow } ) {
);
}
-function ShadowsEditorView({label, shadows}) {
+function ShadowsEditorView({label, shadows, isCustom, onChange}) {
return
{
- shadows.map( ( { name, slug, shadow } ) => (
-
+ shadows.map( ( { name, slug, shadow }, index ) => (
+ onChange(index, ({
+ name, slug,
+ shadow: updated,
+ }))} />
) )
}
}
-function ShadowEditableItem({label, shadow}) {
+function ShadowEditableItem({label, shadow, onChange, isCustom}) {
const [isEditing, setIsEditing] = useState(false);
const [ popoverAnchor, setPopoverAnchor ] = useState( null );
const popoverProps = useMemo(
@@ -208,18 +221,27 @@ function ShadowEditableItem({label, shadow}) {
-
{setIsEditing(true)}}>{label}
+
+ {
+ isCustom ?
+
{} }
+ onFocus={ () => {setIsEditing(true)} }
+ /> : {setIsEditing(true)}}>{label}
+ }
+
{
- isEditing &&