* Initial working version of comment frontend in edit view
* Make comment js text translatable
* Add comment icon
* Basic hardcoded comment adding widget
* Create widget object and register it with the comment app to subscribe to updates about related annotations and whether comments are shown
* Add data-contentpath attributes to field (and data-contentpath-disabled to fields which prevent a stable contentpath existing at this point - ie ListBlock block positions are not uniquely identified), and to ensure newly generated streamfield blocks also have a stable contentpath identifiable from the frontend, make streamfield uuids generate clientside
* Make comments detect new contentpaths, and move hardcoded comment widget on chooser template into js initialisation, also making new comment buttons init properly in new streamfield blocks
* Fix tests to expect contentpaths
* Remove two step comment widget initialisation, and replace with stored callbacks for widgets that try to initialise themselves before the comment app itself. Refactor widgets to receive the makeComment function directly from the commenting system via an onRegister method to accommodate this
* Use object argument instead of positional for FieldLevelCommentWidget constructor
* Use json_script to pass author to the comments system
* Choosers: refactor to use SVG icons
Refactored non-deprecated choosers to use SVG icons. Custom choosers can
also supply their own svg icons using the `chosen_icon` and
`unchosen_icon` blocks.
We are keeping the relevant icon font css for custom choosers around to
prevent breaking existing custom choosers.
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
This reduces the jumpiness on insertion and deletion. For nested sequences, it's not possible to eliminate the jump entirely without editing the CSS, because the insert button is `display: inline-block` which gives it a minimum height of the containing block's line-height - as a result, this spacing appears immediately as soon as the block changes from display:none to visible.
While focusing on the first child field of a new block is generally a good thing, focusing a date field opens the date picker, which looks clunky when you've not explicitly requested it. Introduce a 'soft' focus flag to indicate that we only want to focus the field if it can be done unobtrusively.
This method will be suitable for pulling out into a common superclass. Having matching method signatures for ListBlock._insert and StreamBlock_insert means that the glue code for handling onRequestInsert can be shared, while the public insert methods of ListBlock and StreamBlock remain distinct (because having to pass a block type / definition to ListBlock.insert would be a pretty bad public API).
This starts to make the insert logic generic, and irons out the awkwardness of having to pass groupedChildBlockDefs as an extra option on StreamBlockMenu
This makes it generic to both StreamBlock and ListBlock: the callback passes an index number and a dict of container-specific options (empty for ListBlock, and a 'type' option for StreamBlock)
The "initial menu for an empty stream is initially open" business rule is implemented elsewhere, in StreamBlock.setState, so this is redundant in the constructor - and it will get in the way of sharing implementation with ListBlock, because the equivalent control for ListBlock (i.e. the Add button) doesn't have a concept of open-ness.