I should be able to clear a singleton back to it's empty state (0.5)
As an opt-in feature, we want to add a feature to allow clearing a singleton back to it's original state. This is especially pertinent for embed widgets where there is no way to clear out a video or embed. This is taken care of for us in areas, because you can simply delete the item from the area.
If the feature is turned on via the options of the aposSingleton call, the widget will include a trashcan icon to the right, similarly to how area-item widgets display them. The trash can will delete the singleton completely from the db, and it will return to the same state it was when it was empty. If the singleton is empty, no trashcan icon will be available.
Steps to make this happen:
-Add markup for the UI to singleton.html in the apostrophe core
-Update apos.enableSingletons method in user.js to hook a delete function to the UI
-Add support for hiding the trash can when the singleton is empty
It looks like areas don't have much of an API other than "save what you know", so there's not a hook currently to clear out an item in the area, or a singleton. We will have to write this.
@benirose This feature exists for 0.6 singletons, which have been refactored to act as a special case of areas. Not sure if we'll backport this feature at this point in time.