[composer] Create base item widget class for composer items, clean up and remove duplicate code