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
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
1c9cc7a56d
Update tests for RawHTMLBlock
2021-03-17 23:32:45 +00:00
Karl Hobley
0565001f7e
Update tests for MultipleChoiceBlock
2021-03-17 23:32:44 +00:00
Karl Hobley
872e076349
Update tests for ChoiceBlock
2021-03-17 23:32:44 +00:00
Karl Hobley
85deaee396
Update tests for RichTextBlock
2021-03-17 23:32:44 +00:00
Karl Hobley
c26d1507b5
Update RegexBlock custom error message test
2021-03-17 23:32:44 +00:00
Karl Hobley
e292fd5887
Call Field.prepare_value() from FieldBlock.get_form_state()
2021-03-17 23:32:43 +00:00