diff --git a/frontend/src/uxbox/main/exports.cljs b/frontend/src/uxbox/main/exports.cljs index d3f4b57aa..57161ab74 100644 --- a/frontend/src/uxbox/main/exports.cljs +++ b/frontend/src/uxbox/main/exports.cljs @@ -40,7 +40,6 @@ :circle (circle-shape shape) :image (let [image-id (:image shape) image (get-in @*state* [:images image-id])] - ;; (println "shape-wrapper" image) (image-shape (assoc shape :image image))))) (mx/defc shape-component @@ -57,17 +56,13 @@ :version "1.1" :xmlnsXlink "http://www.w3.org/1999/xlink" :xmlns "http://www.w3.org/2000/svg"} + ;; TODO: properly handle background #_(background) (for [item (reverse (:shapes page))] - (-> (shape item) + (-> (shape-component item) (mx/with-key (str item))))])) (defn render-page - [id] - (let [page (get-in @st/state [:pages id])] - (mx/render-static-html (page-svg page)))) - -(defn render-page* [id] (let [page (get-in @st/state [:pages id])] (when (:shapes page) diff --git a/frontend/src/uxbox/main/ui/dashboard/projects.cljs b/frontend/src/uxbox/main/ui/dashboard/projects.cljs index 7ca9bdbd6..bda089a82 100644 --- a/frontend/src/uxbox/main/ui/dashboard/projects.cljs +++ b/frontend/src/uxbox/main/ui/dashboard/projects.cljs @@ -122,7 +122,7 @@ (defn- grid-item-thumbnail-will-mount [own] (let [[project] (:rum/args own) - svg (exports/render-page* (:page-id project)) + svg (exports/render-page (:page-id project)) url (some-> svg (blob/create "image/svg+xml") (blob/create-uri))] diff --git a/frontend/src/uxbox/main/ui/shapes/image.cljs b/frontend/src/uxbox/main/ui/shapes/image.cljs index b070b41bb..ff8475d65 100644 --- a/frontend/src/uxbox/main/ui/shapes/image.cljs +++ b/frontend/src/uxbox/main/ui/shapes/image.cljs @@ -65,6 +65,5 @@ :transform (str xfmt) :width width :height height} - attrs (merge props (attrs/extract-style-attrs shape))] [:image attrs])) diff --git a/frontend/src/uxbox/main/ui/workspace/download.cljs b/frontend/src/uxbox/main/ui/workspace/download.cljs index dcceb21cd..52ec31998 100644 --- a/frontend/src/uxbox/main/ui/workspace/download.cljs +++ b/frontend/src/uxbox/main/ui/workspace/download.cljs @@ -44,7 +44,7 @@ (defn- download-page-svg [{:keys [name id] :as page}] - (let [content (exports/render-page id) + (let [content (or (exports/render-page id) "") blob (blob/create content "image/svg+xml") uri (blob/create-uri blob) link (.createElement js/document "a") @@ -64,7 +64,7 @@ (defn- generate-files [pages] (reduce (fn [acc {:keys [id name]}] - (let [content (exports/render-page id)] + (let [content (or (exports/render-page id) "")] (conj acc [(str (str/uslug name) ".svg") (blob/create content "image/svg+xml")]))) []