Open jkomoros opened 5 years ago
This could be quite simple: just a few stylesheets and classes the image can have for positioning, and the images are uploaded to a google cloud storage bucket
But could be much more complex: a gallery to enumerate the images available to you from within the editor
The simplest is literally just manually upload a picture into a GCS bucket and then copy paste its URL in
Cards get a images
property that is a map of field_name
to array of image objects, which includes a src
(partial image URLs) and positioning data. The image URLs are generated by appending the image storage bucket (a GCS bucket) to the url.
Certain fields (body by default) have a imagesAllowed
, which means that the UI will show an affordance to add an image. That shows an upload field in a dialog that is also the image picker.
Each image record includes the partial src, as well as position, one of top-left, top-right
for now. Those are shown in a little chip in the editor UI with drop downs to change.
Images are uploaded to a separate folder per author. In the future it should be possible to navigate in the file picker to see someone else's images (since all of them are public anyway)
The fact that images could take non-trivial time to load complicates the screenshot service ( you ahve to wait for the images onload to fire). It also ideally requires you to size the image so that even before it's loaded it will take up the proper size in the layout.
gsutil
. (Don't you also need to install gcloud? should gulp set-up-deploy check for those tools?)top-left
And slide g48845643ff_0_173 should get the feedback loop image