mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix multiselect options
This commit is contained in:
parent
a3c330d6e7
commit
3e9da023f0
@ -37,7 +37,9 @@
|
||||
(defn attrs-to-styles
|
||||
[attrs]
|
||||
(reduce-kv (fn [res k v]
|
||||
(conj res (encode-style k v)))
|
||||
(if (some? v)
|
||||
(conj res (encode-style k v))
|
||||
res))
|
||||
#{}
|
||||
attrs))
|
||||
|
||||
|
||||
@ -95,7 +95,9 @@
|
||||
:text-direction "ltr"})
|
||||
|
||||
(def default-text-attrs
|
||||
{:font-id "sourcesanspro"
|
||||
{:typography-ref-file nil
|
||||
:typography-ref-id nil
|
||||
:font-id "sourcesanspro"
|
||||
:font-family "sourcesanspro"
|
||||
:font-variant-id "regular"
|
||||
:font-size "14"
|
||||
|
||||
@ -132,8 +132,10 @@
|
||||
"Maps attrs to styles"
|
||||
[styles]
|
||||
(let [mapped-styles
|
||||
(into {} (map attr->style styles))]
|
||||
(clj->js mapped-styles)))
|
||||
(into {} (comp (filter (fn [[_ v]] (some? v)))
|
||||
(map attr->style))
|
||||
styles)]
|
||||
(clj->js mapped-styles)))
|
||||
|
||||
(defn style-needs-mapping?
|
||||
[name]
|
||||
@ -199,12 +201,14 @@
|
||||
(let [style-name (get-style-name-as-css-variable k)
|
||||
[_ style-decode] (get mapping k)
|
||||
style-value (.getPropertyValue style-declaration style-name)]
|
||||
(when (or (not removed-mixed) (not (contains? mixed-values style-value)))
|
||||
(assoc acc k (style-decode style-value))))
|
||||
(if (or (not removed-mixed) (not (contains? mixed-values style-value)))
|
||||
(assoc acc k (style-decode style-value))
|
||||
acc))
|
||||
(let [style-name (get-style-name k)
|
||||
style-value (normalize-attr-value k (.getPropertyValue style-declaration style-name))]
|
||||
(when (or (not removed-mixed) (not (contains? mixed-values style-value)))
|
||||
(assoc acc k style-value))))) {} txt/text-style-attrs))
|
||||
(if (or (not removed-mixed) (not (contains? mixed-values style-value)))
|
||||
(assoc acc k style-value)
|
||||
acc)))) {} txt/text-style-attrs))
|
||||
|
||||
(defn get-styles-from-event
|
||||
"Returns a ClojureScript object compatible with text nodes"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user