Wykres commitów

11137 Commity (485cf7e1cccf0c4c2c7d00f055fb9da3f03576d1)

Autor SHA1 Wiadomość Data
Matt Westcott d3e58f7908 Delay slidedown animation to fix layout
Without this, the animation expands from somewhere in the middle of the block
2021-03-17 23:32:59 +00:00
Matt Westcott f18a15e142 Animate ListBlock / StreamBlock insertion controls on insert/delete
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.
2021-03-17 23:32:59 +00:00
Matt Westcott 7361b0901f Make animation an explicit flag on deleteBlock / duplicateBlock (and test in non-animated mode) 2021-03-17 23:32:58 +00:00
Matt Westcott 773da59107 Update lint comments for typescript-eslint 2021-03-17 23:32:58 +00:00
Matt Westcott d5c174e027 Don't focus date pickers when adding new blocks
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.
2021-03-17 23:32:58 +00:00
dex 019e2eab42 Duplicate block - editor docs 2021-03-17 23:32:57 +00:00
Karl Hobley ca3d6df80f Telepath: Catch JavaScript errors from widget rendering 2021-03-17 23:32:57 +00:00
Matt Westcott 30fee96d37 update telepath-unpack to 0.0.2 to fix module imports 2021-03-17 23:32:57 +00:00
Matt Westcott f2ddbe74fd install telepath from pypi 2021-03-17 23:32:57 +00:00
Matt Westcott ba9487b753 Move telepath.py into an external package 2021-03-17 23:32:56 +00:00
Matt Westcott 31a6e5b0a8 Move telepath.js into an external package 2021-03-17 23:32:56 +00:00
Matt Westcott 56ea3feca3 Support customising media handling on AdapterRegistry 2021-03-17 23:32:56 +00:00
Matt Westcott b82348e307 Add an AdapterRegistry class to replace the global adapters dict
This will allow packages such as Wagtail to define their own 'sandboxed' registries containing package-specific adapters - in Wagtail's case we want this so that we can take over the details of serving static JS (so that we don't need to add telepath to INSTALLED_APPS and can use the Wagtail-specific versioned_static helper).
2021-03-17 23:32:55 +00:00
Matt Westcott 3ac3ffd005 Eliminate top-level uses of versioned_static. Fixes #6801 2021-03-17 23:32:55 +00:00
Matt Westcott a5a33db3ff stylelint fix 2021-03-17 23:32:55 +00:00
Karl Hobley 9df8b3cad8 Merge Wagtail customisations into Streamfield SCSS 2021-03-17 23:32:55 +00:00
Karl Hobley caf8a7f2d7 Import SCSS from react-streamfield 2021-03-17 23:32:54 +00:00
Karl Hobley 0360cf4c2f Telepath: Validation of block counts 2021-03-17 23:32:54 +00:00
Matt Westcott 4ee65760fe Add BaseSequenceBlock superclass 2021-03-17 23:32:54 +00:00
Matt Westcott 320c639255 standardise on 'inserter' as the catch-all name for insertPosition / menu
it's probably going to end up as part of the public api (so we can do myStreamBlock.inserters[0].open()), so best to give it a suitably snappy name
2021-03-17 23:32:53 +00:00
Matt Westcott 10abdd5a4b Make _onRequestInsert methods match 2021-03-17 23:32:53 +00:00
Matt Westcott 570780f38c Introduce a low-level _insert method used by the onRequestInsert handler
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).
2021-03-17 23:32:53 +00:00
Matt Westcott 490529d0b1 Pull out _createChild / _createInsertionControl methods from insert
This starts to make the insert logic generic, and irons out the awkwardness of having to pass groupedChildBlockDefs as an extra option on StreamBlockMenu
2021-03-17 23:32:53 +00:00
Matt Westcott 8d63599552 Add a shared superclass for StreamBlockMenu and InsertPosition 2021-03-17 23:32:52 +00:00
Matt Westcott 88b5c4966d Standardise on onRequestInsert as callback for inserting blocks
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)
2021-03-17 23:32:52 +00:00
Matt Westcott 35b3650c71 Remove isOpen flag from StreamBlockMenu constructor
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.
2021-03-17 23:32:52 +00:00
Matt Westcott 0e96693fde Clear out obsolete templates / js from pre-telepath streamfield 2021-03-17 23:32:52 +00:00
Karl Hobley 599365752f Telepath: Duplication of items within StreamBlock and ListBlock 2021-03-17 23:32:51 +00:00
Karl Hobley 040a9c2db1 Telepath: Implement random insert for list blocks 2021-03-17 23:32:51 +00:00
Karl Hobley ab8eaf69fd Add insert buttons between each list item 2021-03-17 23:32:51 +00:00
Karl Hobley c101fcbb75 Telepath: Animate new list block items 2021-03-17 23:32:50 +00:00
Matt Westcott 44d23ca099 Localise the Add string 2021-03-17 23:32:50 +00:00
Matt Westcott b766be2db6 Escape HTML in interpolated strings 2021-03-17 23:32:50 +00:00
Karl Hobley 2e55191a75 Telepath: StaticBlock 2021-03-17 23:32:50 +00:00
Karl Hobley 0e45188aa8 Fix test for tableblock 2021-03-17 23:32:49 +00:00
Karl Hobley cf6fc34e96 Fix test for streamfields in inline children 2021-03-17 23:32:49 +00:00
Karl Hobley e9aedc1d49 Update tests for Date/Time/DateTime widgets 2021-03-17 23:32:49 +00:00
Karl Hobley c6bc088a72 Update tests for Date/Time/DateTime blocks 2021-03-17 23:32:48 +00:00
Karl Hobley 41c748018a Update tests for StreamBlock 2021-03-17 23:32:48 +00:00
Karl Hobley e80cc79359 Update tests for ListBlock 2021-03-17 23:32:48 +00:00
Karl Hobley d0d3eb838b Update tests for StructBlock 2021-03-17 23:32:48 +00:00
Matt Westcott dac71cd4a7 Pass translation strings for list/stream buttons to JS 2021-03-17 23:32:47 +00:00
Karl Hobley ab40114edb Delete EmbedBlock form render test
It's just a URL Block with no customisations so not worth a test
2021-03-17 23:32:47 +00:00
Karl Hobley ad14ac774a Add tests for SnippetChooserBlock and AdminSnippetChooser adapters 2021-03-17 23:32:47 +00:00
Karl Hobley 0bef68cc3f Add tests for PageChooserBlock and AdminPageChooser adapters 2021-03-17 23:32:47 +00:00
Matt Westcott dac969a372 Test reordering 2021-03-17 23:32:46 +00:00
Matt Westcott 9f82264b33 Implement ordering controls on ListBlock 2021-03-17 23:32:46 +00:00
Matt Westcott f96c567353 Implement ordering controls on StreamBlock 2021-03-17 23:32:46 +00:00
Matt Westcott ffcf8a2ca0 enable/disable reorder buttons on add/delete 2021-03-17 23:32:46 +00:00
Matt Westcott 0e317a0895 Defer rendering StreamBlock menu until opened
A small optimisation for large StreamBlocks - most stream menus will never be expanded, so it's wasted work to render the menu contents up-front.
2021-03-17 23:32:45 +00:00