mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 06:11:39 +02:00
✨ Upload media with data in plugins
This commit is contained in:
parent
fb1429956a
commit
4b67c0593d
2 changed files with 17 additions and 1 deletions
|
@ -124,6 +124,22 @@
|
|||
(rx/take 1)
|
||||
(rx/subs! resolve reject)))))))
|
||||
|
||||
(uploadMediaData
|
||||
[_ name data mime-type]
|
||||
(let [file-id (:current-file-id @st/state)]
|
||||
(p/create
|
||||
(fn [resolve reject]
|
||||
(->> (dwm/process-blobs
|
||||
{:file-id file-id
|
||||
:local? false
|
||||
:name name
|
||||
:blobs [(js/Blob. #js [data] #js {:type mime-type})]
|
||||
:on-image identity
|
||||
:on-svg identity})
|
||||
(rx/take 1)
|
||||
(rx/map u/to-js)
|
||||
(rx/subs! resolve reject))))))
|
||||
|
||||
(group
|
||||
[_ shapes]
|
||||
(cond
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue