Add Lottie animation content element - #2468
Merged
Merged
Conversation
Registrations do not depend on the editor seed and can thus happen before the app is initialized. Only setting up the file types requires the server rendered config. This allows tests to set up file types registered by plugins together with the built in ones without having to build a separate registry. Options of the text track file type that read the seed are passed as functions since the registration now happens before the editor has booted. Icon table cells and select inputs support this just like text table cells already support functions as default value.
Instead of building a separate registry of test doubles, set up the global registry from fake server side configs. File types registered by content element editors are thus available in specs and plugins only need to provide the config the server would render.
Turn any option ending in "Files" into a file collection of the seed. Specs of content elements that come with their own file type can thus pass files without the test helper having to know about the collection. Since model types are only compared to associate nested files, a placeholder derived from the collection name is used unless the spec passes one.
Only pass the fileModelTypes seed option in specs that either assert on the resulting model type or associate nested files with their parent. Everywhere else the option merely restated the defaults of the normalizeSeed test helper.
Uploadable file names are generated from the extension of the uploaded file. Extensions like 'lottie' were rejected by the file name validation.
The entry association of ReusableFile was resolved relative to the namespace of the including model. File types defined by plugins that do not live inside the Pageflow module thus failed to load.
Registers a PageflowScrolled::LottieFile file type behind the new lottie_animation_content_element feature flag, allowing dotLottie files to be uploaded and managed in the editor.
Uploads of dotLottie files are matched by file name since browsers do not detect a content type for them.
Renders dotLottie animations via a canvas based player. The player is loaded in a separate frontend pack registered behind the lottie_animation_content_element feature flag since it depends on a WebAssembly module.
Lets editors select an uploaded dotLottie file and choose whether the animation shall loop. Only available if the lottie_animation_content_element feature is enabled.
By default the player fetches its WebAssembly module from a CDN, which would leak visitor IPs to a third party.
Analogous to the preview view rendered in the file meta data overlay, file types can now register a Backbone view which the file thumbnail renders on top of its box once the file is ready.
Plays the animation in a loop next to the files list. Since the editor runs in its own bundle, the setup pointing the player at the bundled WebAssembly module moves into a module shared with the frontend.
Animations commonly build up their scene over time, so the frame the player draws right after loading the file tends to be close to blank. The placeholder pictogram is no longer forced, since it would shine through transparent parts of the animation.
Selecting another file left the previous thumbnail view behind with its model bindings intact. File types can now render thumbnail views which hold on to resources of their file, so the view has to be closed. Since closing removes the element of a view, the thumbnail moves into a container of its own.
Let entries crop lottie animations to a theme aspect ratio and round their corners just like inline images. Since the animation is vector based, cropping only means giving the canvas a different box and telling the player to cover it instead of fitting the animation in.
Crop positioning stays disabled for the file input: The positioning dialog displays the file via a CSS background image, which lottie files do not provide a derivative for. Animations are therefore always cropped around their center.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
REDMINE-21349