Karl Hobley
46f4c935d8
Add switch widget
2021-04-07 09:10:12 +01:00
Karl Hobley
e973c3d544
Add a faint grey background on unfocused block headers
2021-04-01 17:26:36 +01:00
Matt Westcott
eb18d37986
Implement getTextLabel on chooser widgets
2021-03-29 13:42:00 +01:00
Matt Westcott
0fa8508232
Implement getTextLabel on draftail widget
2021-03-29 13:41:53 +01:00
Matt Westcott
b219b60f95
Extract text labels from blocks to use in collapsed view
2021-03-29 13:41:39 +01:00
Matt Westcott
813621840c
Make sequence children collapsible
2021-03-29 13:41:24 +01:00
Karl Hobley
47b9c040ec
Update React Redux to 7.2.2
2021-03-19 17:10:57 +00:00
Matt Westcott
ee71bd3d07
Add 'disabled' styles for streamfield controls
...
Follows on from #6802 and #6799 .
2021-03-17 23:32:59 +00:00
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
Karl Hobley
ca3d6df80f
Telepath: Catch JavaScript errors from widget rendering
2021-03-17 23:32:57 +00:00
Matt Westcott
31a6e5b0a8
Move telepath.js into an external package
2021-03-17 23:32:56 +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
Matt Westcott
dac71cd4a7
Pass translation strings for list/stream buttons to JS
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
Karl Hobley
379c9983df
Move block tests into components
2021-03-17 23:32:45 +00:00
Karl Hobley
e712e6240d
Split telepath blocks into separate files
2021-03-17 23:32:45 +00:00
Karl Hobley
cd0e447b56
Merge most of ListChild and StreamChild into BaseSequenceChild
2021-03-17 23:32:41 +00:00
Karl Hobley
2738b21bf3
Add opening animation to ListChild
2021-03-17 23:32:41 +00:00
Karl Hobley
e5dd68ed6d
Remove data attributes that contained type name
2021-03-17 23:32:41 +00:00
Karl Hobley
affe84f20c
Remove unused ids from ListChild
2021-03-17 23:32:41 +00:00
Karl Hobley
ce85081b3f
Add type field on ListChild
2021-03-17 23:32:40 +00:00
Karl Hobley
0574c6b6f1
Add an id field to ListChild
...
This brings it slightly closer to StreamChild, and we'll need it later
for https://github.com/wagtail/rfcs/pull/65
2021-03-17 23:32:40 +00:00
Karl Hobley
f78c96e73e
Set index input in ListBlock child
2021-03-17 23:32:40 +00:00