mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 00:36:13 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
c27d709b6b
27 changed files with 427 additions and 219 deletions
|
@ -20,9 +20,11 @@
|
|||
[app.main.ui.routes :as rt]
|
||||
[app.main.worker :as worker]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.globals :as glob]
|
||||
[app.util.i18n :as i18n]
|
||||
[app.util.theme :as theme]
|
||||
[beicon.core :as rx]
|
||||
[cuerdas.core :as str]
|
||||
[debug]
|
||||
[potok.core :as ptk]
|
||||
[rumext.alpha :as mf]))
|
||||
|
@ -58,12 +60,18 @@
|
|||
(rx/take 1)
|
||||
(rx/map #(rt/init-routes)))))))
|
||||
|
||||
(def essential-only?
|
||||
(let [href (.-href ^js glob/location)]
|
||||
(str/includes? href "essential=t")))
|
||||
|
||||
(defn ^:export init
|
||||
[]
|
||||
(worker/init!)
|
||||
(sentry/init!)
|
||||
(i18n/init! cf/translations)
|
||||
(theme/init! cf/themes)
|
||||
(when-not essential-only?
|
||||
(worker/init!)
|
||||
(sentry/init!)
|
||||
(i18n/init! cf/translations)
|
||||
(theme/init! cf/themes))
|
||||
|
||||
(init-ui)
|
||||
(st/emit! (initialize)))
|
||||
|
||||
|
|
|
@ -101,10 +101,12 @@
|
|||
bool-shape (bool/bool-shape shape-wrapper)]
|
||||
(mf/fnc bool-wrapper
|
||||
[{:keys [shape] :as props}]
|
||||
(let [childs (->> (cp/get-children (:id shape) objects)
|
||||
(select-keys objects))]
|
||||
[:& bool-shape {:shape shape
|
||||
:childs childs}]))))
|
||||
(let [childs (mf/use-memo
|
||||
(mf/deps (:id shape) objects)
|
||||
(fn []
|
||||
(->> (cp/get-children (:id shape) objects)
|
||||
(select-keys objects))))]
|
||||
[:& bool-shape {:shape shape :childs childs}]))))
|
||||
|
||||
(defn svg-raw-wrapper-factory
|
||||
[objects]
|
||||
|
@ -221,26 +223,39 @@
|
|||
(mf/defc frame-svg
|
||||
{::mf/wrap [mf/memo]}
|
||||
[{:keys [objects frame zoom] :or {zoom 1} :as props}]
|
||||
(let [modifier (-> (gpt/point (:x frame) (:y frame))
|
||||
(gpt/negate)
|
||||
(gmt/translate-matrix))
|
||||
|
||||
frame-id (:id frame)
|
||||
|
||||
(let [frame-id (:id frame)
|
||||
include-metadata? (mf/use-ctx export/include-metadata-ctx)
|
||||
|
||||
modifier-ids (concat [frame-id] (cp/get-children frame-id objects))
|
||||
update-fn #(assoc-in %1 [%2 :modifiers :displacement] modifier)
|
||||
objects (reduce update-fn objects modifier-ids)
|
||||
frame (assoc-in frame [:modifiers :displacement] modifier)
|
||||
modifier
|
||||
(mf/use-memo
|
||||
(mf/deps (:x frame) (:y frame))
|
||||
(fn []
|
||||
(-> (gpt/point (:x frame) (:y frame))
|
||||
(gpt/negate)
|
||||
(gmt/translate-matrix))))
|
||||
|
||||
objects
|
||||
(mf/use-memo
|
||||
(mf/deps frame-id objects modifier)
|
||||
(fn []
|
||||
(let [update-fn #(assoc-in %1 [%2 :modifiers :displacement] modifier)]
|
||||
(->> (cp/get-children frame-id objects)
|
||||
(into [frame-id])
|
||||
(reduce update-fn objects)))))
|
||||
|
||||
frame
|
||||
(mf/use-memo
|
||||
(mf/deps modifier)
|
||||
(fn [] (assoc-in frame [:modifiers :displacement] modifier)))
|
||||
|
||||
wrapper
|
||||
(mf/use-memo
|
||||
(mf/deps objects)
|
||||
(fn [] (frame-wrapper-factory objects)))
|
||||
|
||||
width (* (:width frame) zoom)
|
||||
height (* (:height frame) zoom)
|
||||
vbox (format-viewbox {:width (:width frame 0) :height (:height frame 0)})
|
||||
|
||||
wrapper (mf/use-memo
|
||||
(mf/deps objects)
|
||||
#(frame-wrapper-factory objects))]
|
||||
vbox (format-viewbox {:width (:width frame 0) :height (:height frame 0)})]
|
||||
|
||||
[:svg {:view-box vbox
|
||||
:width (ust/format-precision width viewbox-decimal-precision)
|
||||
|
@ -254,19 +269,25 @@
|
|||
(mf/defc component-svg
|
||||
{::mf/wrap [mf/memo #(mf/deferred % ts/idle-then-raf)]}
|
||||
[{:keys [objects group zoom] :or {zoom 1} :as props}]
|
||||
(let [modifier (-> (gpt/point (:x group) (:y group))
|
||||
(gpt/negate)
|
||||
(gmt/translate-matrix))
|
||||
|
||||
group-id (:id group)
|
||||
|
||||
(let [group-id (:id group)
|
||||
include-metadata? (mf/use-ctx export/include-metadata-ctx)
|
||||
|
||||
modifier-ids (concat [group-id] (cp/get-children group-id objects))
|
||||
modifier
|
||||
(mf/use-memo
|
||||
(mf/deps (:x group) (:y group))
|
||||
(fn []
|
||||
(-> (gpt/point (:x group) (:y group))
|
||||
(gpt/negate)
|
||||
(gmt/translate-matrix))))
|
||||
|
||||
update-fn #(assoc-in %1 [%2 :modifiers :displacement] modifier)
|
||||
modifiers (reduce update-fn {} modifier-ids)
|
||||
objects (gsh/merge-modifiers objects modifiers)
|
||||
objects
|
||||
(mf/use-memo
|
||||
(mf/deps modifier objects group-id)
|
||||
(fn []
|
||||
(let [modifier-ids (concat [group-id] (cp/get-children group-id objects))
|
||||
update-fn #(assoc-in %1 [%2 :modifiers :displacement] modifier)
|
||||
modifiers (reduce update-fn {} modifier-ids)]
|
||||
(gsh/merge-modifiers objects modifiers))))
|
||||
|
||||
group (get objects group-id)
|
||||
width (* (:width group) zoom)
|
||||
|
@ -276,7 +297,7 @@
|
|||
group-wrapper
|
||||
(mf/use-memo
|
||||
(mf/deps objects)
|
||||
#(group-wrapper-factory objects))]
|
||||
(fn [] (group-wrapper-factory objects)))]
|
||||
|
||||
[:svg {:view-box vbox
|
||||
:width (ust/format-precision width viewbox-decimal-precision)
|
||||
|
@ -285,31 +306,51 @@
|
|||
:xmlns "http://www.w3.org/2000/svg"
|
||||
:xmlnsXlink "http://www.w3.org/1999/xlink"
|
||||
:xmlns:penpot (when include-metadata? "https://penpot.app/xmlns")}
|
||||
|
||||
[:> shape-container {:shape group}
|
||||
[:& group-wrapper {:shape group :view-box vbox}]]]))
|
||||
|
||||
(mf/defc component-symbol
|
||||
[{:keys [id data] :as props}]
|
||||
{::mf/wrap-props false}
|
||||
[props]
|
||||
(let [id (obj/get props "id")
|
||||
data (obj/get props "data")
|
||||
name (:name data)
|
||||
path (:path data)
|
||||
objects (:objects data)
|
||||
root (get objects id)
|
||||
selrect (:selrect root)
|
||||
|
||||
(let [{:keys [name path objects]} data
|
||||
root (get objects id)
|
||||
vbox
|
||||
(format-viewbox
|
||||
{:width (:width selrect)
|
||||
:height (:height selrect)})
|
||||
|
||||
{:keys [width height]} (:selrect root)
|
||||
vbox (format-viewbox {:width width :height height})
|
||||
modifier
|
||||
(mf/use-memo
|
||||
(mf/deps (:x root) (:y root))
|
||||
(fn []
|
||||
(-> (gpt/point (:x root) (:y root))
|
||||
(gpt/negate)
|
||||
(gmt/translate-matrix))))
|
||||
|
||||
modifier (-> (gpt/point (:x root) (:y root))
|
||||
(gpt/negate)
|
||||
(gmt/translate-matrix))
|
||||
objects
|
||||
(mf/use-memo
|
||||
(mf/deps modifier id objects)
|
||||
(fn []
|
||||
(let [modifier-ids (concat [id] (cp/get-children id objects))
|
||||
update-fn #(assoc-in %1 [%2 :modifiers :displacement] modifier)]
|
||||
(reduce update-fn objects modifier-ids))))
|
||||
|
||||
modifier-ids (concat [id] (cp/get-children id objects))
|
||||
update-fn #(assoc-in %1 [%2 :modifiers :displacement] modifier)
|
||||
objects (reduce update-fn objects modifier-ids)
|
||||
root (assoc-in root [:modifiers :displacement] modifier)
|
||||
root
|
||||
(mf/use-memo
|
||||
(mf/deps modifier root)
|
||||
(fn [] (assoc-in root [:modifiers :displacement] modifier)))
|
||||
|
||||
group-wrapper
|
||||
(mf/use-memo
|
||||
(mf/deps objects)
|
||||
#(group-wrapper-factory objects))]
|
||||
(fn [] (group-wrapper-factory objects)))]
|
||||
|
||||
[:> "symbol" #js {:id (str id)
|
||||
:viewBox vbox
|
||||
|
@ -321,10 +362,9 @@
|
|||
(mf/defc components-sprite-svg
|
||||
{::mf/wrap-props false}
|
||||
[props]
|
||||
|
||||
(let [data (obj/get props "data")
|
||||
children (obj/get props "children")
|
||||
embed? (obj/get props "embed?")
|
||||
(let [data (obj/get props "data")
|
||||
children (obj/get props "children")
|
||||
embed? (obj/get props "embed?")
|
||||
include-metadata? (obj/get props "include-metadata?")]
|
||||
[:& (mf/provider embed/context) {:value embed?}
|
||||
[:& (mf/provider export/include-metadata-ctx) {:value include-metadata?}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
(ns app.main.ui.dashboard.export
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.main.data.events :as ev]
|
||||
[app.main.data.modal :as modal]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.icons :as i]
|
||||
|
@ -15,7 +14,6 @@
|
|||
[app.util.dom :as dom]
|
||||
[app.util.i18n :as i18n :refer [tr]]
|
||||
[beicon.core :as rx]
|
||||
[potok.core :as ptk]
|
||||
[rumext.alpha :as mf]))
|
||||
|
||||
(def ^:const options [:all :merge :detach])
|
||||
|
@ -60,10 +58,6 @@
|
|||
|
||||
start-export
|
||||
(fn []
|
||||
(st/emit! (ptk/event ::ev/event {::ev/name "export-files"
|
||||
:num-files (count (:files @state))
|
||||
:option @selected-option}))
|
||||
|
||||
(swap! state assoc :status :exporting)
|
||||
(->> (uw/ask-many!
|
||||
{:cmd :export-file
|
||||
|
|
|
@ -162,6 +162,7 @@
|
|||
(mf/deps files current-team-id)
|
||||
(fn [_]
|
||||
(st/emit! (ptk/event ::ev/event {::ev/name "export-files"
|
||||
::ev/origin "dashboard"
|
||||
:num-files (count files)}))
|
||||
(->> (rx/from files)
|
||||
(rx/flat-map
|
||||
|
|
|
@ -153,7 +153,7 @@
|
|||
(fn []
|
||||
(->> (rx/zip
|
||||
(repo/query! :font-variants {:file-id file-id})
|
||||
(repo/query! :file {:id file-id}))
|
||||
(repo/query! :trimmed-file {:id file-id :page-id page-id :object-id object-id}))
|
||||
(rx/subs
|
||||
(fn [[fonts {:keys [data]}]]
|
||||
(when (seq fonts)
|
||||
|
|
|
@ -199,6 +199,18 @@
|
|||
:penpot:suffix suffix
|
||||
:penpot:scale (str scale)}])))
|
||||
|
||||
(defn str->style
|
||||
[style-str]
|
||||
(if (string? style-str)
|
||||
(->> (str/split style-str ";")
|
||||
(map str/trim)
|
||||
(map #(str/split % ":"))
|
||||
(group-by first)
|
||||
(map (fn [[key val]]
|
||||
(vector (keyword key) (second (first val)))))
|
||||
(into {}))
|
||||
style-str))
|
||||
|
||||
(defn style->str
|
||||
[style]
|
||||
(->> style
|
||||
|
@ -229,7 +241,8 @@
|
|||
[:& render-xml {:xml def-xml}]])]))
|
||||
|
||||
(when (= (:type shape) :svg-raw)
|
||||
(let [props
|
||||
(let [shape (-> shape (d/update-in-when [:content :attrs :style] str->style))
|
||||
props
|
||||
(-> (obj/new)
|
||||
(obj/set! "penpot:x" (:x shape))
|
||||
(obj/set! "penpot:y" (:y shape))
|
||||
|
@ -263,7 +276,6 @@
|
|||
(mf/defc export-data
|
||||
[{:keys [shape]}]
|
||||
(let [props (-> (obj/new) (add-data shape) (add-library-refs shape))]
|
||||
(js/console.log props)
|
||||
[:> "penpot:shape" props
|
||||
(export-shadow-data shape)
|
||||
(export-blur-data shape)
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
[app.common.data :as d]
|
||||
[app.common.math :as mth]
|
||||
[app.config :as cf]
|
||||
[app.main.data.events :as ev]
|
||||
[app.main.data.messages :as dm]
|
||||
[app.main.data.modal :as modal]
|
||||
[app.main.data.workspace :as dw]
|
||||
|
@ -25,6 +26,7 @@
|
|||
[app.util.router :as rt]
|
||||
[beicon.core :as rx]
|
||||
[okulary.core :as l]
|
||||
[potok.core :as ptk]
|
||||
[rumext.alpha :as mf]))
|
||||
|
||||
;; --- Zoom Widget
|
||||
|
@ -152,6 +154,10 @@
|
|||
(mf/use-callback
|
||||
(mf/deps file team-id)
|
||||
(fn [_]
|
||||
(st/emit! (ptk/event ::ev/event {::ev/name "export-files"
|
||||
::ev/origin "workspace"
|
||||
:num-files 1}))
|
||||
|
||||
(->> (rx/of file)
|
||||
(rx/flat-map
|
||||
(fn [file]
|
||||
|
@ -251,7 +257,7 @@
|
|||
(tr "workspace.header.menu.hide-palette")
|
||||
(tr "workspace.header.menu.show-palette"))]
|
||||
[:span.shortcut (sc/get-tooltip :toggle-palette)]]
|
||||
|
||||
|
||||
[:li {:on-click #(st/emit! (dw/toggle-layout-flags :display-artboard-names))}
|
||||
[:span
|
||||
(if (contains? layout :display-artboard-names)
|
||||
|
|
|
@ -96,18 +96,21 @@
|
|||
::mf/wrap-props false}
|
||||
[props]
|
||||
|
||||
(let [shape (unchecked-get props "shape")
|
||||
objects (unchecked-get props "objects")
|
||||
thumbnail? (unchecked-get props "thumbnail?")
|
||||
(when-let [shape (unchecked-get props "shape")]
|
||||
(let [objects (unchecked-get props "objects")
|
||||
thumbnail? (unchecked-get props "thumbnail?")
|
||||
|
||||
children (-> (mapv (d/getf objects) (:shapes shape))
|
||||
(hooks/use-equal-memo))
|
||||
all-children (-> (cp/get-children-objects (:id shape) objects)
|
||||
(hooks/use-equal-memo))
|
||||
children
|
||||
(-> (mapv (d/getf objects) (:shapes shape))
|
||||
(hooks/use-equal-memo))
|
||||
|
||||
show-thumbnail? (and thumbnail? (some? (:thumbnail shape)))]
|
||||
all-children
|
||||
(-> (cp/get-children-objects (:id shape) objects)
|
||||
(hooks/use-equal-memo))
|
||||
|
||||
show-thumbnail?
|
||||
(and thumbnail? (some? (:thumbnail shape)))]
|
||||
|
||||
(when (some? shape)
|
||||
[:g.frame-wrapper {:display (when (:hidden shape) "none")}
|
||||
[:> shape-container {:shape shape}
|
||||
[:& ff/fontfaces-style {:shapes all-children}]
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
(defn on-error
|
||||
[error]
|
||||
(js/console.error "Error on worker" error))
|
||||
(js/console.error "Error on worker" (pr-str error)))
|
||||
|
||||
(defonce instance (atom nil))
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
(defn generate*
|
||||
[{:keys [name color size]
|
||||
:or {color "var(--color-black)" size 128}}]
|
||||
:or {color "#000000" size 128}}]
|
||||
|
||||
(let [parts (str/words (str/upper name))
|
||||
letters (if (= 1 (count parts))
|
||||
(ffirst parts)
|
||||
|
@ -27,7 +28,7 @@
|
|||
|
||||
(obj/set! context "font" (str (/ size 2) "px Arial"))
|
||||
(obj/set! context "textAlign" "center")
|
||||
(obj/set! context "fillStyle" "var(--color-white)")
|
||||
(obj/set! context "fillStyle" "#ffffff")
|
||||
(.fillText context letters (/ size 2) (/ size 1.5))
|
||||
|
||||
(.toDataURL canvas)))
|
||||
|
|
|
@ -210,7 +210,8 @@
|
|||
|
||||
svg-node (if (= :svg tag)
|
||||
(->> node :content last :content last)
|
||||
(->> node :content last))]
|
||||
(->> node :content last))
|
||||
svg-node (d/update-in-when svg-node [:attrs :style] parse-style)]
|
||||
(merge (add-attrs {} (:attrs svg-node)) node-attrs))
|
||||
|
||||
(= type :bool)
|
||||
|
@ -633,7 +634,8 @@
|
|||
(defn add-svg-content
|
||||
[props node]
|
||||
(let [svg-content (get-data node :penpot:svg-content)
|
||||
attrs (-> (:attrs svg-content) (without-penpot-prefix))
|
||||
attrs (-> (:attrs svg-content) (without-penpot-prefix)
|
||||
(d/update-when :style parse-style))
|
||||
tag (-> svg-content :attrs :penpot:tag keyword)
|
||||
|
||||
node-content
|
||||
|
@ -641,13 +643,17 @@
|
|||
(= tag :svg)
|
||||
(->> node :content last :content last :content fix-style-attr)
|
||||
|
||||
(= tag :text)
|
||||
(-> node :content last :content))]
|
||||
(assoc
|
||||
props :content
|
||||
{:attrs attrs
|
||||
:tag tag
|
||||
:content node-content})))
|
||||
(some? (:content svg-content))
|
||||
(->> (:content svg-content)
|
||||
(filter #(= :penpot:svg-child (:tag %)))
|
||||
(mapv :content)
|
||||
(first)))]
|
||||
(-> props
|
||||
(assoc
|
||||
:content
|
||||
{:attrs attrs
|
||||
:tag tag
|
||||
:content node-content}))))
|
||||
|
||||
(defn add-frame-data [props node]
|
||||
(let [grids (parse-grids node)]
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
(post {:payload result}))
|
||||
|
||||
(reply-error [err]
|
||||
(.error js/console "error" err)
|
||||
(.error js/console "error" (pr-str err))
|
||||
(post {:error {:data (ex-data err)
|
||||
:message (ex-message err)}}))
|
||||
|
||||
|
|
|
@ -141,38 +141,30 @@
|
|||
(rx/map #(hash-map :file-id file-id :library-id %))
|
||||
(rx/flat-map (partial rp/mutation :link-file-to-library)))))
|
||||
|
||||
(defn persist-file [file]
|
||||
(rp/mutation :persist-temp-file {:id (:id file)}))
|
||||
|
||||
(defn send-changes
|
||||
"Creates batches of changes to be sent to the backend"
|
||||
[context file]
|
||||
(let [revn (atom (:revn file))
|
||||
file-id (:id file)
|
||||
(let [file-id (:id file)
|
||||
session-id (uuid/next)
|
||||
changes-batches
|
||||
(->> (fb/generate-changes file)
|
||||
(partition change-batch-size change-batch-size nil)
|
||||
(mapv vec))
|
||||
batches (->> (fb/generate-changes file)
|
||||
(partition change-batch-size change-batch-size nil)
|
||||
(mapv vec))
|
||||
|
||||
current (atom 0)
|
||||
total (count changes-batches)]
|
||||
processed (atom 0)
|
||||
total (count batches)]
|
||||
|
||||
(rx/concat
|
||||
(->> (rx/from changes-batches)
|
||||
(rx/mapcat
|
||||
(fn [change-batch]
|
||||
(->> (rp/mutation :update-file
|
||||
(->> (rx/from (d/enumerate batches))
|
||||
(rx/merge-map
|
||||
(fn [[i change-batch]]
|
||||
(->> (rp/mutation :update-temp-file
|
||||
{:id file-id
|
||||
:session-id session-id
|
||||
:revn @revn
|
||||
:revn i
|
||||
:changes change-batch})
|
||||
(rx/tap #(do (swap! current inc)
|
||||
(progress! context
|
||||
:upload-data @current total))))))
|
||||
|
||||
(rx/tap #(do (swap! processed inc)
|
||||
(progress! context :upload-data @processed total))))))
|
||||
(rx/map first)
|
||||
(rx/tap #(reset! revn (:revn %)))
|
||||
(rx/ignore))
|
||||
|
||||
(->> (rp/mutation :persist-temp-file {:id file-id})
|
||||
|
@ -340,7 +332,7 @@
|
|||
file (-> file (fb/add-page page-data))]
|
||||
(->> (rx/from nodes)
|
||||
(rx/filter cip/shape?)
|
||||
(rx/mapcat (partial resolve-media context file-id))
|
||||
(rx/merge-map (partial resolve-media context file-id))
|
||||
(rx/reduce (partial process-import-node context) file)
|
||||
(rx/map (comp fb/close-page setup-interactions)))))
|
||||
|
||||
|
@ -362,7 +354,7 @@
|
|||
(rx/filter cip/shape?)
|
||||
(rx/skip 1)
|
||||
(rx/skip-last 1)
|
||||
(rx/mapcat (partial resolve-media context file-id))
|
||||
(rx/merge-map (partial resolve-media context file-id))
|
||||
(rx/reduce (partial process-import-node context) file)
|
||||
(rx/map fb/finish-component))))
|
||||
|
||||
|
@ -382,6 +374,7 @@
|
|||
(fn [[page-id page-name]]
|
||||
(->> (get-file context :page page-id)
|
||||
(rx/map (fn [page-data] [page-id page-name page-data])))))
|
||||
|
||||
(rx/concat-reduce (partial import-page context) file))))
|
||||
|
||||
(defn process-library-colors
|
||||
|
@ -420,7 +413,7 @@
|
|||
(let [resolve (:resolve context)]
|
||||
(->> (get-file context :media-list)
|
||||
(rx/flat-map (comp d/kebab-keys cip/string->uuid))
|
||||
(rx/mapcat
|
||||
(rx/merge-map
|
||||
(fn [[id media]]
|
||||
(let [media (assoc media :id (resolve id))]
|
||||
(->> (get-file context :media id media)
|
||||
|
@ -432,12 +425,11 @@
|
|||
:content content
|
||||
:is-local false})))
|
||||
(rx/tap #(progress! context :upload-media (:name %)))
|
||||
(rx/flat-map #(rp/mutation! :upload-file-media-object %))
|
||||
(rx/merge-map #(rp/mutation! :upload-file-media-object %))
|
||||
(rx/map (constantly media))
|
||||
(rx/catch #(do (.error js/console (str "Error uploading media: " (:name media)) )
|
||||
(rx/empty)))))))
|
||||
(rx/reduce fb/add-library-media file)))
|
||||
|
||||
(rx/of file)))
|
||||
|
||||
(defn process-library-components
|
||||
|
@ -511,7 +503,7 @@
|
|||
(fn [[file data]]
|
||||
(->> (uz/load-from-url (:uri data))
|
||||
(rx/map #(-> context (assoc :zip %) (merge data)))
|
||||
(rx/flat-map
|
||||
(rx/merge-map
|
||||
(fn [context]
|
||||
;; process file retrieves a stream that will emit progress notifications
|
||||
;; and other that will emit the files once imported
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
(let [uri (u/join (cfg/get-public-uri) "api/rpc/query/page")
|
||||
params {:file-id file-id
|
||||
:id page-id
|
||||
:strip-thumbnails true}]
|
||||
:strip-frames-with-thumbnails true}]
|
||||
(->> (http/send!
|
||||
{:method :get
|
||||
:uri uri
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue