mirror of
https://github.com/penpot/penpot.git
synced 2025-05-25 15:26:11 +02:00
✨ Fix problems with export/import
This commit is contained in:
parent
3228582cbe
commit
82c6b8daae
4 changed files with 68 additions and 53 deletions
|
@ -185,7 +185,7 @@
|
|||
(d/deep-mapm
|
||||
(fn [pair] (->> pair (mapv convert)))))))
|
||||
|
||||
(def search-data-node? #{:rect :image :path :text :circle})
|
||||
(def search-data-node? #{:rect :image :path :circle})
|
||||
|
||||
(defn get-svg-data
|
||||
[type node]
|
||||
|
@ -200,6 +200,13 @@
|
|||
(map #(:attrs %))
|
||||
(reduce add-attrs node-attrs)))
|
||||
|
||||
(= type :text)
|
||||
(->> node
|
||||
(node-seq)
|
||||
(filter #(contains? #{:g :foreignObject} (:tag %)))
|
||||
(map #(:attrs %))
|
||||
(reduce add-attrs node-attrs))
|
||||
|
||||
(= type :frame)
|
||||
(let [svg-node (->> node :content (d/seek #(= "frame-background" (get-in % [:attrs :class]))))]
|
||||
(merge (add-attrs {} (:attrs svg-node)) node-attrs))
|
||||
|
@ -481,8 +488,9 @@
|
|||
(defn add-text-data
|
||||
[props node]
|
||||
(-> props
|
||||
(assoc :grow-type (get-meta node :grow-type keyword))
|
||||
(assoc :content (get-meta node :content (comp string->uuid json/decode)))))
|
||||
(assoc :grow-type (get-meta node :grow-type keyword))
|
||||
(assoc :content (get-meta node :content (comp string->uuid json/decode)))
|
||||
(assoc :position-data (get-meta node :position-data (comp string->uuid json/decode)))))
|
||||
|
||||
(defn add-group-data
|
||||
[props node]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue