I use hook_field_widget_WIDGET_TYPE_form_alter() to alter the form for a single paragraph. What I do not understand is how I know which paragraph currently is edited when this hook is called. The problem: I want to change the default value for a field of the paragraph but only when no field value was set so far. So only when the paragraph gets created the default value should be changed as it is another default value when the paragraph is added within a node of a specific type.
I get the node with
$node = $build_info["callback_object"]->getEntity();
but then I do not know how to get the actually edited paragraph from here. It seems that nowhere in $form or $formState is the paragraph entity stored which is currenty edited?!